diff options
Diffstat (limited to 'tools/genlang')
-rwxr-xr-x | tools/genlang | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/genlang b/tools/genlang index e13cd3faf9..2677735d2e 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -30,8 +30,11 @@ print HFILE <<MOO | |||
30 | */ | 30 | */ |
31 | #define str(x) language_strings[x] | 31 | #define str(x) language_strings[x] |
32 | 32 | ||
33 | /* this is the array with all the strings */ | 33 | /* this is the array for holding the string pointers. |
34 | It will be initialized at runtime. */ | ||
34 | extern unsigned char *language_strings[]; | 35 | extern unsigned char *language_strings[]; |
36 | /* this contains the concatenation of all strings, separated by \0 chars */ | ||
37 | extern const unsigned char language_builtin[]; | ||
35 | 38 | ||
36 | /* The enum below contains all available strings */ | 39 | /* The enum below contains all available strings */ |
37 | enum { | 40 | enum { |
@@ -41,8 +44,11 @@ MOO | |||
41 | print CFILE <<MOO | 44 | print CFILE <<MOO |
42 | /* This file was automaticly generated using genlang, the strings come | 45 | /* This file was automaticly generated using genlang, the strings come |
43 | from "$input" */ | 46 | from "$input" */ |
47 | |||
48 | #include "$prefix.h" | ||
44 | 49 | ||
45 | unsigned char *language_strings[]={ | 50 | unsigned char *language_strings[LANG_LAST_INDEX_IN_ARRAY]; |
51 | const unsigned char language_builtin[] = | ||
46 | MOO | 52 | MOO |
47 | ; | 53 | ; |
48 | 54 | ||
@@ -85,7 +91,8 @@ while(<LANG>) { | |||
85 | } | 91 | } |
86 | else { | 92 | else { |
87 | push @hfile, $set{'id'}; | 93 | push @hfile, $set{'id'}; |
88 | print CFILE " $value,\n"; | 94 | $value =~ s/\"$/\\0\"/; |
95 | print CFILE " $value\n"; | ||
89 | } | 96 | } |
90 | 97 | ||
91 | undef %set; | 98 | undef %set; |
@@ -118,7 +125,7 @@ MOO | |||
118 | ; | 125 | ; |
119 | 126 | ||
120 | print CFILE <<MOO | 127 | print CFILE <<MOO |
121 | }; | 128 | ; |
122 | /* end of generated string list */ | 129 | /* end of generated string list */ |
123 | MOO | 130 | MOO |
124 | ; | 131 | ; |