9 #ifndef __ZEDA_STRING_H__ 10 #define __ZEDA_STRING_H__ 312 #define zIsWS(c) ( (c) == ' ' || (c) == '\t' ) 341 #define zIsQuotation(c) ( (c) == '\'' || (c) == '\"' ) 426 #define ZDEFAULT_COMMENT_IDENT '%' 584 #define ZDEFAULT_TAG_BEGIN_IDENT '[' 585 #define ZDEFAULT_TAG_END_IDENT ']' 647 __EXPORT bool zTagFScan(FILE *
fp,
bool (* tag_fscan)(FILE*,
void*,
char*,
bool*),
void *instance);
649 #define ZDEFAULT_KEY_IDENT ':' 693 __EXPORT bool zFieldFScan(FILE *fp,
bool (* field_fscan)(FILE*,
void*,
char*,
bool*),
void *instance);
706 #define zIndent(n) zFIndent( stdout,(n) ) 715 #define zEndl() printf( "\n" ) 717 #define zEndl() printk( "\n" ) 828 #define ZEDA_ZTK_SUFFIX "ztk" 831 #define zOpenZTKFile(filename,mode) zOpenFile( filename, ZEDA_ZTK_SUFFIX, mode )
char * zStrCopyNC(char *dest, const char *src)
copy a string without checking the buffer size.
char * zGetSuffix(char *name)
get a suffix from a filename.
char * zSDouble(char *str, double *val)
get a d-float value in a string.
char * zFIntToken(FILE *fp, char *tkn, size_t size)
tokenize an integer value in a file.
bool zIsOperator(char c)
check if a charactor is an operator.
char * zGetBasename(char *path, char *name, size_t size)
strip a directory from a filename.
void zResetTagIdent(void)
reset the tag identifiers.
char * zStrrChar(const char *s, size_t size, int c)
find a specified charactor from the last in a string.
char * zGetBasenameDRC(char *name)
void zSetTagIdent(char begin_ident, char end_ident)
specify the tag identifiers.
char * zStrAddChar(char *str, size_t size, char c)
concatenate a string and a charactor.
#define __END_DECLS
Definition: zeda_defs.h:30
bool zFPostCheckKey(FILE *fp)
check if the last token is a key.
size_t size
Definition: zeda_stream.h:39
void zSetDelimiter(char s[])
specify a delimiter set.
char * zFDouble(FILE *fp, double *val)
get a d-float value in a file.
bool zIsIncludedChar(char c, char *s)
check if a charactor is included in a specified set.
char * zStrBSChar(char *str, int cur)
backspace a charactor from a string.
void zResetKeyIdent(void)
reset the key identifier.
char * zSToken(char *str, char *tkn, size_t size)
FILE * zOpenFile(char filename[], char *suffix, char *mode)
open a file with default suffix.
int zFCountTag(FILE *fp, char *tag)
count a number of tag tokens in a file.
char * zSIntToken(char *str, char *tkn, size_t size)
tokenize an integer value in a string.
char * zSSkipDelimiter(char *str)
skip delimiter in a string.
char * zReplaceSuffix(char *org, char *suffix, char *dest, size_t size)
replace the suffix of a filename to a specified one.
char * zSInt(char *str, int *val)
get an integer value from a string.
void zResetOperator(void)
reset an operator set.
char * zStrCat(char *dest, const char *src, size_t size)
concatenate a string to another.
char * zSNumToken(char *str, char *tkn, size_t size)
tokenize a real number in a string.
char * zFInt(FILE *fp, int *val)
get an integer value from file.
void zSetOperator(char s[])
specify an operator set.
char * zSSkipWS(char *str)
skip whitespaces in a string.
char * zStrCharNul(const char *s, size_t size, int c)
find a specified charactor in a string.
char zFSkipIncludedChar(FILE *fp, char *s)
skip a certain charactors in a stream.
char * zStrCatPrint(char *str, size_t size, char *fmt,...)
concatenate a string with a formatted string.
char * zNullStr(void)
return the null string.
char * zStrSearchBM(char *text, char *pat)
string search by Boyer-Moore algorithm
void zFIndent(FILE *fp, int n)
insert whitespaces before a string.
char * zSSkipIncludedChar(char *str, char *s)
skip a certain charactors in a string.
void zSetCommentIdent(char ident)
specify the comment identifier.
char * zStrOvrChar(char *str, size_t size, int cur, char c)
override a charactor to a string.
FILE * fp
Definition: zeda_stream.h:36
bool zFieldFScan(FILE *fp, bool(*field_fscan)(FILE *, void *, char *, bool *), void *instance)
scan a field in a file.
char * zSTokenSkim(char *str, char *tkn, size_t size)
tokenize a string.
char * zStrCopy(char *dest, const char *src, size_t size)
copy a string.
bool zTokenIsTag(char *tkn)
check if a token is a tag.
void zSetKeyIdent(char ident)
specify the key identifier.
int zGetDirFilename(char *path, char *dirname, char *filename, size_t size)
get a directory name and a file name from a path.
char * zExtractTag(char *tag, char *notag)
extract a tag.
#define __BEGIN_DECLS
Definition: zeda_defs.h:26
char * zStrSearchKMP(char *text, char *pat)
search string by Knuth-Morris-Pratt algorithm
bool zTagFScan(FILE *fp, bool(*tag_fscan)(FILE *, void *, char *, bool *), void *instance)
scan tagged fields in a file.
char zFSkipDelimiter(FILE *fp)
skip delimiter in a file.
char * zToUpper(char *src, char *dest)
convert a string to the uppercase set.
char * zCutSuffix(char *name)
cut a suffix from a filename
char * zStrChar(const char *s, size_t size, int c)
find a specified charactor in a string.
char * zStrClone(char *str)
clone a string.
int zFCountKey(FILE *fp, char *key)
count keywords in a file.
bool zIsDelimiter(char c)
check if a charactor is a delimiter.
void zResetCommentIdent(void)
reset the comment identifier.
#define zIndent(n)
Definition: zeda_string.h:706
#define __EXPORT
Definition: zeda_compat.h:32
char * zStrInsChar(char *str, size_t size, int cur, char c)
insert a charactor to a string.
char zFSkipComment(FILE *fp)
skip comments.
char * zStrDelChar(char *str, int cur)
delete a charactor from a string.
char * zAddSuffix(char *org, char *suffix, char *dest, size_t size)
add a suffix to a filename.
char * zFToken(FILE *fp, char *tkn, size_t size)
tokenize a file.
void zResetDelimiter(void)
reset a delimiter set.
char zFSkipWS(FILE *fp)
skip whitespaces in a file.
bool zStrIsHex(char *str)
check if a string represents a hexadecimal number.
char * zFNumToken(FILE *fp, char *tkn, size_t size)
tokenize a real number in a file.
char * zToLower(char *src, char *dest)
convert a string to the lowercase set.
byte * cur
Definition: zeda_stream.h:38
char * zCutNL(char *str)
cut a newline charactor.