2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS EventCreate Command
4 * FILE: base/applications/cmdutils/eventcreate/evtmsggen.c
5 * PURPOSE: Generator for the event message string templates file.
6 * Creates the message string file in the current directory.
7 * PROGRAMMER: Hermes Belusca-Maito
9 * You can compile this generator:
10 * with GCC : $ gcc -o evtmsggen.exe evtmsggen.c
11 * with MSVC: $ cl evtmsggen.c (or: $ cl /Fe"evtmsggen.exe" evtmsggen.c)
17 * Enable/disable this option to use "English" for the message table language.
18 * The default behaviour when the option is disabled selects "Neutral" language.
22 /* The default End-Of-Line control for the message file */
26 static void usage(char* name
)
28 fprintf(stdout
, "Usage: %s ID_min ID_max outfile.mc\n", name
);
31 int main(int argc
, char* argv
[])
34 unsigned int id_min
, id_max
;
37 /* Validate the arguments */
44 id_min
= (unsigned int)atoi(argv
[1]);
45 id_max
= (unsigned int)atoi(argv
[2]);
48 fprintf(stderr
, "ERROR: Min ID %u cannot be strictly greater than Max ID %u !\n", id_min
, id_max
);
53 outFile
= fopen(argv
[3], "wb");
56 fprintf(stderr
, "ERROR: Could not create output file '%s'.\n", argv
[3]);
60 /* Generate the file */
62 /* Write the header */
66 "; * Contains event message string templates for the EventCreate Command." EOL
68 "; * This file is autogenerated, do not edit." EOL
69 "; * Generated with:" EOL
74 "LanguageNames=(English=0x409:MSG00409)" EOL
76 "LanguageNames=(Neutral=0x0000:MSG00000)" EOL
78 "MessageIdTypedef=DWORD" EOL
81 argv
[0], id_min
/* argv[1] */, id_max
/* argv[2] */, argv
[3]);
83 /* Write the message string templates */
84 for (i
= id_min
; i
<= id_max
; ++i
)
89 "Language=English" EOL
91 "Language=Neutral" EOL