Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142/* * PROJECT: ReactOS Setup Library * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) * PURPOSE: INI file parser that caches contents of INI file in memory. * COPYRIGHT: Copyright 2002-2018 Royce Mitchell III */
#pragma once
typedef struct _INI_KEYWORD{ PWSTR Name; PWSTR Data; LIST_ENTRY ListEntry;} INI_KEYWORD, *PINI_KEYWORD;
typedef struct _INI_SECTION{ PWSTR Name; LIST_ENTRY KeyList; LIST_ENTRY ListEntry;} INI_SECTION, *PINI_SECTION;
typedef struct _INICACHE{ LIST_ENTRY SectionList;} INICACHE, *PINICACHE;
typedef struct _PINICACHEITERATOR{ PINI_SECTION Section; PINI_KEYWORD Key;} INICACHEITERATOR, *PINICACHEITERATOR;
typedef enum{ INSERT_FIRST, INSERT_BEFORE, INSERT_AFTER, INSERT_LAST} INSERTION_TYPE;
/* FUNCTIONS ****************************************************************/
NTSTATUSIniCacheLoadFromMemory( PINICACHE *Cache, PCHAR FileBuffer, ULONG FileLength, BOOLEAN String);
NTSTATUSIniCacheLoadByHandle( PINICACHE *Cache, HANDLE FileHandle, BOOLEAN String);
NTSTATUSIniCacheLoad( PINICACHE *Cache, PWCHAR FileName, BOOLEAN String);
VOIDIniCacheDestroy( _In_ PINICACHE Cache);
PINI_SECTIONIniGetSection( _In_ PINICACHE Cache, _In_ PCWSTR Name);
PINI_KEYWORDIniGetKey( _In_ PINI_SECTION Section, _In_ PCWSTR KeyName, _Out_ PCWSTR* KeyData);
PINICACHEITERATORIniFindFirstValue( _In_ PINI_SECTION Section, _Out_ PCWSTR* KeyName, _Out_ PCWSTR* KeyData);
BOOLEANIniFindNextValue( _In_ PINICACHEITERATOR Iterator, _Out_ PCWSTR* KeyName, _Out_ PCWSTR* KeyData);
VOIDIniFindClose( _In_ PINICACHEITERATOR Iterator);
PINI_SECTIONIniAddSection( _In_ PINICACHE Cache, _In_ PCWSTR Name);
VOIDIniRemoveSection( _In_ PINI_SECTION Section);
PINI_KEYWORDIniInsertKey( _In_ PINI_SECTION Section, _In_ PINI_KEYWORD AnchorKey, _In_ INSERTION_TYPE InsertionType, _In_ PCWSTR Name, _In_ PCWSTR Data);
PINI_KEYWORDIniAddKey( _In_ PINI_SECTION Section, _In_ PCWSTR Name, _In_ PCWSTR Data);
VOIDIniRemoveKeyByName( _In_ PINI_SECTION Section, _In_ PCWSTR KeyName);
VOIDIniRemoveKey( _In_ PINI_SECTION Section, _In_ PINI_KEYWORD Key);
PINICACHEIniCacheCreate(VOID);
NTSTATUSIniCacheSaveByHandle( PINICACHE Cache, HANDLE FileHandle);
NTSTATUSIniCacheSave( PINICACHE Cache, PWCHAR FileName);
/* EOF */