Fix some Rtl Prototype inconsistencies, more are in ntifs/winddk but i have fixed...
[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 PUCHAR ItemName;
38 PUCHAR 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 PUCHAR SectionName;
51 U32 SectionItemCount;
52 PINI_SECTION_ITEM SectionItemList;
53
54 } INI_SECTION, *PINI_SECTION;
55
56 extern PINI_SECTION IniFileSectionListHead;
57 extern U32 IniFileSectionCount;
58 extern U32 IniFileSettingCount;
59
60 PFILE IniOpenIniFile(U8 BootDriveNumber, U8 BootPartitionNumber);
61
62 BOOL IniParseFile(PUCHAR IniFileData, U32 IniFileSize);
63 U32 IniGetNextLineSize(PUCHAR IniFileData, U32 IniFileSize, U32 CurrentOffset);
64 U32 IniGetNextLine(PUCHAR IniFileData, U32 IniFileSize, PUCHAR Buffer, U32 BufferSize, U32 CurrentOffset);
65 BOOL IniIsLineEmpty(PUCHAR LineOfText, U32 TextLength);
66 BOOL IniIsCommentLine(PUCHAR LineOfText, U32 TextLength);
67 BOOL IniIsSectionName(PUCHAR LineOfText, U32 TextLength);
68 U32 IniGetSectionNameSize(PUCHAR SectionNameLine, U32 LineLength);
69 VOID IniExtractSectionName(PUCHAR SectionName, PUCHAR SectionNameLine, U32 LineLength);
70 BOOL IniIsSetting(PUCHAR LineOfText, U32 TextLength);
71 U32 IniGetSettingNameSize(PUCHAR SettingNameLine, U32 LineLength);
72 U32 IniGetSettingValueSize(PUCHAR SettingValueLine, U32 LineLength);
73 VOID IniExtractSettingName(PUCHAR SettingName, PUCHAR SettingNameLine, U32 LineLength);
74 VOID IniExtractSettingValue(PUCHAR SettingValue, PUCHAR SettingValueLine, U32 LineLength);
75
76 #endif // defined __INI_H