Parameters: char const * filename
Returns: char*
Parameters: char * (* pos)
Returns: int
Return the unicode value at the given pointer position, and advance the pointer to the start of the next code point.
Adjust the pointer back to the previous code point and return its value.
Parameters: char const * (* pos)
Parameters: int c, char * s
Parameters: char * s, int pos, int c
(abc, 3, d) -> abcd
Parameters: char * s, int pos
(abc, 1) -> ac
Parameters: char const * s
Parameters: char * target, int size, char const * source
Parameters: char const * pattern, char const * name
Returns: bool
Parameters: char * target, char const * source, int size
size is the size of target in bytes (including the terminating 0)
Returns target.
Parameters: char const * s, char const * s2
Parameters: char const * s, char const * end
Parameters: char const * s, char const * start
Parameters: char * (* s), char const * cat
Parameters: char * (* s), str format, va_list args
Parameters: char * (* s), str format, …
Parameters: char * (* s), char const * cat, char const * sep
Parameters: char * (* s), char const * pre
Parameters: char * (* s), int off, char const * wat, char const * wit
Given a pointer to a string, replaces the string with a new string and deletes the original one. The new string will have the first occurence of “wat” replaced with “wit”, starting at byte offset off.
Parameters: str hay, str needle
Parameters: char * (* s), char const * wat, char const * wit
Like land_replace but replaces all occurences. Returns the number of replacements performed.
Parameters: str s
Parameters: char * (* s), int start, int end
Shorten a string so it starts at stat and ends before end.
land_shorten("abcd", 1, 3) -> "bc" land_shorten("abcd", 1, -1) -> "bc"
Cut the given sequence from start to before end out of the string.
Parameters: char const * s, int a, int b
Parameters: char * (* s)
Parameters: char const * dir, int(* filter)(char const , bool is_dir, void data), int flags, void * data
Returns: LandArray*
Returns an array of files in the given directory. Before a file is added, the filter function is called, with the name about to be added and an indication whether it is a filename or a directory.
If flags is LAND_FULL_PATH files are returned as a full path, if LAND_RELATIVE_PATH relative to dir, otherwise as only the filename. The return value of the filter decides what is done with the name: 0 - Discard it. 1 - Append it to the returned list. 2 - If it is a directory, recurse into it. 3 - Like 1 and 2 combined.
Returns a LandArray with three elements, for example:
data/blah/tree.png -> ["data/blah", "tree", "png"] test.txt -> [None, "test", "txt"] /etc/passwd -> ["/etc", "passwd", None]
The return value can most conveniently be freed like this:
a = land_split_path_name_ext(filename) ... land_array_destroy_with_strings(a)
Parameters: char const * text, str c
Returns an array of strings which you should destroy with
land_array_destroy_with_strings
Parameters: str text, str sep, char * (* a), char * (* b)
Parameters: char const * text
Parameters: str text