Author: ablackmann Date: Sat Oct 31 19:43:15 2009 New Revision: 43882
URL: http://svn.reactos.org/svn/reactos?rev=43882&view=rev Log: Implement opening the layout file and printing out the target DLL architecture. Add missing exit(0).
Modified: trunk/reactos/tools/kbdtool/main.c
Modified: trunk/reactos/tools/kbdtool/main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/main.c?rev=43... ============================================================================== --- trunk/reactos/tools/kbdtool/main.c [iso-8859-1] (original) +++ trunk/reactos/tools/kbdtool/main.c [iso-8859-1] Sat Oct 31 19:43:15 2009 @@ -21,6 +21,8 @@ ULONG gSubVersion = 40; BOOLEAN UnicodeFile, Verbose, NoLogo, FallbackDriver, SanityCheck, SourceOnly; ULONG BuildType; +PCHAR gpszFileName; +FILE* gfpInput;
/* FUNCTIONS ******************************************************************/
@@ -60,6 +62,8 @@ char** argv) { CHAR Option; + PCHAR OpenFlags; + CHAR BuildOptions[16] = {0};
/* Loop for parameter */ while (TRUE) @@ -157,8 +161,62 @@ gVersion, gSubVersion); }
- /* Otherwise... do something */ - printf("Zoom zoom...\n"); + /* Save the file name */ + gpszFileName = argv[optind]; + + /* Open either as binary or text */ + OpenFlags = "rb"; + if (!UnicodeFile) OpenFlags = "rt"; + + /* Open a handle to the file */ + gfpInput = fopen(gpszFileName, OpenFlags); + if (!gfpInput) + { + /* Couldn't open it */ + printf("Unable to open '%s' for read.\n", gpszFileName); + exit(1); + } + + /* Should we print out what we're doing? */ + if (!NoLogo) + { + /* Are we only building the source files? */ + if (SourceOnly) + { + /* Then there's no target architecture */ + strcpy(BuildOptions, "source files"); + } + else + { + /* Take a look at the target architecture*/ + switch (BuildType) + { + /* Print the appropriate message depending on what was chosen */ + case 0: + strcpy(BuildOptions, "i386/x86"); + break; + case 1: + strcpy(BuildOptions, "ia64"); + break; + case 2: + strcpy(BuildOptions, "amd64/x64"); + break; + case 3: + strcpy(BuildOptions, "wow64"); + break; + default: + strcpy(BuildOptions, "unknown purpose"); + break; + } + } + + /* Now inform the user */ + printf("Compiling layout information from '%s' for %s.\n", gpszFileName, BuildOptions); + } + + /* Now do something... */ + printf("Like a rock...\n"); + exit(0); }
/* EOF */