|
Volksdata 1.0b7
RDF library
|

Topics | |
| Private RDF codec API | |
| Store interface module | |
Macros | |
| #define | VOLK_MIN_ERROR -88899 |
| Minimum error value. | |
| #define | VOLK_MAX_ERROR -88000 |
| #define | VOLK_MIN_WARNING 88800 |
| First warning value. | |
| #define | VOLK_MAX_WARNING 88899 |
| #define | LOG_DEBUG(...) |
| #define | LOG_TRACE(...) |
| #define | LOG_RC(rc) |
| Log an error or warning for return codes that are not VOLK_OK. | |
| #define | CHECK(exp, marker) |
| Jump to marker if exp does not return VOLK_OK. | |
| #define | PCHECK(exp, marker) |
| Jump to marker if exp returns a negative value (skip warnings). | |
| #define | NLCHECK(exp, marker) |
| Log error and jump to marker if exp is NULL. | |
| #define | RCCK(exp) |
| Return exp return value if it is of VOLK_rc type and nonzero. | |
| #define | PRCCK(exp) |
| Return exp return value if it is of VOLK_rc type and negative (=error). | |
| #define | RCNL(exp) |
| Return NULL if exp returns a nonzero value. | |
| #define | PRCNL(exp) |
| Return NULL if exp returns a negative value (=error). | |
| #define | NLNL(exp) |
| Log error and return NULL if exp is NULL. | |
| #define | MALLOC_GUARD(var, rc) |
| Allocate one pointer with malloc and return rc if it fails. | |
| #define | CALLOC_GUARD(var, rc) |
| Allocate one pointer with calloc and return rc if it fails. | |
Functions | |
| char * | strndup (const char *src, size_t max) |
| Replacement for GNU strndup. | |
| char * | strdup (const char *src) |
| Replacement for GNU strdup. | |
| VOLK_rc | mkdir_p (const char *path, mode_t mode) |
| Make recursive directories. | |
| VOLK_rc | rm_r (const char *path) |
| Remove a directory recursively, as in Unix "rm -r". | |
| int | utf8_encode (const uint32_t utf, unsigned char *out) |
| Encode a code point using UTF-8. | |
| #define VOLK_MAX_ERROR -88000 |
| #define VOLK_MAX_WARNING 88899 |
| #define LOG_RC | ( | rc | ) |
Log an error or warning for return codes that are not VOLK_OK.
Note that, if used outside of the other macros below, care must be taken to pass it an actual return code rather than an expression, otherwise the expression will be evaluated multiple times.
| #define CHECK | ( | exp, | |
| marker ) |
Jump to marker if exp does not return VOLK_OK.
| #define PCHECK | ( | exp, | |
| marker ) |
| #define NLCHECK | ( | exp, | |
| marker ) |
| #define RCCK | ( | exp | ) |
| #define PRCCK | ( | exp | ) |
| #define RCNL | ( | exp | ) |
| #define PRCNL | ( | exp | ) |
| #define NLNL | ( | exp | ) |
| #define MALLOC_GUARD | ( | var, | |
| rc ) |
| #define CALLOC_GUARD | ( | var, | |
| rc ) |
| char * strndup | ( | const char * | src, |
| size_t | max ) |
Replacement for GNU strndup.
param[in] src String to duplicate. param[in] max Max number of characters to duplicate. The length is capped to the smaller value between this and the source string length (characters up to the trailing \0).
return Duplicated string. The caller is in charge of freeing it after use.
| char * strdup | ( | const char * | src | ) |
| VOLK_rc mkdir_p | ( | const char * | path, |
| mode_t | mode ) |
Make recursive directories.
Modified from https://gist.github.com/JonathonReinhart/8c0d90191c38af2dcadb102c4e202950
| VOLK_rc rm_r | ( | const char * | path | ) |
Remove a directory recursively, as in Unix "rm -r".
| [in] | path | Path of directory to remove. |
Remove a directory recursively, as in Unix "rm -r".
Adapted from https://stackoverflow.com/questions/5467725/how-to-delete-a-directory-and-its-contents-in-posix-c/42596507#42596507
|
inline |
Encode a code point using UTF-8.
https://gist.github.com/MightyPork/52eda3e5677b4b03524e40c9f0ab1da5
| out | - output buffer (min 5 characters), will be 0-terminated |
| utf | - code point 0-0x10FFFF |