|
Defines | |
| #define | _INCLUDE_DIRECTIVE "@INCLUDE " |
| #define | _VAR '$' |
| #define | _VAR_OPEN '{' |
| #define | _VAR_CLOSE '}' |
| #define | _VAR_CMD '!' |
| #define | _VAR_ENV '%' |
Functions | |
| Q_ENTRY * | qConfigParseFile (Q_ENTRY *config, const char *filepath, char sepchar) |
| Load & parse configuration file. | |
| Q_ENTRY * | qConfigParseStr (Q_ENTRY *config, const char *str, char sepchar) |
| Parse string. | |
Load & parse configuration file.
| config | a pointer of Q_ENTRY. NULL can be used for empty. | |
| filepath | configuration file path | |
| sepchar | separater used in configuration file to divice key and value |
# a line which starts with # character is comment @INCLUDE other.conf => (include other.conf) base = /tmp => base = /tmp log = ${base}/log => /tmp/log (using variable) host = ${!/bin/hostname -s} => arena (external command result) path = ${%PATH} => /usr/bin:/usr/sbin (environment)
Q_ENTRY *config = qConfigParseFile(NULL, "qdecoder.conf", '=');
Parse string.
| config | a pointer of Q_ENTRY. NULL can be used for empty. | |
| str | key, value pair strings | |
| sepchar | separater used in configuration file to divice key and value |
Q_ENTRY *config = qConfigParseStr(NULL, "key = value\nhello = world", '=');
| [Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |