reactos/base/setup/lib/inicache.h
Hermès Bélusca-Maïto 92b99b865e
[SETUPLIB][USETUP] Move some code to the SetupLib.
- filesup.c's functions ConcatPaths(), Does[Path|File]Exist(), NtPathToDiskPartComponents(), OpenAndMapFile(), UnMapFile();
- Move the inicache library to setuplib as it'll be used for the 1st stage GUI setup too (indeed, there is no good INI file API
  under Win32; the Win32 profile "API" is just good enough to manipulate the win16 ini files, and are here anyways for backward
  compatibility purposes only);
- Move the OS detector too.
- Remove the duplicated ConcatPaths() code in arcname.c.

svn path=/branches/setup_improvements/; revision=74634
svn path=/branches/setup_improvements/; revision=74638
2018-06-03 22:12:35 +02:00

123 lines
2.1 KiB
C

/*
* 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 _INICACHEKEY
{
PWCHAR Name;
PWCHAR Data;
struct _INICACHEKEY *Next;
struct _INICACHEKEY *Prev;
} INICACHEKEY, *PINICACHEKEY;
typedef struct _INICACHESECTION
{
PWCHAR Name;
PINICACHEKEY FirstKey;
PINICACHEKEY LastKey;
struct _INICACHESECTION *Next;
struct _INICACHESECTION *Prev;
} INICACHESECTION, *PINICACHESECTION;
typedef struct _INICACHE
{
PINICACHESECTION FirstSection;
PINICACHESECTION LastSection;
} INICACHE, *PINICACHE;
typedef struct _PINICACHEITERATOR
{
PINICACHESECTION Section;
PINICACHEKEY Key;
} INICACHEITERATOR, *PINICACHEITERATOR;
typedef enum
{
INSERT_FIRST,
INSERT_BEFORE,
INSERT_AFTER,
INSERT_LAST
} INSERTION_TYPE;
/* FUNCTIONS ****************************************************************/
NTSTATUS
IniCacheLoadFromMemory(
PINICACHE *Cache,
PCHAR FileBuffer,
ULONG FileLength,
BOOLEAN String);
NTSTATUS
IniCacheLoad(
PINICACHE *Cache,
PWCHAR FileName,
BOOLEAN String);
VOID
IniCacheDestroy(
PINICACHE Cache);
PINICACHESECTION
IniCacheGetSection(
PINICACHE Cache,
PWCHAR Name);
NTSTATUS
IniCacheGetKey(
PINICACHESECTION Section,
PWCHAR KeyName,
PWCHAR *KeyData);
PINICACHEITERATOR
IniCacheFindFirstValue(
PINICACHESECTION Section,
PWCHAR *KeyName,
PWCHAR *KeyData);
BOOLEAN
IniCacheFindNextValue(
PINICACHEITERATOR Iterator,
PWCHAR *KeyName,
PWCHAR *KeyData);
VOID
IniCacheFindClose(
PINICACHEITERATOR Iterator);
PINICACHEKEY
IniCacheInsertKey(
PINICACHESECTION Section,
PINICACHEKEY AnchorKey,
INSERTION_TYPE InsertionType,
PWCHAR Name,
PWCHAR Data);
PINICACHE
IniCacheCreate(VOID);
NTSTATUS
IniCacheSave(
PINICACHE Cache,
PWCHAR FileName);
PINICACHESECTION
IniCacheAppendSection(
PINICACHE Cache,
PWCHAR Name);
/* EOF */