Author: ablackmann
Date: Sat Oct 31 23:18:28 2009
New Revision: 43889

URL: http://svn.reactos.org/svn/reactos?rev=43889&view=rev
Log:
Implement DoCOMPANY, DoCOPYRIGHT, DoVERSION and DoLOCALENAME... that was the 
easy part.
Happy Halloween everybody!

Modified:
    trunk/reactos/tools/kbdtool/parser.c

Modified: trunk/reactos/tools/kbdtool/parser.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/kbdtool/parser.c?rev=43889&r1=43888&r2=43889&view=diff
==============================================================================
--- trunk/reactos/tools/kbdtool/parser.c [iso-8859-1] (original)
+++ trunk/reactos/tools/kbdtool/parser.c [iso-8859-1] Sat Oct 31 23:18:28 2009
@@ -23,8 +23,12 @@
 extern FILE* gfpInput;
 CHAR gBuf[256];
 CHAR gKBDName[10];
+CHAR gCopyright[256];
 CHAR gDescription[256];
+CHAR gCompany[256];
+CHAR gLocaleName[256];
 ULONG gID = 0;
+ULONG gKbdLayoutVersion;
 CHAR g_Layout[4096];
 ULONG gLineCount;
 PCHAR KeyWordList[KEYWORD_COUNT] =
@@ -132,8 +136,6 @@
 ULONG
 DoKBD(VOID)
 {    
-    PCHAR p;
-    
     /* On Unicode files, we need to find the Unicode marker (FEEF) */
     ASSERT(UnicodeFile == FALSE);
     
@@ -156,25 +158,70 @@
 
 ULONG
 DoVERSION(VOID)
-{    
+{           
+    /* Scan for the value */
+    if (sscanf(gBuf, "VERSION %d", &gKbdLayoutVersion) < 1)
+    {
+        /* Couldn't find them */
+        printf("Unable to read keyboard version information.\n");
+    }
+    
+    /* Debug only */
+    DPRINT1("VERSION [%d]\n", gKbdLayoutVersion);
     return SkipLines();
 }
 
 ULONG
 DoCOPYRIGHT(VOID)
 {    
+    /* Initial values */
+    *gCopyright = '\0';
+    
+    /* Scan for the value */
+    if (sscanf(gBuf, "COPYRIGHT \"%40[^\"]\"", gCopyright) < 1)
+    {
+        /* Couldn't find them */
+        printf("Unable to read the specified COPYRIGHT string.\n");
+    }
+    
+    /* Debug only */
+    DPRINT1("COPYRIGHT [%40s]\n", gCopyright);
     return SkipLines();
 }
 
 ULONG
 DoCOMPANY(VOID)
 {    
+    /* Initial values */
+    *gCompany = '\0';
+    
+    /* Scan for the value */
+    if (sscanf(gBuf, "COMPANY \"%85[^\"]\"", gCompany) < 1)
+    {
+        /* Couldn't find them */
+        printf("Unable to read the specified COMPANY name.\n");
+    }
+    
+    /* Debug only */
+    DPRINT1("COMPANY [%85s]\n", gCompany);
     return SkipLines();
 }
 
 ULONG
 DoLOCALENAME(VOID)
 {    
+    /* Initial values */
+    *gLocaleName = '\0';
+    
+    /* Scan for the value */
+    if (sscanf(gBuf, "LOCALENAME \"%40[^\"]\"", gLocaleName) < 1)
+    {
+        /* Couldn't find them */
+        printf("Unable to read the specified COPYRIGHT string.\n");
+    }
+    
+    /* Debug only */
+    DPRINT1("LOCALENAME [%40s]\n", gLocaleName);
     return SkipLines();
 }
 


Reply via email to