Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
core.c File Reference
#include <errno.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include "lmdb.h"
#include "volksdata/core.h"
Include dependency graph for core.c:

Go to the source code of this file.

Functions

VOLK_rc mkdir_p (const char *_path, mode_t mode)
 Make recursive directories.
char * strndup (const char *src, size_t max)
 Replacement for GNU strndup.
char * strdup (const char *src)
 Replacement for GNU strdup.
VOLK_rc rm_r (const char *path)
 Remove a directory recursively (POSIX compatible).
const char * VOLK_strerror (VOLK_rc rc)
 Return an error message for a return code.
int utf8_encode (const uint32_t utf, unsigned char *out)
 Encode a code point using UTF-8.

Variables

bool VOLK_env_is_init = false
 Whether the environment is initialized.
char * warning_msg []
 Warning messages.
char * err_msg []
 error messages.
char * VOLK_root_path = __FILE__

Variable Documentation

◆ err_msg

char* err_msg[]
Initial value:
= {
"VOLK_ERROR: Runtime error.",
"VOLK_PARSE_ERR: Error parsing input.",
"VOLK_VALUE_ERR: Invalid input.",
"VOLK_TXN_ERR: MDB transaction error.",
"VOLK_DB_ERR: Database error.",
"VOLK_NOT_IMPL_ERR: Feature is not implemented.",
"VOLK_IO_ERR: Input/Output error.",
"VOLK_MEM_ERR: Memory error.",
"VOLK_CONFLICT_ERR: A resource conflict interrupted the operation.",
"VOLK_ENV_ERR: Environment not initialized. Did you call VOLK_init()?",
}

error messages.

Note that all error values are < 0 so it is possible to set conditions to be triggered only by error return values.

The message corresponding to the rc is found by err_msg[rc - VOLK_MIN_ERROR]. VOLK_strerror() facilitates this.

Definition at line 33 of file core.c.