From: Adam Dickmeiss Date: Fri, 1 Nov 1996 08:58:41 +0000 (+0000) Subject: Interface to isamc system now includes update and delete. X-Git-Tag: ZEBRA.1.0~382 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=f0dbdd21e0227559e4407a5e25ce3ead47ede825 Interface to isamc system now includes update and delete. --- diff --git a/index/kinput.c b/index/kinput.c index 89824d5..ac03e13 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.19 1996-10-29 14:09:46 adam + * Revision 1.20 1996-11-01 08:58:41 adam + * Interface to isamc system now includes update and delete. + * + * Revision 1.19 1996/10/29 14:09:46 adam * Use of cisam system - enabled if setting isamc is 1. * * Revision 1.18 1996/06/04 10:18:59 adam @@ -400,9 +403,7 @@ int heap_cread_item (void *vp, char **dst, int *insertMode) int heap_inpc (struct heap_info *hi) { struct heap_cread_info hci; - ISAMC_P isamc_p; ISAMC_I isamc_i = xmalloc (sizeof(*isamc_i)); - void *dict_info; hci.key = xmalloc (KEY_SIZE); hci.mode = 1; @@ -414,16 +415,33 @@ int heap_inpc (struct heap_info *hi) while (hci.more) { + char this_name[INP_NAME_MAX]; + ISAMC_P isamc_p, isamc_p2; + char *dict_info; + + strcpy (this_name, hci.cur_name); logf (LOG_DEBUG, "inserting %s", 1+hci.cur_name); if ((dict_info = dict_lookup (hi->dict, hci.cur_name))) { - logf (LOG_FATAL, "Cannot merge really yet! %s", hci.cur_name); - exit (1); + memcpy (&isamc_p, dict_info+1, sizeof(ISAMC_P)); + isamc_p2 = isc_merge (hi->isamc, isamc_p, isamc_i); + if (!isamc_p2) + { + no_deletions++; + if (!dict_delete (hi->dict, this_name)) + abort(); + } + else + { + no_updates++; + if (isamc_p2 != isamc_p) + dict_insert (hi->dict, this_name, + sizeof(ISAMC_P), &isamc_p2); + + } } else { - char this_name[128]; - strcpy (this_name, hci.cur_name); isamc_p = isc_merge (hi->isamc, 0, isamc_i); no_insertions++; dict_insert (hi->dict, this_name, sizeof(ISAMC_P), &isamc_p); diff --git a/index/trav.c b/index/trav.c index b11b793..994445e 100644 --- a/index/trav.c +++ b/index/trav.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trav.c,v $ - * Revision 1.27 1996-10-29 14:06:56 adam + * Revision 1.28 1996-11-01 08:58:44 adam + * Interface to isamc system now includes update and delete. + * + * Revision 1.27 1996/10/29 14:06:56 adam * Include zebrautl.h instead of alexutil.h. * * Revision 1.26 1996/06/04 10:19:01 adam @@ -263,8 +266,8 @@ static void fileUpdateR (struct dirs_info *di, struct dirs_entry *dst, { dirs_add (di, src, dst->sysno, e_src[i_src].mtime); } - logf (LOG_LOG, "old: %s", ctime (&dst->mtime)); - logf (LOG_LOG, "new: %s", ctime (&e_src[i_src].mtime)); + logf (LOG_DEBUG, "old: %s", ctime (&dst->mtime)); + logf (LOG_DEBUG, "new: %s", ctime (&e_src[i_src].mtime)); } dst = dirs_read (di); break;