#include "inflib.h"
#include <debug.h>
Go to the source code of this file.
|
enum | parser_state {
HEADER,
PARSE_WIN31_LINE,
LINE_START,
KEY_NAME,
DELETE_KEY,
DEFAULT_VALUE_NAME,
QUOTED_VALUE_NAME,
DATA_START,
DELETE_VALUE,
DATA_TYPE,
STRING_DATA,
DWORD_DATA,
HEX_DATA,
EOL_BACKSLASH,
HEX_MULTILINE,
UNKNOWN_DATA,
SET_VALUE,
NB_PARSER_STATES,
LINE_START,
SECTION_NAME,
KEY_NAME,
VALUE_NAME,
EOL_BACKSLASH,
QUOTES,
LEADING_SPACES,
TRAILING_SPACES,
COMMENT,
NB_PARSER_STATES,
LINE_START,
SECTION_NAME,
KEY_NAME,
VALUE_NAME,
EOL_BACKSLASH,
QUOTES,
LEADING_SPACES,
TRAILING_SPACES,
COMMENT,
NB_PARSER_STATES,
LINE_START,
SECTION_NAME,
KEY_NAME,
VALUE_NAME,
EOL_BACKSLASH,
QUOTES,
LEADING_SPACES,
TRAILING_SPACES,
COMMENT,
NB_PARSER_STATES
} |
|
|
static const WCHAR * | line_start_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | section_name_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | key_name_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | value_name_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | eol_backslash_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | quotes_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | leading_spaces_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | trailing_spaces_state (struct parser *parser, const WCHAR *pos) |
|
static const WCHAR * | comment_state (struct parser *parser, const WCHAR *pos) |
|
static PINFCACHELINE | InfpFreeLine (PINFCACHELINE Line) |
|
PINFCACHESECTION | InfpFreeSection (PINFCACHESECTION Section) |
|
PINFCACHESECTION | InfpFindSection (PINFCACHE Cache, PCWSTR Name) |
|
PINFCACHESECTION | InfpAddSection (PINFCACHE Cache, PCWSTR Name) |
|
PINFCACHELINE | InfpAddLine (PINFCACHESECTION Section) |
|
PINFCACHESECTION | InfpFindSectionById (PINFCACHE Cache, UINT Id) |
|
PINFCACHESECTION | InfpGetSectionForContext (PINFCONTEXT Context) |
|
PINFCACHELINE | InfpFindLineById (PINFCACHESECTION Section, UINT Id) |
|
PINFCACHELINE | InfpGetLineForContext (PINFCONTEXT Context) |
|
PVOID | InfpAddKeyToLine (PINFCACHELINE Line, PCWSTR Key) |
|
PVOID | InfpAddFieldToLine (PINFCACHELINE Line, PCWSTR Data) |
|
PINFCACHELINE | InfpFindKeyLine (PINFCACHESECTION Section, PCWSTR Key) |
|
static __inline void | push_state (struct parser *parser, enum parser_state state) |
|
static __inline void | pop_state (struct parser *parser) |
|
static __inline enum parser_state | set_state (struct parser *parser, enum parser_state state) |
|
static __inline int | is_eof (struct parser *parser, const WCHAR *ptr) |
|
static __inline int | is_eol (struct parser *parser, const WCHAR *ptr) |
|
static int | push_token (struct parser *parser, const WCHAR *pos) |
|
static PVOID | add_section_from_token (struct parser *parser) |
|
static struct field * | add_field_from_token (struct parser *parser, int is_key) |
|
static void | close_current_line (struct parser *parser) |
|
INFSTATUS | InfpParseBuffer (PINFCACHE file, const WCHAR *buffer, const WCHAR *end, PULONG error_line) |
|
◆ CONTROL_Z
◆ MAX_FIELD_LEN
#define MAX_FIELD_LEN 511 /* larger fields get silently truncated */ |
◆ MAX_SECTION_NAME_LEN
#define MAX_SECTION_NAME_LEN 255 |
◆ MAX_STRING_LEN
◆ NDEBUG
◆ parser_state_func
◆ parser_state
Enumerator |
---|
HEADER | |
PARSE_WIN31_LINE | |
LINE_START | |
KEY_NAME | |
DELETE_KEY | |
DEFAULT_VALUE_NAME | |
QUOTED_VALUE_NAME | |
DATA_START | |
DELETE_VALUE | |
DATA_TYPE | |
STRING_DATA | |
DWORD_DATA | |
HEX_DATA | |
EOL_BACKSLASH | |
HEX_MULTILINE | |
UNKNOWN_DATA | |
SET_VALUE | |
NB_PARSER_STATES | |
LINE_START | |
SECTION_NAME | |
KEY_NAME | |
VALUE_NAME | |
EOL_BACKSLASH | |
QUOTES | |
LEADING_SPACES | |
TRAILING_SPACES | |
COMMENT | |
NB_PARSER_STATES | |
LINE_START | |
SECTION_NAME | |
KEY_NAME | |
VALUE_NAME | |
EOL_BACKSLASH | |
QUOTES | |
LEADING_SPACES | |
TRAILING_SPACES | |
COMMENT | |
NB_PARSER_STATES | |
LINE_START | |
SECTION_NAME | |
KEY_NAME | |
VALUE_NAME | |
EOL_BACKSLASH | |
QUOTES | |
LEADING_SPACES | |
TRAILING_SPACES | |
COMMENT | |
NB_PARSER_STATES | |
Definition at line 25 of file infcore.c.
◆ add_field_from_token()
Definition at line 517 of file infcore.c.
PINFCACHELINE InfpAddLine(PINFCACHESECTION Section)
#define INF_STATUS_NOT_ENOUGH_MEMORY
PINFCACHESECTION cur_section
CHAR token[MAX_FIELD_LEN+1]
PVOID InfpAddFieldToLine(PINFCACHELINE Line, PCWSTR Data)
#define INF_STATUS_WRONG_INF_STYLE
PVOID InfpAddKeyToLine(PINFCACHELINE Line, PCWSTR Key)
Referenced by key_name_state(), and value_name_state().
◆ add_section_from_token()
Definition at line 485 of file infcore.c.
512 return (
PVOID)Section;
PINFCACHESECTION InfpAddSection(PINFCACHE Cache, PCWSTR Name)
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Name)
#define INF_STATUS_SECTION_NAME_TOO_LONG
#define INF_STATUS_NOT_ENOUGH_MEMORY
#define MAX_SECTION_NAME_LEN
PINFCACHESECTION cur_section
CHAR token[MAX_FIELD_LEN+1]
Referenced by section_name_state().
◆ close_current_line()
◆ comment_state()
Definition at line 852 of file infcore.c.
static __inline void pop_state(struct parser *parser)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
◆ eol_backslash_state()
Definition at line 739 of file infcore.c.
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline void pop_state(struct parser *parser)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eof(struct parser *parser, const WCHAR *ptr)
static __inline void push_state(struct parser *parser, enum parser_state state)
static int push_token(struct parser *parser, const WCHAR *pos)
◆ InfpAddFieldToLine()
Definition at line 353 of file infcore.c.
374 Line->FirstField = Field;
375 Line->LastField = Field;
379 Line->LastField->Next = Field;
381 Line->LastField = Field;
struct _INFCACHEFIELD * Prev
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
IN PVOID IN PVOID IN USHORT IN USHORT Size
struct _INFCACHEFIELD * PINFCACHEFIELD
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
#define FIELD_OFFSET(t, f)
#define ZEROMEMORY(Area, Size)
Referenced by add_field_from_token().
◆ InfpAddKeyToLine()
Definition at line 324 of file infcore.c.
335 DPRINT1(
"Line already has a key\n");
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Referenced by add_field_from_token().
◆ InfpAddLine()
◆ InfpAddSection()
Definition at line 171 of file infcore.c.
179 DPRINT(
"Invalid parameter\n");
189 DPRINT(
"MALLOC() failed\n");
194 Section->
Id = ++
Cache->NextSectionId;
202 Cache->FirstSection = Section;
203 Cache->LastSection = Section;
207 Cache->LastSection->Next = Section;
209 Cache->LastSection = Section;
struct _INFCACHESECTION * PINFCACHESECTION
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
IN PVOID IN PVOID IN USHORT IN USHORT Size
struct _INFCACHESECTION * Prev
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
#define FIELD_OFFSET(t, f)
#define ZEROMEMORY(Area, Size)
Referenced by add_section_from_token(), and InfpFindOrAddSection().
◆ InfpFindKeyLine()
◆ InfpFindLineById()
◆ InfpFindSection()
◆ InfpFindSectionById()
◆ InfpFreeLine()
◆ InfpFreeSection()
◆ InfpGetLineForContext()
Definition at line 310 of file infcore.c.
PINFCACHELINE InfpFindLineById(PINFCACHESECTION Section, UINT Id)
PINFCACHESECTION InfpGetSectionForContext(PINFCONTEXT Context)
Referenced by InfpAddField(), InfpFindNextLine(), InfpFindNextMatchLine(), InfpGetBinaryField(), InfpGetData(), InfpGetDataField(), InfpGetFieldCount(), InfpGetIntField(), InfpGetMultiSzField(), and InfpGetStringField().
◆ InfpGetSectionForContext()
◆ InfpParseBuffer()
Definition at line 865 of file infcore.c.
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Name)
PINFCACHESECTION cur_section
#define INF_STATUS_SUCCESS
static const parser_state_func parser_funcs[NB_PARSER_STATES]
◆ is_eof()
◆ is_eol()
◆ key_name_state()
Definition at line 632 of file infcore.c.
638 if (*
p ==
',')
break;
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
static __inline void push_state(struct parser *parser, enum parser_state state)
static struct field * add_field_from_token(struct parser *parser, int is_key)
static int push_token(struct parser *parser, const WCHAR *pos)
◆ leading_spaces_state()
Definition at line 810 of file infcore.c.
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline void pop_state(struct parser *parser)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
◆ line_start_state()
Definition at line 568 of file infcore.c.
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eof(struct parser *parser, const WCHAR *ptr)
static __inline void push_state(struct parser *parser, enum parser_state state)
static void close_current_line(struct parser *parser)
◆ pop_state()
◆ push_state()
◆ push_token()
◆ quotes_state()
Definition at line 780 of file infcore.c.
static __inline void pop_state(struct parser *parser)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
static int push_token(struct parser *parser, const WCHAR *pos)
◆ section_name_state()
Definition at line 610 of file infcore.c.
static PVOID add_section_from_token(struct parser *parser)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
static __inline void push_state(struct parser *parser, enum parser_state state)
#define INF_STATUS_BAD_SECTION_NAME_LINE
static int push_token(struct parser *parser, const WCHAR *pos)
◆ set_state()
◆ trailing_spaces_state()
Definition at line 832 of file infcore.c.
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline void pop_state(struct parser *parser)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
◆ value_name_state()
Definition at line 686 of file infcore.c.
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
static __inline void push_state(struct parser *parser, enum parser_state state)
static struct field * add_field_from_token(struct parser *parser, int is_key)
static int push_token(struct parser *parser, const WCHAR *pos)
◆ parser_funcs
Initial value:=
{
}
static const WCHAR * section_name_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * trailing_spaces_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * line_start_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * value_name_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * eol_backslash_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * comment_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * quotes_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * key_name_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * leading_spaces_state(struct parser *parser, const WCHAR *pos)
Definition at line 69 of file infcore.c.
Referenced by InfpParseBuffer().