Functions | |
Q_ENTRY * | qEntryInit (void) |
Initialize linked-list structure. | |
const Q_NLOBJ * | qEntryFirst (Q_ENTRY *entry) |
Get first object structure. | |
const Q_NLOBJ * | qEntryNext (Q_ENTRY *entry) |
Get next object structure. | |
int | qEntryRemove (Q_ENTRY *entry, const char *name) |
Remove matched objects as given name. | |
bool | qEntryPut (Q_ENTRY *entry, const char *name, const void *object, int size, bool update) |
Store object into linked-list structure. | |
bool | qEntryPutStr (Q_ENTRY *entry, const char *name, const char *str, bool update) |
Add string object into linked-list structure. | |
bool | qEntryPutStrf (Q_ENTRY *entry, const char *name, bool update, char *format,…) |
Add formatted string object into linked-list structure. | |
bool | qEntryPutInt (Q_ENTRY *entry, const char *name, int num, bool update) |
Add integer object into linked-list structure. | |
const void * | qEntryGet (Q_ENTRY *entry, const char *name, int *size) |
Find object with given name. | |
const void * | qEntryGetCase (Q_ENTRY *entry, const char *name, int *size) |
Find object with given name. | |
const void * | qEntryGetNext (Q_ENTRY *entry, const char *name, int *size) |
Find next object with given name. | |
const void * | qEntryGetNextCase (Q_ENTRY *entry, const char *name, int *size) |
Find next object with given name. | |
const void * | qEntryGetLast (Q_ENTRY *entry, const char *name, int *size) |
Find lastest matched object with given name. | |
const char * | qEntryGetStr (Q_ENTRY *entry, const char *name) |
Find string object with given name. | |
const char * | qEntryGetStrCase (Q_ENTRY *entry, const char *name) |
Find string object with given name. | |
const char * | qEntryGetStrf (Q_ENTRY *entry, char *format,…) |
Find string object with formatted name. | |
const char * | qEntryGetStrNext (Q_ENTRY *entry, const char *name) |
Find next string object with given name. | |
const char * | qEntryGetStrNextCase (Q_ENTRY *entry, const char *name) |
Find next string object with given name. | |
const char * | qEntryGetStrLast (Q_ENTRY *entry, const char *name) |
Find lastest matched string object with given name. | |
int | qEntryGetInt (Q_ENTRY *entry, const char *name) |
Find integer object with given name. | |
int | qEntryGetIntCase (Q_ENTRY *entry, const char *name) |
Find integer object with given name. | |
int | qEntryGetIntf (Q_ENTRY *entry, char *format,…) |
Find integer object with formatted name. | |
int | qEntryGetIntNext (Q_ENTRY *entry, const char *name) |
Find next integer object with given name. | |
int | qEntryGetIntNextCase (Q_ENTRY *entry, const char *name) |
Find next integer object with given name. | |
int | qEntryGetIntLast (Q_ENTRY *entry, const char *name) |
Find lastest matched integer object with given name. | |
int | qEntryGetNum (Q_ENTRY *entry) |
Get total number of stored objects. | |
int | qEntryGetNo (Q_ENTRY *entry, const char *name) |
Get the stored sequence number of the object. | |
bool | qEntryReverse (Q_ENTRY *entry) |
Reverse-sort internal stored object. | |
bool | qEntryPrint (Q_ENTRY *entry, FILE *out, bool print_object) |
Print out stored objects for debugging purpose. | |
bool | qEntryFree (Q_ENTRY *entry) |
Free Q_ENTRY. | |
bool | qEntrySave (Q_ENTRY *entry, const char *filepath, char sepchar, bool encode) |
Save Q_ENTRY as plain text format. | |
int | qEntryLoad (Q_ENTRY *entry, const char *filepath, char sepchar, bool decode) |
Load and append entries from given filepath. |
[Code sample - String] // sample data struct MY_OBJ *my_obj = getNewMyOjb(); // sample object char *my_str = "hello"; // sample string int my_int = 1; // sample integer // store into linked-list Q_ENTRY *entries = qEntryInit(); entries = qEntryPut(entries, "obj", (void*)my_obj, sizeof(struct MY_OBJ), true); entries = qEntryPutStr(entries, "obj", my_str, true); entries = qEntryPutInt(entries, "obj", my_int, true); // print out qEntryPrint(entries, stdout, false); // free object qEntryFree(entries); [Result]
Q_ENTRY* qEntryInit | ( | void | ) |
Initialize linked-list structure.
Q_ENTRY *entries = qEntryInit();
int qEntryRemove | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Remove matched objects as given name.
entry | Q_ENTRY pointer | |
name | key name |
bool qEntryPut | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
const void * | object, | |||
int | size, | |||
bool | update | |||
) |
Store object into linked-list structure.
entry | Q_ENTRY pointer | |
name | key name. | |
object | object pointer | |
size | size of the object | |
update | in case of false, just insert. in case of true, remove all same key then insert object if found. |
bool qEntryPutStr | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
const char * | str, | |||
bool | update | |||
) |
Add string object into linked-list structure.
entry | Q_ENTRY pointer | |
name | key name. | |
str | string value | |
update | in case of false, just insert. in case of true, remove all same key then insert object if found. |
bool qEntryPutStrf | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
bool | update, | |||
char * | format, | |||
… | ||||
) |
Add formatted string object into linked-list structure.
entry | Q_ENTRY pointer | |
name | key name. | |
update | in case of false, just insert. in case of true, remove all same key then insert object if found. | |
format | formatted string value |
bool qEntryPutInt | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int | num, | |||
bool | update | |||
) |
Add integer object into linked-list structure.
entry | Q_ENTRY pointer | |
name | key name. | |
num | number value | |
update | in case of false, just insert. in case of true, remove all same key then insert object if found. |
const void* qEntryGet | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int * | size | |||
) |
Find object with given name.
entry | Q_ENTRY pointer | |
name | key name | |
size | if size is not NULL, object size will be stored. |
const void* qEntryGetCase | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int * | size | |||
) |
Find object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name | |
size | if size is not NULL, object size will be stored. |
const void* qEntryGetNext | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int * | size | |||
) |
Find next object with given name.
entry | Q_ENTRY pointer | |
name | key name | |
size | if size is not NULL, object size will be stored. |
const void* qEntryGetNextCase | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int * | size | |||
) |
Find next object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name | |
size | if size is not NULL, object size will be stored. |
const void* qEntryGetLast | ( | Q_ENTRY * | entry, | |
const char * | name, | |||
int * | size | |||
) |
Find lastest matched object with given name.
entry | Q_ENTRY pointer | |
name | key name | |
size | if size is not NULL, object size will be stored. |
const char* qEntryGetStr | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find string object with given name.
entry | Q_ENTRY pointer | |
name | key name |
const char* qEntryGetStrCase | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find string object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name |
const char* qEntryGetStrf | ( | Q_ENTRY * | entry, | |
char * | format, | |||
… | ||||
) |
Find string object with formatted name.
entry | Q_ENTRY pointer | |
format | name format |
const char* qEntryGetStrNext | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find next string object with given name.
entry | Q_ENTRY pointer | |
name | key name |
const char* qEntryGetStrNextCase | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find next string object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name |
const char* qEntryGetStrLast | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find lastest matched string object with given name.
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetInt | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find integer object with given name.
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetIntCase | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find integer object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetIntf | ( | Q_ENTRY * | entry, | |
char * | format, | |||
… | ||||
) |
Find integer object with formatted name.
entry | Q_ENTRY pointer | |
format | name format |
int qEntryGetIntNext | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find next integer object with given name.
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetIntNextCase | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find next integer object with given name.
(case-insensitive)
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetIntLast | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Find lastest matched integer object with given name.
entry | Q_ENTRY pointer | |
name | key name |
int qEntryGetNum | ( | Q_ENTRY * | entry | ) |
Get total number of stored objects.
entry | Q_ENTRY pointer |
int qEntryGetNo | ( | Q_ENTRY * | entry, | |
const char * | name | |||
) |
Get the stored sequence number of the object.
entry | Q_ENTRY pointer | |
name | key name |
bool qEntryReverse | ( | Q_ENTRY * | entry | ) |
Reverse-sort internal stored object.
entry | Q_ENTRY pointer |
bool qEntryPrint | ( | Q_ENTRY * | entry, | |
FILE * | out, | |||
bool | print_object | |||
) |
Print out stored objects for debugging purpose.
entry | Q_ENTRY pointer | |
out | output stream FILE descriptor such like stdout, stderr. | |
print_object | true for printing out object value, false for disable printing out object value. |
bool qEntryFree | ( | Q_ENTRY * | entry | ) |
bool qEntrySave | ( | Q_ENTRY * | entry, | |
const char * | filepath, | |||
char | sepchar, | |||
bool | encode | |||
) |
Save Q_ENTRY as plain text format.
entry | Q_ENTRY pointer | |
filepath | save file path | |
sepchar | separator character between name and value. normally ‘=’ is used. | |
encode | flag for encoding value object. false can be used if the value object is string or integer and has no new line. otherwise true must be set. |
int qEntryLoad | ( | Q_ENTRY * | entry, | |
const char * | filepath, | |||
char | sepchar, | |||
bool | decode | |||
) |
Load and append entries from given filepath.
entry | Q_ENTRY pointer | |
filepath | save file path | |
sepchar | separator character between name and value. normally ‘=’ is used | |
decode | flag for decoding value object |
[Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |