Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / base / setup / usetup / inicache.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/inicache.h
23 * PURPOSE: INI file parser that caches contents of INI file in memory
24 * PROGRAMMER: Royce Mitchell III
25 * Eric Kohl
26 */
27
28 #pragma once
29
30 typedef struct _INICACHEKEY
31 {
32 PWCHAR Name;
33 PWCHAR Data;
34
35 struct _INICACHEKEY *Next;
36 struct _INICACHEKEY *Prev;
37 } INICACHEKEY, *PINICACHEKEY;
38
39
40 typedef struct _INICACHESECTION
41 {
42 PWCHAR Name;
43
44 PINICACHEKEY FirstKey;
45 PINICACHEKEY LastKey;
46
47 struct _INICACHESECTION *Next;
48 struct _INICACHESECTION *Prev;
49 } INICACHESECTION, *PINICACHESECTION;
50
51
52 typedef struct _INICACHE
53 {
54 PINICACHESECTION FirstSection;
55 PINICACHESECTION LastSection;
56 } INICACHE, *PINICACHE;
57
58
59 typedef struct _PINICACHEITERATOR
60 {
61 PINICACHESECTION Section;
62 PINICACHEKEY Key;
63 } INICACHEITERATOR, *PINICACHEITERATOR;
64
65
66 typedef enum
67 {
68 INSERT_FIRST,
69 INSERT_BEFORE,
70 INSERT_AFTER,
71 INSERT_LAST
72 } INSERTATION_TYPE;
73
74 /* FUNCTIONS ****************************************************************/
75
76 NTSTATUS
77 IniCacheLoad(PINICACHE *Cache,
78 PUNICODE_STRING FileName,
79 BOOLEAN String);
80
81 VOID
82 IniCacheDestroy(PINICACHE Cache);
83
84 PINICACHESECTION
85 IniCacheGetSection(PINICACHE Cache,
86 PWCHAR Name);
87
88 NTSTATUS
89 IniCacheGetKey(PINICACHESECTION Section,
90 PWCHAR KeyName,
91 PWCHAR *KeyData);
92
93
94
95 PINICACHEITERATOR
96 IniCacheFindFirstValue(PINICACHESECTION Section,
97 PWCHAR *KeyName,
98 PWCHAR *KeyData);
99
100 BOOLEAN
101 IniCacheFindNextValue(PINICACHEITERATOR Iterator,
102 PWCHAR *KeyName,
103 PWCHAR *KeyData);
104
105 VOID
106 IniCacheFindClose(PINICACHEITERATOR Iterator);
107
108
109 PINICACHEKEY
110 IniCacheInsertKey(PINICACHESECTION Section,
111 PINICACHEKEY AnchorKey,
112 INSERTATION_TYPE InsertationType,
113 PWCHAR Name,
114 PWCHAR Data);
115
116 PINICACHE
117 IniCacheCreate(VOID);
118
119 NTSTATUS
120 IniCacheSave(PINICACHE Cache,
121 PWCHAR FileName);
122
123 PINICACHESECTION
124 IniCacheAppendSection(PINICACHE Cache,
125 PWCHAR Name);
126
127 /* EOF */