Gammu internals
1.38.0
|
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_Entry * | INI_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) |
These functions parse ini file and make them available in easily accessable manner.
File format is standard ini file, comments are both # and ;.
typedef struct _INI_Entry INI_Entry |
Private structure holding information INI entry.
Definition at line 28 of file gammu-inifile.h.
typedef struct _INI_Section INI_Section |
Private structure holding information INI section.
Definition at line 34 of file gammu-inifile.h.
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.
value | String to parse. |
Definition at line 470 of file cfg.c.
Referenced by INI_GetBool().
INI_Entry* INI_FindLastSectionEntry | ( | INI_Section * | file_info, |
const unsigned char * | section, | ||
const gboolean | Unicode | ||
) |
Returns pointer to last INI entry of given section.
file_info | File data as returned by INI_ReadFile. |
section | Section to scan. |
Unicode | Whether file is unicode. |
Definition at line 409 of file cfg.c.
References mywstrncasecmp(), _INI_Entry::Next, _INI_Section::Next, _INI_Section::SectionName, and _INI_Section::SubEntries.
void INI_Free | ( | INI_Section * | head | ) |
Free INI data.
head | INI section data. |
Definition at line 454 of file cfg.c.
References INI_Free_Entries(), _INI_Section::Next, _INI_Section::SectionName, and _INI_Section::SubEntries.
unsigned char* INI_GetValue | ( | INI_Section * | cfg, |
const unsigned char * | section, | ||
const unsigned char * | key, | ||
const gboolean | Unicode | ||
) |
Returns value of INI file entry.
file_info | File data as returned by INI_ReadFile. |
section | Section to scan. |
key | Name of key to read. |
Unicode | Whether file is unicode. |
Search for key value in file in Windows INI format style Returns found value or NULL
Definition at line 365 of file cfg.c.
References _INI_Entry::EntryName, _INI_Entry::EntryValue, mywstrncasecmp(), _INI_Entry::Next, _INI_Section::Next, _INI_Section::SectionName, and _INI_Section::SubEntries.
Referenced by GSM_ReadConfig(), INI_GetBool(), and INI_GetInt().
GSM_Error INI_ReadFile | ( | const char * | FileName, |
gboolean | Unicode, | ||
INI_Section ** | result | ||
) |
Reads INI data.
FileName | File to read. |
Unicode | Whether file shoul be treated like unicode. |
result | Pointer where file will be read. |
Read information from file in Windows INI format style
Definition at line 24 of file cfg.c.
References _INI_Entry::EntryName, _INI_Entry::EntryValue, ERR_CANTOPENFILE, ERR_FILENOTSUPPORTED, ERR_MOREMEMORY, ERR_NONE, FALSE, myiswspace(), _INI_Entry::Next, _INI_Section::Next, _INI_Entry::Prev, _INI_Section::SubEntries, and TRUE.
Referenced by GSM_TryReadGammuRC().