2002-11-13 18:25:18 +00:00
|
|
|
/*
|
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 2002 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2002-11-13 18:25:18 +00:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS text-mode setup
|
2015-09-13 16:40:36 +00:00
|
|
|
* FILE: base/setup/usetup/inicache.h
|
2002-11-13 18:25:18 +00:00
|
|
|
* PURPOSE: INI file parser that caches contents of INI file in memory
|
|
|
|
* PROGRAMMER: Royce Mitchell III
|
|
|
|
* Eric Kohl
|
|
|
|
*/
|
|
|
|
|
2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
typedef struct _INICACHEKEY
|
|
|
|
{
|
2014-05-12 14:17:37 +00:00
|
|
|
PWCHAR Name;
|
|
|
|
PWCHAR Data;
|
2002-11-13 18:25:18 +00:00
|
|
|
|
2014-05-12 14:17:37 +00:00
|
|
|
struct _INICACHEKEY *Next;
|
|
|
|
struct _INICACHEKEY *Prev;
|
2002-11-13 18:25:18 +00:00
|
|
|
} INICACHEKEY, *PINICACHEKEY;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _INICACHESECTION
|
|
|
|
{
|
2014-05-12 14:17:37 +00:00
|
|
|
PWCHAR Name;
|
2002-11-13 18:25:18 +00:00
|
|
|
|
2014-05-12 14:17:37 +00:00
|
|
|
PINICACHEKEY FirstKey;
|
|
|
|
PINICACHEKEY LastKey;
|
2002-11-13 18:25:18 +00:00
|
|
|
|
2014-05-12 14:17:37 +00:00
|
|
|
struct _INICACHESECTION *Next;
|
|
|
|
struct _INICACHESECTION *Prev;
|
2002-11-13 18:25:18 +00:00
|
|
|
} INICACHESECTION, *PINICACHESECTION;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _INICACHE
|
|
|
|
{
|
2014-05-12 14:17:37 +00:00
|
|
|
PINICACHESECTION FirstSection;
|
|
|
|
PINICACHESECTION LastSection;
|
2002-11-13 18:25:18 +00:00
|
|
|
} INICACHE, *PINICACHE;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _PINICACHEITERATOR
|
|
|
|
{
|
2014-05-12 14:17:37 +00:00
|
|
|
PINICACHESECTION Section;
|
|
|
|
PINICACHEKEY Key;
|
2002-11-13 18:25:18 +00:00
|
|
|
} INICACHEITERATOR, *PINICACHEITERATOR;
|
|
|
|
|
|
|
|
|
2003-01-17 13:18:15 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2014-05-12 14:17:37 +00:00
|
|
|
INSERT_FIRST,
|
|
|
|
INSERT_BEFORE,
|
|
|
|
INSERT_AFTER,
|
|
|
|
INSERT_LAST
|
2016-11-05 14:55:55 +00:00
|
|
|
} INSERTION_TYPE;
|
2003-01-17 13:18:15 +00:00
|
|
|
|
2002-11-13 18:25:18 +00:00
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
|
|
|
|
NTSTATUS
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheLoad(
|
|
|
|
PINICACHE *Cache,
|
2015-12-30 18:26:42 +00:00
|
|
|
PWCHAR FileName,
|
2014-05-12 14:17:37 +00:00
|
|
|
BOOLEAN String);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
VOID
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheDestroy(
|
|
|
|
PINICACHE Cache);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
PINICACHESECTION
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheGetSection(
|
|
|
|
PINICACHE Cache,
|
|
|
|
PWCHAR Name);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheGetKey(
|
|
|
|
PINICACHESECTION Section,
|
|
|
|
PWCHAR KeyName,
|
|
|
|
PWCHAR *KeyData);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
PINICACHEITERATOR
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheFindFirstValue(
|
|
|
|
PINICACHESECTION Section,
|
|
|
|
PWCHAR *KeyName,
|
|
|
|
PWCHAR *KeyData);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheFindNextValue(
|
|
|
|
PINICACHEITERATOR Iterator,
|
|
|
|
PWCHAR *KeyName,
|
|
|
|
PWCHAR *KeyData);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
VOID
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheFindClose(
|
|
|
|
PINICACHEITERATOR Iterator);
|
2002-11-13 18:25:18 +00:00
|
|
|
|
|
|
|
|
2003-01-17 13:18:15 +00:00
|
|
|
PINICACHEKEY
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheInsertKey(
|
|
|
|
PINICACHESECTION Section,
|
|
|
|
PINICACHEKEY AnchorKey,
|
2016-11-05 14:55:55 +00:00
|
|
|
INSERTION_TYPE InsertionType,
|
2014-05-12 14:17:37 +00:00
|
|
|
PWCHAR Name,
|
|
|
|
PWCHAR Data);
|
2003-01-17 13:18:15 +00:00
|
|
|
|
|
|
|
PINICACHE
|
|
|
|
IniCacheCreate(VOID);
|
|
|
|
|
|
|
|
NTSTATUS
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheSave(
|
|
|
|
PINICACHE Cache,
|
|
|
|
PWCHAR FileName);
|
2003-01-17 13:18:15 +00:00
|
|
|
|
|
|
|
PINICACHESECTION
|
2014-05-12 14:17:37 +00:00
|
|
|
IniCacheAppendSection(
|
|
|
|
PINICACHE Cache,
|
|
|
|
PWCHAR Name);
|
2003-01-17 13:18:15 +00:00
|
|
|
|
2002-11-13 18:25:18 +00:00
|
|
|
/* EOF */
|