Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Functions
INIFILE

INI File System. More...

Data Structures

struct  T_iniCategory
 
struct  T_iniFileStruct
 
struct  T_iniKey
 

Macros

#define IIsDirty(p_ini)   ((p_ini)->isDirty)
 
#define IMarkClean(p_ini)   ((p_ini)->isDirty = FALSE)
 
#define IMarkDirty(p_ini)   ((p_ini)->isDirty = TRUE)
 
#define INIFILE_DEAD_TAG   (*((T_word32 *)"DinI"))
 
#define INIFILE_TAG   (*((T_word32 *)"iNiF"))
 

Functions

T_void INIFileClose (T_byte8 *p_filename, T_iniFile iniFile)
 
T_byte8INIFileGet (T_iniFile iniFile, T_byte8 *p_catName, T_byte8 *p_keyName)
 
T_void INIFileGetString (T_iniFile iniFile, T_byte8 *p_catName, T_byte8 *p_keyName, T_byte8 *p_string, T_word16 maxLength)
 
T_iniFile INIFileOpen (T_byte8 *p_filename)
 
T_void INIFilePut (T_iniFile iniFile, T_byte8 *p_catName, T_byte8 *p_keyName, T_byte8 *p_value)
 

Detailed Description

INI File System.

A system for opening, reading, editing, and saving .INI files.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Macro Definition Documentation

#define IIsDirty (   p_ini)    ((p_ini)->isDirty)
#define IMarkClean (   p_ini)    ((p_ini)->isDirty = FALSE)
#define IMarkDirty (   p_ini)    ((p_ini)->isDirty = TRUE)
#define INIFILE_DEAD_TAG   (*((T_word32 *)"DinI"))
#define INIFILE_TAG   (*((T_word32 *)"iNiF"))

Function Documentation

T_void INIFileClose ( T_byte8 p_filename,
T_iniFile  iniFile 
)

INIFileClose closes out the ini file and if there are changes, saves the file to the given p_filename.

Parameters
p_filename– File name to save to (if changes)
iniFile– IniFile to search
T_byte8* INIFileGet ( T_iniFile  iniFile,
T_byte8 p_catName,
T_byte8 p_keyName 
)

INIFileGet searches for a key based on its category.

Parameters
iniFile– IniFile to search
p_catName– Search category
p_keyName– Search key
Returns
Value found, else NULL
T_void INIFileGetString ( T_iniFile  iniFile,
T_byte8 p_catName,
T_byte8 p_keyName,
T_byte8 p_string,
T_word16  maxLength 
)

INIFileGetString gets a string for a given key and category. If the entry cannot be found, a null string is returned.

Parameters
iniFile– IniFile to search
p_catName– Search category
p_keyName– Search key
p_string– Where to put string
maxLength– Maximum number characters in string
T_iniFile INIFileOpen ( T_byte8 p_filename)

INIFileOpen opens up an ini file for future accesses.

Parameters
p_filename– File name to save to (if changes)
Returns
Handle to ini file
T_void INIFilePut ( T_iniFile  iniFile,
T_byte8 p_catName,
T_byte8 p_keyName,
T_byte8 p_value 
)

INIFilePut adds or changes a category, key, and value combo. It basically does it all to add or change an entry.

Parameters
iniFile– IniFile to put entry
p_catName– Name of category
p_keyName– Name of key
p_value– Value to use