mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 06:39:43 +00:00
[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
This commit is contained in:
parent
c7eb46d9fd
commit
92b99b865e
14 changed files with 520 additions and 569 deletions
122
base/setup/lib/inicache.h
Normal file
122
base/setup/lib/inicache.h
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* 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 */
|
Loading…
Add table
Add a link
Reference in a new issue