1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 18:54:47 +02:00

BUILD : 1.7.3 (186) BUGS : NOTES : Added langtool.c and modified some langcomp.c stuff in behalf of codemastr (win32 port)

git-svn-id: svn://svn.anope.org/anope/trunk@186 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@131 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-06-10 23:52:45 +00:00
parent 3bba983a61
commit eece3847bf
3 changed files with 67 additions and 4 deletions
+3 -3
View File
@@ -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;
}
+59
View File
@@ -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;
}
+5 -1
View File
@@ -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.