16 #define CONTROL_Z '\x1a' 17 #define MAX_SECTION_NAME_LEN 255 18 #define MAX_FIELD_LEN 511 20 #define MAX_STRING_LEN (MAX_INF_STRING_LENGTH+1) 106 Field =
Line->FirstField->Next;
108 Line->FirstField = Field;
129 Next = Section->
Next;
154 Section =
Cache->FirstSection;
155 while (Section !=
NULL)
163 Section = Section->
Next;
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;
223 DPRINT(
"Invalid parameter\n");
230 DPRINT(
"MALLOC() failed\n");
259 for (Section =
Cache->FirstSection;
261 Section = Section->
Next)
263 if (Section->
Id ==
Id)
335 DPRINT1(
"Line already has a key\n");
374 Line->FirstField = Field;
375 Line->LastField = Field;
379 Line->LastField->Next = Field;
381 Line->LastField = Field;
448 (*
ptr ==
'\r' && *(
ptr + 1) ==
'\n') ||
512 return (
PVOID)Section;
638 if (*
p ==
',')
break;
PINFCACHESECTION InfpAddSection(PINFCACHE Cache, PCWSTR Name)
const WCHAR *(* parser_state_func)(struct parser *parser, const WCHAR *pos)
struct _INFCACHEFIELD * Prev
struct _INFCACHESECTION * PINFCACHESECTION
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
static const WCHAR * section_name_state(struct parser *parser, const WCHAR *pos)
static PVOID add_section_from_token(struct parser *parser)
struct _INFCACHELINE * PINFCACHELINE
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
static const WCHAR * trailing_spaces_state(struct parser *parser, const WCHAR *pos)
static __inline void pop_state(struct parser *parser)
PINFCACHELINE InfpFindLineById(PINFCACHESECTION Section, UINT Id)
IN PVOID IN PVOID IN USHORT IN USHORT Size
static PINFCACHELINE InfpFreeLine(PINFCACHELINE Line)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
struct _INFCACHEFIELD * PINFCACHEFIELD
PINFCACHELINE InfpAddLine(PINFCACHESECTION Section)
struct _INFCACHESECTION * Next
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Name)
PINFCACHELINE InfpFindKeyLine(PINFCACHESECTION Section, PCWSTR Key)
#define INF_STATUS_SECTION_NAME_TOO_LONG
static __inline int is_eof(struct parser *parser, const WCHAR *ptr)
#define INF_STATUS_NOT_ENOUGH_MEMORY
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
#define MAX_SECTION_NAME_LEN
struct _INFCACHESECTION * Prev
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)
struct _INFCACHE * PINFCACHE
#define INF_STATUS_BAD_SECTION_NAME_LINE
static const WCHAR * line_start_state(struct parser *parser, const WCHAR *pos)
static int push_token(struct parser *parser, const WCHAR *pos)
enum parser_state stack[4]
INFSTATUS InfpParseBuffer(PINFCACHE file, const WCHAR *buffer, const WCHAR *end, PULONG error_line)
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
static const WCHAR * value_name_state(struct parser *parser, const WCHAR *pos)
PINFCACHESECTION cur_section
#define INF_STATUS_SUCCESS
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
static const WCHAR * eol_backslash_state(struct parser *parser, const WCHAR *pos)
CHAR token[MAX_FIELD_LEN+1]
#define FIELD_OFFSET(t, f)
static const WCHAR * comment_state(struct parser *parser, const WCHAR *pos)
struct _INFCACHELINE * Next
PINFCACHELINE InfpGetLineForContext(PINFCONTEXT Context)
PVOID InfpAddFieldToLine(PINFCACHELINE Line, PCWSTR Data)
static void close_current_line(struct parser *parser)
static const WCHAR * quotes_state(struct parser *parser, const WCHAR *pos)
#define INF_STATUS_WRONG_INF_STYLE
PINFCACHESECTION InfpFindSectionById(PINFCACHE Cache, UINT Id)
static const WCHAR * key_name_state(struct parser *parser, const WCHAR *pos)
static const WCHAR * leading_spaces_state(struct parser *parser, const WCHAR *pos)
PVOID InfpAddKeyToLine(PINFCACHELINE Line, PCWSTR Key)
#define ZEROMEMORY(Area, Size)
PINFCACHESECTION InfpGetSectionForContext(PINFCONTEXT Context)
static const parser_state_func parser_funcs[NB_PARSER_STATES]