]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Drop loc_load function
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 17:14:53 +0000 (17:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 17:14:53 +0000 (17:14 +0000)
We don't need this any more

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libloc.c
src/libloc.sym
src/loc/libloc.h

index 630a4d5c8c7d414ba46a708d766d31e72db58a5b..61f7c5600787dd2e9ff29e97cb0f91a11fa97cb2 100644 (file)
@@ -26,7 +26,6 @@
 #include <ctype.h>
 
 #include <loc/libloc.h>
-#include <loc/database.h>
 #include <loc/private.h>
 
 struct loc_ctx {
@@ -35,8 +34,6 @@ struct loc_ctx {
                int priority, const char *file, int line, const char *fn,
                const char *format, va_list args);
        int log_priority;
-
-       struct loc_database* db;
 };
 
 void loc_log(struct loc_ctx* ctx,
@@ -85,8 +82,6 @@ LOC_EXPORT int loc_new(struct loc_ctx** ctx) {
        c->log_fn = log_stderr;
        c->log_priority = LOG_ERR;
 
-       c->db = NULL;
-
        const char* env = secure_getenv("LOC_LOG");
        if (env)
                loc_set_log_priority(c, log_priority(env));
@@ -114,10 +109,6 @@ LOC_EXPORT struct loc_ctx* loc_unref(struct loc_ctx* ctx) {
        if (--ctx->refcount > 0)
                return NULL;
 
-       // Release any loaded databases
-       if (ctx->db)
-               loc_database_unref(ctx->db);
-
        INFO(ctx, "context %p released\n", ctx);
        free(ctx);
 
@@ -139,26 +130,6 @@ LOC_EXPORT void loc_set_log_priority(struct loc_ctx* ctx, int priority) {
        ctx->log_priority = priority;
 }
 
-LOC_EXPORT int loc_load(struct loc_ctx* ctx, const char* path) {
-       FILE* f = fopen(path, "r");
-       if (!f)
-               return -errno;
-
-       // Release any previously openend database
-       if (ctx->db)
-               loc_database_unref(ctx->db);
-
-       // Open the new database
-       int r = loc_database_new(ctx, &ctx->db, f);
-       if (r)
-               return r;
-
-       // Close the file
-       fclose(f);
-
-       return 0;
-}
-
 LOC_EXPORT int loc_parse_address(struct loc_ctx* ctx, const char* string, struct in6_addr* address) {
        DEBUG(ctx, "Paring IP address %s\n", string);
 
index 5a99bf6f87e9c4cfd6d3b3bcf422824dc8d977f5..9005010bed39bf0f9ec5e8daa7c24b683e322aaf 100644 (file)
@@ -26,7 +26,6 @@ global:
        loc_unref;
        loc_set_log_priority;
        loc_new;
-       loc_load;
 
        # AS
        loc_as_cmp;
index 2d392fe911a1e35ae50d8b06858aacb093478141..4854a418b1e554604824f7f323a8b44cdbc0bcd6 100644 (file)
@@ -36,8 +36,6 @@ void loc_set_log_fn(struct loc_ctx* ctx,
 int loc_get_log_priority(struct loc_ctx* ctx);
 void loc_set_log_priority(struct loc_ctx* ctx, int priority);
 
-int loc_load(struct loc_ctx* ctx, const char* path);
-
 #ifdef LIBLOC_PRIVATE
 int loc_parse_address(struct loc_ctx* ctx, const char* string, struct in6_addr* address);
 #endif