|
59 | 59 | #ifndef $define
|
60 | 60 | #define $define
|
61 | 61 |
|
62 |
| -#define N_(x) (x) /* gettext noop */ |
63 |
| -
|
64 | 62 | #include \"postgres_fe.h\"
|
65 | 63 | #include \"pqexpbuffer.h\"
|
66 | 64 |
|
|
72 | 70 | int nl_count; /* number of newlines in syntax (for pager) */
|
73 | 71 | };
|
74 | 72 |
|
| 73 | +extern const struct _helpStruct QL_HELP[]; |
75 | 74 | ";
|
76 | 75 |
|
77 | 76 | print CFILE "/*
|
|
83 | 82 | *
|
84 | 83 | */
|
85 | 84 |
|
| 85 | +#define N_(x) (x) /* gettext noop */ |
| 86 | +
|
86 | 87 | #include \"$hfile\"
|
87 | 88 |
|
88 | 89 | ";
|
|
170 | 171 | $synopsis =~ s/\\n/\\n"\n$prefix"/g;
|
171 | 172 | my @args =
|
172 | 173 | ("buf", $synopsis, map("_(\"$_\")", @{ $entries{$_}{params} }));
|
173 |
| - print HFILE "extern void sql_help_$id(PQExpBuffer buf);\n"; |
174 |
| - print CFILE "void |
| 174 | + print CFILE "static void |
175 | 175 | sql_help_$id(PQExpBuffer buf)
|
176 | 176 | {
|
177 | 177 | \tappendPQExpBuffer(" . join(",\n$prefix", @args) . ");
|
|
180 | 180 | ";
|
181 | 181 | }
|
182 | 182 |
|
183 |
| -print HFILE " |
184 |
| -
|
185 |
| -static const struct _helpStruct QL_HELP[] = { |
| 183 | +print CFILE " |
| 184 | +const struct _helpStruct QL_HELP[] = { |
186 | 185 | ";
|
187 | 186 | foreach (sort keys %entries)
|
188 | 187 | {
|
189 | 188 | my $id = $_;
|
190 | 189 | $id =~ s/ /_/g;
|
191 |
| - print HFILE " { \"$_\", |
| 190 | + print CFILE " { \"$_\", |
192 | 191 | N_(\"$entries{$_}{cmddesc}\"),
|
193 | 192 | sql_help_$id,
|
194 | 193 | $entries{$_}{nl_count} },
|
195 | 194 |
|
196 | 195 | ";
|
197 | 196 | }
|
198 | 197 |
|
199 |
| -print HFILE " |
| 198 | +print CFILE " |
200 | 199 | { NULL, NULL, NULL } /* End of list marker */
|
201 | 200 | };
|
| 201 | +"; |
202 | 202 |
|
203 |
| -
|
| 203 | +print HFILE " |
204 | 204 | #define QL_HELP_COUNT "
|
205 | 205 | . scalar(keys %entries) . " /* number of help items */
|
206 | 206 | #define QL_MAX_CMD_LEN $maxlen /* largest strlen(cmd) */
|
|
0 commit comments