X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkinput.c;h=781ec9a80112479667999ba08d0e5690fb1e1c76;hb=3db15cf883ad80b6a4b0e960f3c3b59c86b59c6b;hp=eb7b251320ec7c39b998a25097211c498a37148d;hpb=2954746ef5c897ec5e651cc2c39eda878f1d5da5;p=idzebra-moved-to-github.git diff --git a/index/kinput.c b/index/kinput.c index eb7b251..781ec9a 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -1,10 +1,23 @@ /* - * Copyright (C) 1994-1996, Index Data I/S + * Copyright (C) 1994-1998, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.23 1997-09-04 13:57:39 adam + * Revision 1.27 1998-02-17 10:32:52 adam + * Fixed bug: binary files weren't opened with flag b on NT. + * + * Revision 1.26 1998/01/29 13:39:13 adam + * Compress ISAM is default. + * + * Revision 1.25 1997/09/17 12:19:14 adam + * Zebra version corresponds to YAZ version 1.4. + * Changed Zebra server so that it doesn't depend on global common_resource. + * + * Revision 1.24 1997/09/09 13:38:07 adam + * Partial port to WIN95/NT. + * + * Revision 1.23 1997/09/04 13:57:39 adam * Added O_BINARY for open calls. * * Revision 1.22 1997/02/12 20:39:45 adam @@ -88,7 +101,11 @@ */ #include +#ifdef WINDOWS +#include +#else #include +#endif #include #include #include @@ -435,6 +452,7 @@ int heap_inpc (struct heap_info *hi) strcpy (this_name, hci.cur_name); logf (LOG_DEBUG, "inserting %s", 1+hci.cur_name); + assert (hci.cur_name[1]); no_diffs++; if ((dict_info = dict_lookup (hi->dict, hci.cur_name))) { @@ -568,7 +586,11 @@ void progressFunc (struct key_file *keyp, void *info) p->totalOffset += keyp->buf_size; } -void key_input (int nkeys, int cache) +#ifndef R_OK +#define R_OK 4 +#endif + +void key_input (BFiles bfs, int nkeys, int cache) { Dict dict; @@ -594,15 +616,16 @@ void key_input (int nkeys, int cache) if (!nkeys) return ; } - dict = dict_open (FNAME_DICT, cache, 1); + dict = dict_open (bfs, FNAME_DICT, cache, 1); if (!dict) { logf (LOG_FATAL, "dict_open fail"); exit (1); } - if (res_get_match (common_resource, "isam", "c", NULL)) + if (!res_get_match (common_resource, "isam", "i", NULL)) { - isamc = isc_open (FNAME_ISAMC, 1, key_isamc_m ()); + isamc = isc_open (bfs, + FNAME_ISAMC, 1, key_isamc_m (common_resource)); if (!isamc) { logf (LOG_FATAL, "isc_open fail"); @@ -611,7 +634,8 @@ void key_input (int nkeys, int cache) } else { - isam = is_open (FNAME_ISAM, key_compare, 1, sizeof(struct it_key)); + isam = is_open (bfs, FNAME_ISAM, key_compare, 1, + sizeof(struct it_key), common_resource); if (!isam) { logf (LOG_FATAL, "is_open fail");