#include <stdio.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <time.h>
+#include <syslog.h>
-#include <loc/libloc.h>
-#include <loc/stringpool.h>
+#include <libloc/libloc.h>
+#include <libloc/stringpool.h>
static const char* characters = "012345789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
if (err < 0)
exit(EXIT_FAILURE);
+ // Enable debug logging
+ loc_set_log_priority(ctx, LOG_DEBUG);
+
// Create the stringpool
struct loc_stringpool* pool;
err = loc_stringpool_new(ctx, &pool);
// Append a string
off_t pos = loc_stringpool_add(pool, "ABC");
if (pos < 0) {
- fprintf(stderr, "Could not add string: %s\n", strerror(-pos));
+ fprintf(stderr, "Could not add string: %m\n");
exit(EXIT_FAILURE);
}
free(string);
if (pos < 0) {
- fprintf(stderr, "Could not add string %d: %s\n", i, strerror(-pos));
+ fprintf(stderr, "Could not add string %d: %m\n", i);
exit(EXIT_FAILURE);
}
}