-
Notifications
You must be signed in to change notification settings - Fork 13
/
iniparse.h
72 lines (59 loc) · 1.37 KB
/
iniparse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef _INIPARSE_H_
#define _INIPARSE_H_
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct IniLoadSection_s
{
char* sectname;
char* filename;
uint32_t skip;
uint32_t count;
uint32_t dst;
} IniLoadSection_t;
typedef struct IniCopySection_s
{
char* sectname;
uint32_t compType;
uint32_t src;
uint32_t srclen;
uint32_t dst;
uint32_t dstlen;
} IniCopySection_t;
typedef struct IniBootSection_s
{
char* sectname;
uint32_t pc;
} IniBootSection_t;
typedef struct IniLoadSectionNode_s
{
IniLoadSection_t curr;
struct IniLoadSectionNode_s* next;
} IniLoadSectionNode_t;
typedef struct IniCopySectionNode_s
{
IniCopySection_t curr;
struct IniCopySectionNode_s* next;
} IniCopySectionNode_t;
typedef struct IniBootSectionNode_s
{
IniBootSection_t curr;
struct IniBootSectionNode_s* next;
} IniBootSectionNode_t;
typedef struct IniParsedInfo_s
{
IniLoadSectionNode_t* loads;
IniCopySectionNode_t* copies;
IniBootSectionNode_t* boots;
} IniParsedInfo_t;
typedef void*(*AllocatorFunc)(size_t numBytes);
typedef int(*ErrPrintFunc)(const char* format, ...);
IniParsedInfo_t parse_memloader_ini(char* iniBytes, const int numBytes, AllocatorFunc allocator, ErrPrintFunc printer);
typedef void(*DeallocatorFunc)(void* allocBytes);
void free_memloader_info(IniParsedInfo_t* infoPtr, DeallocatorFunc deallocator);
#ifdef __cplusplus
}
#endif
#endif