coastline 0.0.4
Loading...
Searching...
No Matches
ini.h File Reference
#include <stddef.h>
Include dependency graph for ini.h:

Go to the source code of this file.

Classes

struct  LauncherStringList
 The indexed lines read from a launcher INI file. More...
struct  LauncherIniFile
 The current line and indexed contents of a launcher INI file. More...
struct  LauncherIniSectionIterator
 A cursor over sections in a launcher INI file. More...

Typedefs

typedef struct LauncherStringList LauncherStringList
 The indexed lines read from a launcher INI file.
typedef struct LauncherIniFile LauncherIniFile
 The current line and indexed contents of a launcher INI file.
typedef struct LauncherIniSectionIterator LauncherIniSectionIterator
 A cursor over sections in a launcher INI file.

Functions

LauncherIniSectionIterator * FindIniSection (LauncherIniFile *file, const char *sectionName)
 Allocate a section iterator and search for an exact section header.
void FreeIniSectionIterator (LauncherIniSectionIterator *iterator)
 Free a section iterator without freeing its INI file.
LauncherIniFile * ReadIniFile (const char *path)
 Read an INI file into indexed lines, treating semicolons as comments.
void FreeIniFile (LauncherIniFile *file)
 Free the parsed line storage and file record.
char * GetIniSectionValue (LauncherIniSectionIterator *iterator, const char *key)
 Search the selected section for key without regard to case.
LauncherIniSectionIterator * FindFirstIniSection (LauncherIniFile *file)
 Allocate an iterator positioned at the first section, or at -1 when none exists.
LauncherIniSectionIterator * FindNextIniSection (LauncherIniSectionIterator *iterator)
 Advance iterator to the next section, or set its index to -1 at the end.
int CountIniSections (LauncherIniFile *file)
 Count section headers in file.
char * GetIniSectionHeaderByIndex (int index, LauncherIniFile *file)
 Look up the section header at zero-based index.
char * GetIniSectionName (LauncherIniSectionIterator *iterator)
 Return the header at iterator, or NULL when its section index is invalid.
LauncherIniFile * SelectIniSection (LauncherIniSectionIterator *iterator)
 Set the file's current line to the iterator's section header.
char * GetNextIniSectionLine (LauncherIniFile *file)
 Advance within the selected section without crossing into the next section.

Typedef Documentation

◆ LauncherStringList

typedef struct LauncherStringList LauncherStringList

The indexed lines read from a launcher INI file.

◆ LauncherIniFile

typedef struct LauncherIniFile LauncherIniFile

The current line and indexed contents of a launcher INI file.

◆ LauncherIniSectionIterator

typedef struct LauncherIniSectionIterator LauncherIniSectionIterator

A cursor over sections in a launcher INI file.

Function Documentation

◆ FindIniSection()

LauncherIniSectionIterator * FindIniSection ( LauncherIniFile * file,
const char * sectionName )

Allocate a section iterator and search for an exact section header.

Returns
An iterator with sectionIndex set to -1 when no section matches.
Ghidra address:
BRally: 0x00401130
Ghidra address:
SetVideo: 0x004014d0

◆ FreeIniSectionIterator()

void FreeIniSectionIterator ( LauncherIniSectionIterator * iterator)

Free a section iterator without freeing its INI file.

Ghidra address:
BRally: 0x004011c0
Ghidra address:
SetVideo: 0x00401600

◆ ReadIniFile()

LauncherIniFile * ReadIniFile ( const char * path)

Read an INI file into indexed lines, treating semicolons as comments.

Returns
The parsed file with no section selected.
Ghidra address:
BRally: 0x00401250
Ghidra address:
SetVideo: 0x004016d0

◆ FreeIniFile()

void FreeIniFile ( LauncherIniFile * file)

Free the parsed line storage and file record.

Ghidra address:
BRally: 0x004012a0
Ghidra address:
SetVideo: 0x00401720

◆ GetIniSectionValue()

char * GetIniSectionValue ( LauncherIniSectionIterator * iterator,
const char * key )

Search the selected section for key without regard to case.

Returns
Its value in a shared line buffer, or NULL when the section or key is absent.
Ghidra address:
BRally: 0x00401ae0
Ghidra address:
SetVideo: 0x004023b0

◆ FindFirstIniSection()

LauncherIniSectionIterator * FindFirstIniSection ( LauncherIniFile * file)

Allocate an iterator positioned at the first section, or at -1 when none exists.

Ghidra address:
SetVideo: 0x00401560

◆ FindNextIniSection()

LauncherIniSectionIterator * FindNextIniSection ( LauncherIniSectionIterator * iterator)

Advance iterator to the next section, or set its index to -1 at the end.

Returns
The same iterator, or NULL for an invalid iterator or file.
Ghidra address:
SetVideo: 0x004015b0

◆ CountIniSections()

int CountIniSections ( LauncherIniFile * file)

Count section headers in file.

Ghidra address:
SetVideo: 0x00401610

◆ GetIniSectionHeaderByIndex()

char * GetIniSectionHeaderByIndex ( int index,
LauncherIniFile * file )

Look up the section header at zero-based index.

Returns
The header in file, or NULL when the index has no section.
Ghidra address:
SetVideo: 0x00402ce0

◆ GetIniSectionName()

char * GetIniSectionName ( LauncherIniSectionIterator * iterator)

Return the header at iterator, or NULL when its section index is invalid.

Ghidra address:
BRally: 0x004011d0
Ghidra address:
SetVideo: 0x00401650

◆ SelectIniSection()

LauncherIniFile * SelectIniSection ( LauncherIniSectionIterator * iterator)

Set the file's current line to the iterator's section header.

Returns
The selected file, or NULL when the iterator has no section.
Ghidra address:
BRally: 0x00401200
Ghidra address:
SetVideo: 0x00401680

◆ GetNextIniSectionLine()

char * GetNextIniSectionLine ( LauncherIniFile * file)

Advance within the selected section without crossing into the next section.

Returns
The next line, or NULL at the end of the section.
Ghidra address:
BRally: 0x00401220
Ghidra address:
SetVideo: 0x004016a0