| OLD | NEW |
| 1 #!/bin/sh -e | 1 #!/bin/sh -e |
| 2 | 2 |
| 3 # Make certain that the script is not running in an internationalized | 3 # Make certain that the script is not running in an internationalized |
| 4 # environment. | 4 # environment. |
| 5 LANG=C ; export LANG | 5 LANG=C ; export LANG |
| 6 LC_ALL=C ; export LC_ALL | 6 LC_ALL=C ; export LC_ALL |
| 7 | 7 |
| 8 if test $# -ne 3 | 8 if test $# -ne 3 |
| 9 then | 9 then |
| 10 echo "Usage: $0 <h|inc> <observer.texi> <observer.out>" 1>&2 | 10 echo "Usage: $0 <h|inc> <observer.texi> <observer.out>" 1>&2 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 cat<<EOF >>${otmp} | 129 cat<<EOF >>${otmp} |
| 130 struct ${event}_args { `echo "${formal}" | sed -e 's/,/;/g'`; }; | 130 struct ${event}_args { `echo "${formal}" | sed -e 's/,/;/g'`; }; |
| 131 | 131 |
| 132 EOF | 132 EOF |
| 133 fi | 133 fi |
| 134 cat <<EOF >>${otmp} | 134 cat <<EOF >>${otmp} |
| 135 static void | 135 static void |
| 136 observer_${event}_notification_stub (const void *data, const void *args_data) | 136 observer_${event}_notification_stub (const void *data, const void *args_data) |
| 137 { | 137 { |
| 138 observer_${event}_ftype *notify = (observer_${event}_ftype *) data; | 138 observer_${event}_ftype *notify = (observer_${event}_ftype *) data; |
| 139 EOF |
| 140 |
| 141 notify_args=`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args->\1
/g'` |
| 142 |
| 143 if test ! -z "${notify_args}"; then |
| 144 cat<<EOF >>${otmp} |
| 139 const struct ${event}_args *args = args_data; | 145 const struct ${event}_args *args = args_data; |
| 140 notify (`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args->\1/g'`); | 146 EOF |
| 147 » fi |
| 148 » cat <<EOF >>${otmp} |
| 149 notify (${notify_args}); |
| 141 } | 150 } |
| 142 | 151 |
| 143 struct observer * | 152 struct observer * |
| 144 observer_attach_${event} (observer_${event}_ftype *f) | 153 observer_attach_${event} (observer_${event}_ftype *f) |
| 145 { | 154 { |
| 146 return generic_observer_attach (&${event}_subject, | 155 return generic_observer_attach (&${event}_subject, |
| 147 &observer_${event}_notification_stub, | 156 &observer_${event}_notification_stub, |
| 148 (void *) f); | 157 (void *) f); |
| 149 } | 158 } |
| 150 | 159 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 181 case $lang in | 190 case $lang in |
| 182 h) cat <<EOF >>${otmp} | 191 h) cat <<EOF >>${otmp} |
| 183 | 192 |
| 184 #endif /* OBSERVER_H */ | 193 #endif /* OBSERVER_H */ |
| 185 EOF | 194 EOF |
| 186 esac | 195 esac |
| 187 | 196 |
| 188 | 197 |
| 189 echo Moving ${otmp} to ${o} | 198 echo Moving ${otmp} to ${o} |
| 190 mv ${otmp} ${o} | 199 mv ${otmp} ${o} |
| OLD | NEW |