From 78a5114a3d2a330bd7c507c4055af0e94688aef1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 22 Apr 2007 15:00:56 +0000 Subject: [PATCH] Removed load_simpletargets --- src/database.c | 39 ++------------------------------------- src/database.h | 3 +-- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/database.c b/src/database.c index df6f11a..f43cc75 100644 --- a/src/database.c +++ b/src/database.c @@ -1,4 +1,4 @@ -/* $Id: database.c,v 1.23 2007-04-21 12:00:54 adam Exp $ +/* $Id: database.c,v 1.24 2007-04-22 15:00:56 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -158,7 +158,7 @@ struct database *find_database(const char *id, int new) return load_database(id); } -// This whole session_grep database thing should be moved to pazpar2.c +// This whole session_grep database thing should be moved elsewhere int match_zurl(const char *zurl, const char *pattern) { @@ -259,41 +259,6 @@ int grep_databases(void *context, struct database_criterion *cl, return i; } -// This function will most likely vanish when a proper target profile mechanism is -// introduced. -void load_simpletargets(const char *fn) -{ - FILE *f = fopen(fn, "r"); - char line[256]; - - if (!f) - { - yaz_log(YLOG_WARN|YLOG_ERRNO, "open %s", fn); - exit(1); - } - - while (fgets(line, 255, f)) - { - char *url; - char *name; - struct database *db; - - if (strncmp(line, "target ", 7)) - continue; - line[strlen(line) - 1] = '\0'; - - if ((name = strchr(line, ';'))) - *(name++) = '\0'; - - url = line + 7; - - if (!(db = find_database(url, 0))) - yaz_log(YLOG_WARN, "Unable to load database %s", url); - } - fclose(f); -} - - /* * Local variables: * c-basic-offset: 4 diff --git a/src/database.h b/src/database.h index 08e87ae..3efe9e7 100644 --- a/src/database.h +++ b/src/database.h @@ -1,4 +1,4 @@ -/* $Id: database.h,v 1.6 2007-04-11 18:42:25 quinn Exp $ +/* $Id: database.h,v 1.7 2007-04-22 15:00:56 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -22,7 +22,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef DATABASE_H #define DATABASE_H -void load_simpletargets(const char *fn); void prepare_databases(void); struct database *find_database(const char *id, int new); int database_match_criteria(struct session_database *db, struct database_criterion *cl); -- 1.7.10.4