fixed some warnings with gcc4 (mostly assignment differs in signedness warnings)
[reactos.git] / reactos / boot / freeldr / freeldr / inifile / ini.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
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
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __INI_H
21 #define __INI_H
22
23 #include <rtl.h>
24 #include <fs.h>
25
26
27 #define INI_FILE_COMMENT_CHAR ';'
28
29
30
31 // This structure describes a single .ini file item
32 // The item format in the .ini file is:
33 // Name=Value
34 typedef struct
35 {
36 LIST_ITEM ListEntry;
37 PCHAR ItemName;
38 PCHAR ItemValue;
39
40 } INI_SECTION_ITEM, *PINI_SECTION_ITEM;
41
42 // This structure describes a .ini file section
43 // The section format in the .ini file is:
44 // [Section Name]
45 // This structure has a list of section items with
46 // one INI_SECTION_ITEM for each line in the section
47 typedef struct
48 {
49 LIST_ITEM ListEntry;
50 PCHAR SectionName;
51 ULONG SectionItemCount;
52 PINI_SECTION_ITEM SectionItemList;
53
54 } INI_SECTION, *PINI_SECTION;
55
56 extern PINI_SECTION IniFileSectionListHead;
57 extern ULONG IniFileSectionCount;
58 extern ULONG IniFileSettingCount;
59
60 PFILE IniOpenIniFile();
61
62 BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize);
63 ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset);
64 ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset);
65 BOOL IniIsLineEmpty(PCHAR LineOfText, ULONG TextLength);
66 BOOL IniIsCommentLine(PCHAR LineOfText, ULONG TextLength);
67 BOOL IniIsSectionName(PCHAR LineOfText, ULONG TextLength);
68 ULONG IniGetSectionNameSize(PCHAR SectionNameLine, ULONG LineLength);
69 VOID IniExtractSectionName(PCHAR SectionName, PCHAR SectionNameLine, ULONG LineLength);
70 BOOL IniIsSetting(PCHAR LineOfText, ULONG TextLength);
71 ULONG IniGetSettingNameSize(PCHAR SettingNameLine, ULONG LineLength);
72 ULONG IniGetSettingValueSize(PCHAR SettingValueLine, ULONG LineLength);
73 VOID IniExtractSettingName(PCHAR SettingName, PCHAR SettingNameLine, ULONG LineLength);
74 VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG LineLength);
75
76 #endif // defined __INI_H