Implement adding new sections/lines/fields and writing the resulting file
[reactos.git] / reactos / lib / inflib / infhost.h
1 /*
2 * PROJECT: .inf file parser
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PROGRAMMER: Royce Mitchell III
5 * Eric Kohl
6 * Ge van Geldorp <gvg@reactos.org>
7 */
8
9 #ifndef INFHOST_H_INCLUDED
10 #define INFHOST_H_INCLUDED
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */
15
16 #include <infcommon.h>
17
18 extern int InfHostOpenBufferedFile(PHINF InfHandle,
19 void *Buffer,
20 unsigned long BufferSize,
21 unsigned long *ErrorLine);
22 extern int InfHostOpenFile(PHINF InfHandle,
23 const char *FileName,
24 unsigned long *ErrorLine);
25 extern int InfHostWriteFile(HINF InfHandle,
26 const char *FileName,
27 const char *HeaderComment);
28 extern void InfHostCloseFile(HINF InfHandle);
29 extern int InfHostFindFirstLine(HINF InfHandle,
30 const char *Section,
31 const char *Key,
32 PINFCONTEXT *Context);
33 extern int InfHostFindNextLine(PINFCONTEXT ContextIn,
34 PINFCONTEXT ContextOut);
35 extern int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn,
36 const char *Key,
37 PINFCONTEXT ContextOut);
38 extern int InfHostFindNextMatchLine(PINFCONTEXT ContextIn,
39 const char *Key,
40 PINFCONTEXT ContextOut);
41 extern long InfHostGetLineCount(HINF InfHandle,
42 const char *Section);
43 extern long InfHostGetFieldCount(PINFCONTEXT Context);
44 extern int InfHostGetBinaryField(PINFCONTEXT Context,
45 unsigned long FieldIndex,
46 unsigned char *ReturnBuffer,
47 unsigned long ReturnBufferSize,
48 unsigned long *RequiredSize);
49 extern int InfHostGetIntField(PINFCONTEXT Context,
50 unsigned long FieldIndex,
51 unsigned long *IntegerValue);
52 extern int InfHostGetMultiSzField(PINFCONTEXT Context,
53 unsigned long FieldIndex,
54 char *ReturnBuffer,
55 unsigned long ReturnBufferSize,
56 unsigned long *RequiredSize);
57 extern int InfHostGetStringField(PINFCONTEXT Context,
58 unsigned long FieldIndex,
59 char *ReturnBuffer,
60 unsigned long ReturnBufferSize,
61 unsigned long *RequiredSize);
62 extern int InfHostGetData(PINFCONTEXT Context,
63 char **Key,
64 char **Data);
65 extern int InfHostGetDataField(PINFCONTEXT Context,
66 unsigned long FieldIndex,
67 char **Data);
68 extern int InfHostFindOrAddSection(HINF InfHandle,
69 const char *Section,
70 PINFCONTEXT *Context);
71 extern int InfHostAddLine(PINFCONTEXT Context, const char *Key);
72 extern int InfHostAddField(PINFCONTEXT Context, const char *Data);
73 extern void InfHostFreeContext(PINFCONTEXT Context);
74
75 #ifdef __cplusplus
76 }
77 #endif /* __cplusplus */
78
79 #endif /* INFROS_H_INCLUDED */
80
81 /* EOF */