Gammu API  1.38.0
INI files

Data Structures

struct  _INI_Entry
 
struct  _INI_Section
 

Typedefs

typedef struct _INI_Entry INI_Entry
 
typedef struct _INI_Section INI_Section
 

Functions

void INI_Free (INI_Section *head)
 
GSM_Error INI_ReadFile (const char *FileName, gboolean Unicode, INI_Section **result)
 
INI_EntryINI_FindLastSectionEntry (INI_Section *file_info, const unsigned char *section, const gboolean Unicode)
 
unsigned char * INI_GetValue (INI_Section *file_info, const unsigned char *section, const unsigned char *key, const gboolean Unicode)
 
gboolean GSM_StringToBool (const char *value)
 

Detailed Description

These functions parse ini file and make them available in easily accessable manner.

File format is standard ini file, comments are both # and ;.

Typedef Documentation

§ INI_Entry

typedef struct _INI_Entry INI_Entry

Private structure holding information INI entry.

Definition at line 28 of file gammu-inifile.h.

§ INI_Section

typedef struct _INI_Section INI_Section

Private structure holding information INI section.

Definition at line 34 of file gammu-inifile.h.

Function Documentation

§ GSM_StringToBool()

gboolean GSM_StringToBool ( const char *  value)

Converts value to boolean.

It just takes the string and checks whether there is true/yes/t/y/1 or false/no/f/n/0.

Parameters
valueString to parse.
Returns
Boolean value, -1 on failure.

§ INI_FindLastSectionEntry()

INI_Entry* INI_FindLastSectionEntry ( INI_Section file_info,
const unsigned char *  section,
const gboolean  Unicode 
)

Returns pointer to last INI entry of given section.

Parameters
file_infoFile data as returned by INI_ReadFile.
sectionSection to scan.
UnicodeWhether file is unicode.
Returns
Last entry in section.
Bug:
Unicode should be part of file_info.

§ INI_Free()

void INI_Free ( INI_Section head)

Free INI data.

Parameters
headINI section data.

§ INI_GetValue()

unsigned char* INI_GetValue ( INI_Section file_info,
const unsigned char *  section,
const unsigned char *  key,
const gboolean  Unicode 
)

Returns value of INI file entry.

Parameters
file_infoFile data as returned by INI_ReadFile.
sectionSection to scan.
keyName of key to read.
UnicodeWhether file is unicode.
Returns
Entry value.
Bug:
Unicode should be part of file_info.

§ INI_ReadFile()

GSM_Error INI_ReadFile ( const char *  FileName,
gboolean  Unicode,
INI_Section **  result 
)

Reads INI data.

Parameters
FileNameFile to read.
UnicodeWhether file shoul be treated like unicode.
resultPointer where file will be read.
Returns
Error code