[USETUP] Improved entering of partition size
[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: base/setup/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 } INSERTION_TYPE;
73
74 /* FUNCTIONS ****************************************************************/
75
76 NTSTATUS
77 IniCacheLoad(
78 PINICACHE *Cache,
79 PWCHAR FileName,
80 BOOLEAN String);
81
82 VOID
83 IniCacheDestroy(
84 PINICACHE Cache);
85
86 PINICACHESECTION
87 IniCacheGetSection(
88 PINICACHE Cache,
89 PWCHAR Name);
90
91 NTSTATUS
92 IniCacheGetKey(
93 PINICACHESECTION Section,
94 PWCHAR KeyName,
95 PWCHAR *KeyData);
96
97 PINICACHEITERATOR
98 IniCacheFindFirstValue(
99 PINICACHESECTION Section,
100 PWCHAR *KeyName,
101 PWCHAR *KeyData);
102
103 BOOLEAN
104 IniCacheFindNextValue(
105 PINICACHEITERATOR Iterator,
106 PWCHAR *KeyName,
107 PWCHAR *KeyData);
108
109 VOID
110 IniCacheFindClose(
111 PINICACHEITERATOR Iterator);
112
113
114 PINICACHEKEY
115 IniCacheInsertKey(
116 PINICACHESECTION Section,
117 PINICACHEKEY AnchorKey,
118 INSERTION_TYPE InsertionType,
119 PWCHAR Name,
120 PWCHAR Data);
121
122 PINICACHE
123 IniCacheCreate(VOID);
124
125 NTSTATUS
126 IniCacheSave(
127 PINICACHE Cache,
128 PWCHAR FileName);
129
130 PINICACHESECTION
131 IniCacheAppendSection(
132 PINICACHE Cache,
133 PWCHAR Name);
134
135 /* EOF */