3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
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.
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.
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.
27 #define INI_FILE_COMMENT_CHAR ';'
31 // This structure describes a single .ini file item
32 // The item format in the .ini file is:
40 } INI_SECTION_ITEM
, *PINI_SECTION_ITEM
;
42 // This structure describes a .ini file section
43 // The section format in the .ini file is:
45 // This structure has a list of section items with
46 // one INI_SECTION_ITEM for each line in the section
51 ULONG SectionItemCount
;
52 PINI_SECTION_ITEM SectionItemList
;
54 } INI_SECTION
, *PINI_SECTION
;
56 extern PINI_SECTION IniFileSectionListHead
;
57 extern ULONG IniFileSectionCount
;
58 extern ULONG IniFileSettingCount
;
60 PFILE
IniOpenIniFile();
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
);
76 #endif // defined __INI_H