summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/langcomp.c6
-rw-r--r--lang/langtool.c59
-rw-r--r--version.log6
3 files changed, 67 insertions, 4 deletions
diff --git a/lang/langcomp.c b/lang/langcomp.c
index 8392fbd5b..791e23f93 100644
--- a/lang/langcomp.c
+++ b/lang/langcomp.c
@@ -61,7 +61,7 @@ int read_index_file()
char buf[256];
int i;
- if (!(f = fopen("index", "r"))) {
+ if (!(f = fopen("index", "rb"))) {
perror("fopen(index)");
return -1;
}
@@ -177,11 +177,11 @@ int main(int ac, char **av)
if (read_index_file() < 0)
return 1;
- if (!(in = fopen(filename, "r"))) {
+ if (!(in = fopen(filename, "rb"))) {
perror(filename);
return 1;
}
- if (!(out = fopen(outfile, "w"))) {
+ if (!(out = fopen(outfile, "wb"))) {
perror(outfile);
return 1;
}
diff --git a/lang/langtool.c b/lang/langtool.c
new file mode 100644
index 000000000..3175118e0
--- /dev/null
+++ b/lang/langtool.c
@@ -0,0 +1,59 @@
+/* Needed due to Windows lack of a decent interpreter */
+
+#include <string.h>
+#include <stdio.h>
+
+char *strip(char *str)
+{
+ char *c;
+ if ((c = strchr(str,'\n')))
+ *c = 0;
+ if ((c = strchr(str,'\r')))
+ *c = 0;
+ return str;
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc < 2)
+ exit(1);
+
+ /* Build the index file */
+ if (!strcmp(argv[1], "index"))
+ {
+ FILE *fd = fopen("en_us.l", "rb");
+ FILE *fdout = fopen("index", "wb");
+ char buf[1024];
+ if (!fd || !fdout)
+ exit(2);
+
+ while (fgets(buf, 1023, fd))
+ {
+ if (isupper(*buf))
+ fprintf(fdout, "%s", buf);
+ }
+ fclose(fd);
+ fclose(fdout);
+ }
+ /* Build the language.h file */
+ else if (!strcmp(argv[1], "language.h"))
+ {
+ FILE *fd = fopen("index", "r");
+ FILE *fdout = fopen("language.h", "w");
+ char buf[1024];
+ int i = 0;
+
+ if (!fd || !fdout)
+ exit(2);
+
+ fprintf(stderr, "Generating language.h... ");
+
+ while (fgets(buf, 1023, fd))
+ fprintf(fdout, "#define %-32s %d\n", strip(buf), i++);
+
+ fprintf(fdout, "#define NUM_STRINGS %d\n", i);
+ fprintf(stderr, "%d strings\n", i);
+ }
+ return 0;
+
+}
diff --git a/version.log b/version.log
index c1e72c396..72f00c78e 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="3"
-VERSION_BUILD="185"
+VERSION_BUILD="186"
# $Log$
#
+# BUILD : 1.7.3 (186)
+# BUGS :
+# NOTES : Added langtool.c and modified some langcomp.c stuff in behalf of codemastr (win32 port)
+#
# BUILD : 1.7.3 (185)
# BUGS : 99
# NOTES : User customizable pseudo-client modes.