ReactOS 0.4.15-dev-8231-g29a56f3
match.c File Reference
#include <string.h>
#include "config.h"
#include "log2lines.h"
#include "match.h"
Include dependency graph for match.c:

Go to the source code of this file.

Functions

static int match_break (FILE *outFile, char *Line, int processed)
 
static int match_mod (FILE *outFile, char *Line, int processed)
 
int match_line (FILE *outFile, char *Line)
 

Function Documentation

◆ match_break()

static int match_break ( FILE outFile,
char Line,
int  processed 
)
static

Definition at line 15 of file match.c.

16{
17 static int state = 0;
18
19 if ( processed ) return processed;
20 switch (state)
21 {
22 case 1:
23 state = 0;
24 break;
25 default:
26 state = 0;
27 }
28 return 1;
29}
static int state
Definition: maze.c:121
static int processed(const type_t *type)
Definition: typegen.c:2254

Referenced by match_line().

◆ match_line()

int match_line ( FILE outFile,
char Line 
)

Definition at line 72 of file match.c.

73{
74 int processed = 1;
75
76 if ( *Line == '\n' || *Line == '\0' )
77 return 1;
78 if ( strncmp(Line, KDBG_CONT, sizeof(KDBG_CONT)-1 ) == 0 )
79 return 1;
80
81 processed = match_mod(outFile, Line, processed);
83 /* more to be appended here:
84 * processed = match_xxx(outFile, Line, processed );
85 * ...
86 */
87
88 return (int)(Line[0]);
89}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
static int match_break(FILE *outFile, char *Line, int processed)
Definition: match.c:15
static int match_mod(FILE *outFile, char *Line, int processed)
Definition: match.c:31
#define KDBG_CONT
Definition: cmd.h:18
Definition: ncftp.h:79

Referenced by translate_files().

◆ match_mod()

static int match_mod ( FILE outFile,
char Line,
int  processed 
)
static

Definition at line 31 of file match.c.

32{
33 static int state = 0;
34 char Image[NAMESIZE];
35 UINT Base;
36 UINT Size;
37 PLIST_MEMBER plm;
38
39 int cnt;
40
41 if ( processed ) return processed;
42 if ( (cnt = sscanf(Line," Base Size %5s", Image)) == 1 )
43 {
44 l2l_dbg(1, "Module relocate list:\n");
45 state = 1;
46 return 0;
47 }
48 switch (state)
49 {
50 case 1:
51 if ( (cnt = sscanf(Line,"%x %x %20s", &Base, &Size, Image)) == 3 )
52 {
53 if (( plm = entry_lookup(&cache, Image) ))
54 {
55 plm->RelBase = Base;
56 plm->Size = Size;
57 l2l_dbg(1, "Relocated: %s %p -> %p\n", Image, (void*)plm->ImageBase, (void*)plm->RelBase);
58 }
59 return 0;
60 }
61 else
62 {
63 state = 0;
64 }
65 break;
66 default:
67 state = 0;
68 }
69 return 1;
70}
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
unsigned int UINT
Definition: ndis.h:50
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
#define NAMESIZE
Definition: config.h:31
PLIST_MEMBER entry_lookup(PLIST list, char *name)
Definition: list.c:19
#define l2l_dbg(level,...)
Definition: util.h:35
Definition: cache.c:49
size_t ImageBase
Definition: list.h:8
size_t Size
Definition: list.h:10
size_t RelBase
Definition: list.h:9
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by match_line().