X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkinput.c;h=9f834a9da6699cf87747c075371c5bf054f8eb15;hb=083d994896c30d9c560580daa19c9ca370901e3a;hp=40fc3090ada46237779bfcc06628c61e90dcb9ea;hpb=a02c4cf957603c707fe9f4fde94a468f1d030dfb;p=idzebra-moved-to-github.git diff --git a/index/kinput.c b/index/kinput.c index 40fc309..9f834a9 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -1,10 +1,16 @@ /* - * Copyright (C) 1995, Index Data I/S + * Copyright (C) 1994-1995, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.1 1995-09-04 09:10:37 adam + * Revision 1.3 1995-09-06 16:11:17 adam + * Option: only one word key per file. + * + * Revision 1.2 1995/09/04 12:33:42 adam + * Various cleanup. YAZ util used instead. + * + * Revision 1.1 1995/09/04 09:10:37 adam * More work on index add/del/update. * Merge sort implemented. * Initial work on z39 server. @@ -61,7 +67,7 @@ static int inp (Dict dict, ISAM isam, const char *name) key_buf = xmalloc (key_buf_size * (KEY_SIZE)); if (!(inf = fopen (name, "r"))) { - log (LOG_FATAL|LOG_ERRNO, "cannot open `%s'", name); + logf (LOG_FATAL|LOG_ERRNO, "cannot open `%s'", name); exit (1); } read_one (inf, cur_name, key_buf); @@ -93,7 +99,7 @@ static int inp (Dict dict, ISAM isam, const char *name) if ((info = dict_lookup (dict, cur_name))) { ISAM_P isam_p, isam_p2; - log (LOG_DEBUG, "updating %s", cur_name); + logf (LOG_DEBUG, "updating %s", cur_name); no_updates++; memcpy (&isam_p, info+1, sizeof(ISAM_P)); isam_p2 = is_merge (isam, isam_p, nmemb, key_buf); @@ -103,7 +109,7 @@ static int inp (Dict dict, ISAM isam, const char *name) else { ISAM_P isam_p; - log (LOG_DEBUG, "inserting %s", cur_name); + logf (LOG_DEBUG, "inserting %s", cur_name); no_insertions++; isam_p = is_merge (isam, 0, nmemb, key_buf); dict_insert (dict, cur_name, sizeof(ISAM_P), &isam_p); @@ -124,20 +130,20 @@ void key_input (const char *dict_fname, const char *isam_fname, dict = dict_open (dict_fname, cache, 1); if (!dict) { - log (LOG_FATAL, "dict_open fail of `%s'", dict_fname); + logf (LOG_FATAL, "dict_open fail of `%s'", dict_fname); exit (1); } - isam = is_open (isam_fname, key_compare, 1); + isam = is_open (isam_fname, key_compare, 1, sizeof(struct it_key)); if (!isam) { - log (LOG_FATAL, "is_open fail of `%s'", isam_fname); + logf (LOG_FATAL, "is_open fail of `%s'", isam_fname); exit (1); } inp (dict, isam, key_fname); dict_close (dict); is_close (isam); - log (LOG_LOG, "Iterations . . .%7d", no_iterations); - log (LOG_LOG, "Distinct words .%7d", no_diffs); - log (LOG_LOG, "Updates. . . . .%7d", no_updates); - log (LOG_LOG, "Insertions . . .%7d", no_insertions); + logf (LOG_LOG, "Iterations . . .%7d", no_iterations); + logf (LOG_LOG, "Distinct words .%7d", no_diffs); + logf (LOG_LOG, "Updates. . . . .%7d", no_updates); + logf (LOG_LOG, "Insertions . . .%7d", no_insertions); }