ZEDA
1.6.18
|
Macros | |
#define | ZEDA_ZTK_SUFFIX "ztk" |
default suffix of .ztk (Z-Tag-and-Key) file format. More... | |
#define | zOpenZTKFile(filename, mode) zOpenFile( filename, ZEDA_ZTK_SUFFIX, mode ) |
open a .ztk file. More... | |
Functions | |
char * | zGetBasename (char *path, char *name, size_t size) |
strip a directory from a filename. More... | |
char * | zGetBasenameDRC (char *name) |
int | zGetDirFilename (char *path, char *dirname, char *filename, size_t size) |
get a directory name and a file name from a path. More... | |
char * | zGetSuffix (char *name) |
get a suffix from a filename. More... | |
char * | zAddSuffix (char *org, char *suffix, char *dest, size_t size) |
add a suffix to a filename. More... | |
char * | zReplaceSuffix (char *org, char *suffix, char *dest, size_t size) |
replace the suffix of a filename to a specified one. More... | |
char * | zCutSuffix (char *name) |
cut a suffix from a filename More... | |
FILE * | zOpenFile (char filename[], char *suffix, char *mode) |
open a file with default suffix. More... | |
#define ZEDA_ZTK_SUFFIX "ztk" |
default suffix of .ztk (Z-Tag-and-Key) file format.
#define zOpenZTKFile | ( | filename, | |
mode | |||
) | zOpenFile( filename, ZEDA_ZTK_SUFFIX, mode ) |
open a .ztk file.
char* zGetBasename | ( | char * | path, |
char * | name, | ||
size_t | size | ||
) |
strip a directory from a filename.
zGetBasename() acquires a filename from a path string path with any leading directory names removed, and puts it where name points. ex. if path is "/home/user/dummy.suf", name will be "dummy.suf".
zGetBasenameDRC() overrides a given string name by the stripped string.
char* zGetBasenameDRC | ( | char * | name | ) |
int zGetDirFilename | ( | char * | path, |
char * | dirname, | ||
char * | filename, | ||
size_t | size | ||
) |
get a directory name and a file name from a path.
zGetDirFilename() acquires a directory name and a file name from a path path, and puts them into dirname and filename, respectively. More than or equal to size bytes have to be allocated for all path, dirname and filename.
char* zGetSuffix | ( | char * | name | ) |
get a suffix from a filename.
zGetSuffix() finds a suffix from a filename name. The string pointed by name is not modified.
char* zAddSuffix | ( | char * | org, |
char * | suffix, | ||
char * | dest, | ||
size_t | size | ||
) |
add a suffix to a filename.
zAddSuffix() concatenates '.' + a string suffix to the original filename org, if necessary. The resultant pathname is put where dest points. If org already has the same suffix with suffix, org is simply copied to dest. size is the size of the destination buffer.
char* zReplaceSuffix | ( | char * | org, |
char * | suffix, | ||
char * | dest, | ||
size_t | size | ||
) |
replace the suffix of a filename to a specified one.
zReplaceSuffix() replaces the suffix of a string org, which is supposed to be a name of file with '.' + a string suffix. The resulted pathname is put where dest points. If org does not have a suffix, it simply concatenates suffix to org. size is the size of the destination buffer.
char* zCutSuffix | ( | char * | name | ) |
cut a suffix from a filename
zCutSuffix() directly cuts a suffix from a filename name. If name doesn't have a suffix, nothing happens.
FILE* zOpenFile | ( | char | filename[], |
char * | suffix, | ||
char * | mode | ||
) |
open a file with default suffix.
zOpenFile() opens a file named filename. mode is an access mode to the file. The definition is the same with that for fopen() in ANSI-C. If it fails to open filename and suffix is not the null pointer, it tries to open file named 'filename '.'suffix '.