34 #include <sys/types.h> 52 int fd =
open(
"/proc/sys/kernel/random/uuid", O_RDONLY);
67 for (
unsigned i = 0; i !=
UUID_SIZE; ++i) {
69 in += ((0x2a8 >> i) & 1) | 2;
76 for (
unsigned i = 0; i !=
UUID_SIZE; ++i) {
77 unsigned char ch = uu[i];
78 *out++ =
"0123456789abcdef"[ch >> 4];
79 *out++ =
"0123456789abcdef"[ch & 0x0f];
WritableDatabase open()
Construct a WritableDatabase object for a new, empty InMemory database.
include <sys/stat.h> with portability enhancements
const size_t UUID_STRING_SIZE
The size of a UUID string in bytes (not including trailing '\0').
Hierarchy of classes which Xapian can throw as exceptions.
void uuid_generate(uuid_t uu)
DatabaseCreateError indicates a failure to create a database.
include <errno.h>, but working around broken platforms.
const size_t UUID_SIZE
The size of a UUID in bytes.
int uuid_parse(const char *in, uuid_t uu)
Various handy helpers which std::string really should provide.
void uuid_clear(uuid_t uu)
int uuid_is_null(const uuid_t uu)
<unistd.h>, but with compat.
void uuid_unparse_lower(const uuid_t uu, char *out)
include <fcntl.h>, but working around broken platforms.