ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

match.c
Go to the documentation of this file.
00001 /*
00002  * ReactOS log2lines
00003  * Written by Jan Roeloffzen
00004  *
00005  * - Custom match routines
00006  */
00007 
00008 #include <string.h>
00009 
00010 #include "config.h"
00011 #include "log2lines.h"
00012 #include "match.h"
00013 
00014 // break pattern: show source+line
00015 static int match_break(FILE *outFile, char *Line, int processed)
00016 {
00017     static int state = 0;
00018 
00019     if ( processed ) return processed;
00020     switch (state)
00021     {
00022     case 1:
00023         state = 0;
00024         break;
00025     default:
00026         state = 0;
00027     }
00028     return 1;
00029 }
00030 // "mod" command: update relocated addresses
00031 static int match_mod(FILE *outFile, char *Line, int processed)
00032 {
00033     static int state = 0;
00034     char Image[NAMESIZE];
00035     DWORD Base;
00036     DWORD Size;
00037     PLIST_MEMBER plm;
00038 
00039     int cnt;
00040 
00041     if ( processed ) return processed;
00042     if ( (cnt = sscanf(Line," Base Size %5s", Image)) == 1 )
00043     {
00044         l2l_dbg(1, "Module relocate list:\n");
00045         state = 1;
00046         return 0;
00047     }
00048     switch (state)
00049     {
00050     case 1:
00051         if ( (cnt = sscanf(Line,"%lx %lx %20s", &Base, &Size, Image)) == 3 )
00052         {
00053             if (( plm = entry_lookup(&cache, Image) ))
00054             {
00055                 plm->RelBase = Base;
00056                 plm->Size = Size;
00057                 l2l_dbg(1, "Relocated: %s %08x -> %08x\n", Image, plm->ImageBase, plm->RelBase);
00058             }
00059             return 0;
00060         }
00061         else
00062         {
00063             state = 0;
00064         }
00065         break;
00066     default:
00067         state = 0;
00068     }
00069     return 1;
00070 }
00071 
00072 int match_line(FILE *outFile, char *Line)
00073 {
00074     int processed = 1;
00075 
00076     if ( *Line == '\n' || *Line == '\0' )
00077         return 1;
00078     if ( strncmp(Line, KDBG_CONT, sizeof(KDBG_CONT)-1 ) == 0 )
00079         return 1;
00080 
00081     processed = match_mod(outFile, Line, processed);
00082     processed = match_break(outFile, Line, processed);
00083     /* more to be appended here:
00084      * processed = match_xxx(outFile, Line, processed );
00085      * ...
00086      */
00087 
00088     return (int)(Line[0]);
00089 }
00090 
00091 /* EOF */

Generated on Sun May 27 2012 04:37:45 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.