ZEDA
1.6.18
|
ZTK (Z's tag-and-key) file format. More...
#include <zeda/zeda_strlist.h>
Go to the source code of this file.
Data Structures | |
struct | _zFileStack |
struct | ZTKKeyField |
key field of ZTK format. More... | |
struct | __ZTKKeyFieldListCell |
struct | __ZTKKeyFieldList |
struct | ZTKTagField |
tagged field of ZTK format. More... | |
struct | __ZTKTagFieldListCell |
struct | __ZTKTagFieldList |
struct | ZTK |
ZTK format processor. More... | |
struct | ZTKPrp |
properties of a class described by a set of tag/key string and call-back functions. More... | |
Macros | |
#define | ZTKValPtr(ztk) (ztk)->val_cp |
return a pointer to the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKVal(ztk) ( (ztk)->val_cp ? (ztk)->val_cp->data : "" ) |
return the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKValCmp(ztk, str) ( strcmp( ZTKVal(ztk), str ) == 0 ) |
check if a string is the same with the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKKey(ztk) ( (ztk)->kf_cp ? (ztk)->kf_cp->data.key : "" ) |
return the current key of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKKeyCmp(ztk, str) ( strcmp( ZTKKey(ztk), str ) == 0 ) |
check if a string is the same with the current key of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKTag(ztk) ( (ztk)->tf_cp ? (ztk)->tf_cp->data.tag : "" ) |
return the current tag in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKTagCmp(ztk, str) ( strcmp( ZTKTag(ztk), str ) == 0 ) |
check if a string is the same with the current tag in a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKRewind(ztk) ZTKTagRewind( ztk ) |
rewind a tag-and-key list of a ZTK format processor. More... | |
#define | ZTKPrint(ztk) ZTKFPrint( stdout, ztk ) |
#define | ZTKEvalKey(obj, arg, ztk, prp) _ZTKEvalKey( obj, arg, ztk, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define | ZTKPrpKeyFPrint(fp, obj, prp) _ZTKPrpKeyFPrint( fp, obj, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define | ZTKEvalTag(obj, arg, ztk, prp) _ZTKEvalTag( obj, arg, ztk, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define | ZTKPrpTagFPrint(fp, obj, prp) _ZTKPrpTagFPrint( fp, obj, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
Typedefs | |
typedef struct _zFileStack | zFileStack |
typedef struct __ZTKKeyFieldListCell | ZTKKeyFieldListCell |
typedef struct __ZTKKeyFieldList | ZTKKeyFieldList |
typedef struct __ZTKTagFieldListCell | ZTKTagFieldListCell |
typedef struct __ZTKTagFieldList | ZTKTagFieldList |
Functions | |
void | zFileStackInit (zFileStack *stack) |
zFileStack * | zFileStackPush (zFileStack *head, char *pathname) |
zFileStack * | zFileStackPop (zFileStack *head) |
void | zFileStackDestroy (zFileStack *head) |
void | ZTKKeyFieldFPrint (FILE *fp, ZTKKeyField *kf) |
ZTKKeyFieldListCell * | ZTKKeyFieldListNew (ZTKKeyFieldList *list, char *key) |
void | ZTKKeyFieldListDestroy (ZTKKeyFieldList *list) |
void | ZTKTagFieldFPrint (FILE *fp, ZTKTagField *tf) |
ZTKTagFieldListCell * | ZTKTagFieldListNew (char buf[]) |
void | ZTKTagFieldListDestroy (ZTKTagFieldList *list) |
void | ZTKTagFieldListFPrint (FILE *fp, ZTKTagFieldList *list) |
ZTK * | ZTKInit (ZTK *ztk) |
initialize a ZTK format processor. More... | |
void | ZTKDestroy (ZTK *ztk) |
destroy a ZTK format processor. More... | |
bool | ZTKParseFP (ZTK *ztk, FILE *fp) |
scan and parse a file stream into a tag-and-key list of a ZTK format processor. More... | |
bool | ZTKParse (ZTK *ztk, char *path) |
scan a file and parse it into a tag-and-key list of a ZTK format processor. More... | |
int | ZTKCountTag (ZTK *ztk, const char *tag) |
count the number of tagged fields with a specified tag in a tag-and-key list of a ZTK format processor. More... | |
int | ZTKCountKey (ZTK *ztk, const char *key) |
count the number of key fields with a specified key of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
zStrListCell * | ZTKValNext (ZTK *ztk) |
move to the next value string in the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
zStrListCell * | ZTKValRewind (ZTK *ztk) |
rewind the list of value strings of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
ZTKKeyFieldListCell * | ZTKKeyNext (ZTK *ztk) |
move to the next key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
ZTKKeyFieldListCell * | ZTKKeyRewind (ZTK *ztk) |
rewind the list of key fields of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
ZTKTagFieldListCell * | ZTKTagNext (ZTK *ztk) |
move to the next tagged field in a tag-and-key list of a ZTK format processor. More... | |
ZTKTagFieldListCell * | ZTKTagRewind (ZTK *ztk) |
rewind the list of tagged field in a tag-and-key list of a ZTK format processor. More... | |
int | ZTKInt (ZTK *ztk) |
retrieve an integer value from the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
double | ZTKDouble (ZTK *ztk) |
retrieve a real value from the current key field of the current tagged field in a tag-and-key list of a ZTK format processor. More... | |
void | ZTKFPrint (FILE *fp, ZTK *ztk) |
print out ZTK to a file. More... | |
void * | _ZTKEvalKey (void *obj, void *arg, ZTK *ztk, ZTKPrp prp[], int num) |
void | _ZTKPrpKeyFPrint (FILE *fp, void *obj, ZTKPrp prp[], int num) |
void * | _ZTKEvalTag (void *obj, void *arg, ZTK *ztk, ZTKPrp prp[], int num) |
void | _ZTKPrpTagFPrint (FILE *fp, void *obj, ZTKPrp prp[], int num) |
ZTK (Z's tag-and-key) file format.
#define ZTKValPtr | ( | ztk | ) | (ztk)->val_cp |
return a pointer to the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
#define ZTKVal | ( | ztk | ) | ( (ztk)->val_cp ? (ztk)->val_cp->data : "" ) |
return the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
#define ZTKValCmp | ( | ztk, | |
str | |||
) | ( strcmp( ZTKVal(ztk), str ) == 0 ) |
check if a string is the same with the current value string of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
#define ZTKKey | ( | ztk | ) | ( (ztk)->kf_cp ? (ztk)->kf_cp->data.key : "" ) |
return the current key of the current tagged field in a tag-and-key list of a ZTK format processor.
#define ZTKKeyCmp | ( | ztk, | |
str | |||
) | ( strcmp( ZTKKey(ztk), str ) == 0 ) |
check if a string is the same with the current key of the current tagged field in a tag-and-key list of a ZTK format processor.
#define ZTKTag | ( | ztk | ) | ( (ztk)->tf_cp ? (ztk)->tf_cp->data.tag : "" ) |
return the current tag in a tag-and-key list of a ZTK format processor.
#define ZTKTagCmp | ( | ztk, | |
str | |||
) | ( strcmp( ZTKTag(ztk), str ) == 0 ) |
check if a string is the same with the current tag in a tag-and-key list of a ZTK format processor.
#define ZTKRewind | ( | ztk | ) | ZTKTagRewind( ztk ) |
rewind a tag-and-key list of a ZTK format processor.
#define ZTKPrint | ( | ztk | ) | ZTKFPrint( stdout, ztk ) |
#define ZTKEvalKey | ( | obj, | |
arg, | |||
ztk, | |||
prp | |||
) | _ZTKEvalKey( obj, arg, ztk, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define ZTKPrpKeyFPrint | ( | fp, | |
obj, | |||
prp | |||
) | _ZTKPrpKeyFPrint( fp, obj, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define ZTKEvalTag | ( | obj, | |
arg, | |||
ztk, | |||
prp | |||
) | _ZTKEvalTag( obj, arg, ztk, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
#define ZTKPrpTagFPrint | ( | fp, | |
obj, | |||
prp | |||
) | _ZTKPrpTagFPrint( fp, obj, prp, sizeof(prp)/sizeof(ZTKPrp) ) |
typedef struct _zFileStack zFileStack |
typedef struct __ZTKKeyFieldListCell ZTKKeyFieldListCell |
typedef struct __ZTKKeyFieldList ZTKKeyFieldList |
typedef struct __ZTKTagFieldListCell ZTKTagFieldListCell |
typedef struct __ZTKTagFieldList ZTKTagFieldList |
void zFileStackInit | ( | zFileStack * | stack | ) |
zFileStack* zFileStackPush | ( | zFileStack * | head, |
char * | pathname | ||
) |
zFileStack* zFileStackPop | ( | zFileStack * | head | ) |
void zFileStackDestroy | ( | zFileStack * | head | ) |
void ZTKKeyFieldFPrint | ( | FILE * | fp, |
ZTKKeyField * | kf | ||
) |
ZTKKeyFieldListCell* ZTKKeyFieldListNew | ( | ZTKKeyFieldList * | list, |
char * | key | ||
) |
void ZTKKeyFieldListDestroy | ( | ZTKKeyFieldList * | list | ) |
void ZTKTagFieldFPrint | ( | FILE * | fp, |
ZTKTagField * | tf | ||
) |
ZTKTagFieldListCell* ZTKTagFieldListNew | ( | char | buf[] | ) |
void ZTKTagFieldListDestroy | ( | ZTKTagFieldList * | list | ) |
void ZTKTagFieldListFPrint | ( | FILE * | fp, |
ZTKTagFieldList * | list | ||
) |
scan and parse a file stream into a tag-and-key list of a ZTK format processor.
scan a file and parse it into a tag-and-key list of a ZTK format processor.
int ZTKCountTag | ( | ZTK * | ztk, |
const char * | tag | ||
) |
count the number of tagged fields with a specified tag in a tag-and-key list of a ZTK format processor.
int ZTKCountKey | ( | ZTK * | ztk, |
const char * | key | ||
) |
count the number of key fields with a specified key of the current tagged field in a tag-and-key list of a ZTK format processor.
zStrListCell* ZTKValNext | ( | ZTK * | ztk | ) |
move to the next value string in the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
zStrListCell* ZTKValRewind | ( | ZTK * | ztk | ) |
rewind the list of value strings of the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
ZTKKeyFieldListCell* ZTKKeyNext | ( | ZTK * | ztk | ) |
move to the next key field of the current tagged field in a tag-and-key list of a ZTK format processor.
ZTKKeyFieldListCell* ZTKKeyRewind | ( | ZTK * | ztk | ) |
rewind the list of key fields of the current tagged field in a tag-and-key list of a ZTK format processor.
ZTKTagFieldListCell* ZTKTagNext | ( | ZTK * | ztk | ) |
move to the next tagged field in a tag-and-key list of a ZTK format processor.
ZTKTagFieldListCell* ZTKTagRewind | ( | ZTK * | ztk | ) |
rewind the list of tagged field in a tag-and-key list of a ZTK format processor.
int ZTKInt | ( | ZTK * | ztk | ) |
retrieve an integer value from the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
double ZTKDouble | ( | ZTK * | ztk | ) |
retrieve a real value from the current key field of the current tagged field in a tag-and-key list of a ZTK format processor.
void _ZTKPrpKeyFPrint | ( | FILE * | fp, |
void * | obj, | ||
ZTKPrp | prp[], | ||
int | num | ||
) |
void _ZTKPrpTagFPrint | ( | FILE * | fp, |
void * | obj, | ||
ZTKPrp | prp[], | ||
int | num | ||
) |