summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genlang15
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. */
34extern unsigned char *language_strings[]; 35extern unsigned char *language_strings[];
36/* this contains the concatenation of all strings, separated by \0 chars */
37extern const unsigned char language_builtin[];
35 38
36/* The enum below contains all available strings */ 39/* The enum below contains all available strings */
37enum { 40enum {
@@ -41,8 +44,11 @@ MOO
41print CFILE <<MOO 44print 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
45unsigned char *language_strings[]={ 50unsigned char *language_strings[LANG_LAST_INDEX_IN_ARRAY];
51const unsigned char language_builtin[] =
46MOO 52MOO
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
120print CFILE <<MOO 127print CFILE <<MOO
121}; 128;
122/* end of generated string list */ 129/* end of generated string list */
123MOO 130MOO
124 ; 131 ;