2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.24 1995-10-09 16:18:37 adam
8 * Function dict_lookup_grep got extra client data parameter.
10 * Revision 1.23 1995/10/06 16:33:37 adam
11 * Use attribute mappings.
13 * Revision 1.22 1995/10/06 15:07:39 adam
14 * Structure 'local-number' handled.
16 * Revision 1.21 1995/10/06 13:52:06 adam
17 * Bug fixes. Handler may abort further scanning.
19 * Revision 1.20 1995/10/06 11:06:33 adam
20 * Scan entries include 'occurrences' now.
22 * Revision 1.19 1995/10/06 10:43:56 adam
23 * Scan added. 'occurrences' in scan entries not set yet.
25 * Revision 1.18 1995/10/04 16:57:20 adam
26 * Key input and merge sort in one pass.
28 * Revision 1.17 1995/10/04 12:55:17 adam
29 * Bug fix in ranked search. Use=Any keys inserted.
31 * Revision 1.16 1995/10/02 16:24:40 adam
32 * Use attribute actually used in search requests.
34 * Revision 1.15 1995/10/02 15:18:52 adam
35 * New member in recRetrieveCtrl: diagnostic.
37 * Revision 1.14 1995/09/28 12:10:32 adam
38 * Bug fixes. Field prefix used in queries.
40 * Revision 1.13 1995/09/18 14:17:50 adam
43 * Revision 1.12 1995/09/15 14:45:21 adam
47 * Revision 1.11 1995/09/14 11:53:27 adam
48 * First work on regular expressions/truncations.
50 * Revision 1.10 1995/09/11 15:23:26 adam
51 * More work on relevance search.
53 * Revision 1.9 1995/09/11 13:09:35 adam
54 * More work on relevance feedback.
56 * Revision 1.8 1995/09/08 14:52:27 adam
57 * Minor changes. Dictionary is lower case now.
59 * Revision 1.7 1995/09/07 13:58:36 adam
60 * New parameter: result-set file descriptor (RSFD) to support multiple
61 * positions within the same result-set.
62 * Boolean operators: and, or, not implemented.
63 * Result-set references.
65 * Revision 1.6 1995/09/06 16:11:18 adam
66 * Option: only one word key per file.
68 * Revision 1.5 1995/09/06 10:33:04 adam
69 * More work on present. Some log messages removed.
71 * Revision 1.4 1995/09/05 15:28:40 adam
72 * More work on search engine.
74 * Revision 1.3 1995/09/04 15:20:22 adam
77 * Revision 1.2 1995/09/04 12:33:43 adam
78 * Various cleanup. YAZ util used instead.
80 * Revision 1.1 1995/09/04 09:10:40 adam
81 * More work on index add/del/update.
82 * Merge sort implemented.
83 * Initial work on z39 server.
91 #include <attribute.h>
99 int index_word_prefix_map (char *string, oid_value attrSet, int attrUse)
103 logf (LOG_DEBUG, "oid_value attrSet = %d, attrUse = %d", attrSet, attrUse);
104 attp = att_getentbyatt (attrSet, attrUse);
107 logf (LOG_DEBUG, "ord=%d", attp->attset_ordinal);
108 return index_word_prefix (string, attp->attset_ordinal,
109 attp->local_attribute);
113 * attr_print: log attributes
115 static void attr_print (Z_AttributesPlusTerm *t)
118 for (of = 0; of < t->num_attributes; of++)
120 Z_AttributeElement *element;
121 element = t->attributeList[of];
123 switch (element->which)
125 case Z_AttributeValue_numeric:
126 logf (LOG_DEBUG, "attributeType=%d value=%d",
127 *element->attributeType,
128 *element->value.numeric);
130 case Z_AttributeValue_complex:
131 logf (LOG_DEBUG, "attributeType=%d complex",
132 *element->attributeType);
133 for (i = 0; i<element->value.complex->num_list; i++)
135 if (element->value.complex->list[i]->which ==
136 Z_StringOrNumeric_string)
137 logf (LOG_DEBUG, " string: '%s'",
138 element->value.complex->list[i]->u.string);
139 else if (element->value.complex->list[i]->which ==
140 Z_StringOrNumeric_numeric)
141 logf (LOG_DEBUG, " numeric: '%d'",
142 *element->value.complex->list[i]->u.numeric);
155 Z_AttributesPlusTerm *zapt;
158 static int attr_find (AttrType *src, oid_value *attributeSetP)
160 while (src->major < src->zapt->num_attributes)
162 Z_AttributeElement *element;
164 element = src->zapt->attributeList[src->major];
165 if (src->type == *element->attributeType)
167 switch (element->which)
169 case Z_AttributeValue_numeric:
171 if (element->attributeSet && attributeSetP)
175 attrset = oid_getentbyoid (element->attributeSet);
176 *attributeSetP = attrset->value;
178 return *element->value.numeric;
180 case Z_AttributeValue_complex:
181 if (src->minor >= element->value.complex->num_list ||
182 element->value.complex->list[src->minor]->which !=
183 Z_StringOrNumeric_numeric)
186 if (element->attributeSet && attributeSetP)
190 attrset = oid_getentbyoid (element->attributeSet);
191 *attributeSetP = attrset->value;
193 return *element->value.complex->list[src->minor-1]->u.numeric;
203 static void attr_init (AttrType *src, Z_AttributesPlusTerm *zapt,
216 int (*cmp)(const void *p1, const void *p2);
223 static void heap_swap (struct trunc_info *ti, int i1, int i2)
227 memcpy (ti->swapbuf, ti->heap[i1], ti->keysize);
228 memcpy (ti->heap[i1], ti->heap[i2], ti->keysize);
229 memcpy (ti->heap[i2], ti->swapbuf, ti->keysize);
232 ti->indx[i1] = ti->indx[i2];
236 static void heap_delete (struct trunc_info *ti)
238 int cur = 1, child = 2;
240 assert (ti->heapnum > 0);
241 memcpy (ti->heap[1], ti->heap[ti->heapnum], ti->keysize);
242 ti->indx[1] = ti->indx[ti->heapnum--];
243 while (child <= ti->heapnum) {
244 if (child < ti->heapnum &&
245 (*ti->cmp)(ti->heap[child], ti->heap[1+child]) > 0)
247 if ((*ti->cmp)(ti->heap[cur], ti->heap[child]) > 0)
249 heap_swap (ti, cur, child);
258 static void heap_insert (struct trunc_info *ti, const char *buf, int indx)
262 cur = ++(ti->heapnum);
263 memcpy (ti->heap[cur], buf, ti->keysize);
264 ti->indx[cur] = indx;
266 while (parent && (*ti->cmp)(ti->heap[parent], ti->heap[cur]) > 0)
268 heap_swap (ti, cur, parent);
275 struct trunc_info *heap_init (int size, int key_size,
276 int (*cmp)(const void *p1, const void *p2))
278 struct trunc_info *ti = xmalloc (sizeof(*ti));
283 ti->keysize = key_size;
285 ti->indx = xmalloc (size * sizeof(*ti->indx));
286 ti->heap = xmalloc (size * sizeof(*ti->heap));
287 ti->swapbuf = xmalloc (ti->keysize);
288 ti->tmpbuf = xmalloc (ti->keysize);
289 ti->buf = xmalloc (size * ti->keysize);
290 for (i = size; --i >= 0; )
291 ti->heap[i] = ti->buf + ti->keysize * i;
295 static void heap_close (struct trunc_info *ti)
304 static RSET rset_trunc (ISAM isam, ISAM_P *isam_p, int from, int to,
307 logf (LOG_DEBUG, "rset_trunc, range=%d-%d", from, to-1);
308 if (to - from > merge_chunk)
316 struct trunc_info *ti;
319 rset_temp_parms parms;
321 ispt = xmalloc (sizeof(*ispt) * (to-from));
322 parms.key_size = sizeof (struct it_key);
323 result = rset_create (rset_kind_temp, &parms);
324 rsfd = rset_open (result, 1);
326 ti = heap_init (to-from, sizeof(struct it_key),
328 for (i = to-from; --i >= 0; )
330 ispt[i] = is_position (isam, isam_p[from+i]);
331 if (is_readkey (ispt[i], ti->tmpbuf))
332 heap_insert (ti, ti->tmpbuf, i);
338 rset_write (result, rsfd, ti->heap[1]);
340 if (is_readkey (ispt[n], ti->tmpbuf))
341 heap_insert (ti, ti->tmpbuf, n);
343 for (i = to-from; --i >= 0; )
344 is_pt_free (ispt[i]);
345 rset_close (result, rsfd);
358 static void add_isam_p (const char *info, struct grep_info *p)
360 if (p->isam_p_indx == p->isam_p_size)
362 ISAM_P *new_isam_p_buf;
364 p->isam_p_size = 2*p->isam_p_size + 100;
365 new_isam_p_buf = xmalloc (sizeof(*new_isam_p_buf) *
369 memcpy (new_isam_p_buf, p->isam_p_buf,
370 p->isam_p_indx * sizeof(*p->isam_p_buf));
371 xfree (p->isam_p_buf);
373 p->isam_p_buf = new_isam_p_buf;
375 assert (*info == sizeof(*p->isam_p_buf));
376 memcpy (p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf));
380 static int grep_handle (Dict_char *name, const char *info, void *p)
382 logf (LOG_DEBUG, "dict name: %s", name);
383 add_isam_p (info, p);
387 static int trunc_term (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
388 const char *term_sub,
389 oid_value attributeSet, struct grep_info *grep_info)
391 char term_dict[2*IT_MAX_WORD+2];
395 int truncation_value;
398 oid_value curAttributeSet = attributeSet;
400 attr_init (&use, zapt, 1);
401 use_value = attr_find (&use, &curAttributeSet);
402 logf (LOG_DEBUG, "use value %d", use_value);
403 attr_init (&truncation, zapt, 5);
404 truncation_value = attr_find (&truncation, NULL);
405 logf (LOG_DEBUG, "truncation value %d", truncation_value);
409 i = index_word_prefix_map (term_dict, curAttributeSet, use_value);
416 switch (truncation_value)
418 case -1: /* not specified */
419 case 100: /* do not truncate */
420 strcat (term_dict, term_sub);
421 logf (LOG_DEBUG, "dict_lookup: %s", term_dict);
422 if ((info = dict_lookup (zi->wordDict, term_dict)))
423 add_isam_p (info, grep_info);
425 case 1: /* right truncation */
426 strcat (term_dict, term_sub);
427 strcat (term_dict, ".*");
428 dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle);
430 case 2: /* left truncation */
431 case 3: /* left&right truncation */
434 case 101: /* process # in term */
435 for (j = strlen(term_dict), i = 0; term_sub[i] && i < 2; i++)
436 term_dict[j++] = term_sub[i];
437 for (; term_sub[i]; i++)
438 if (term_sub[i] == '#')
440 term_dict[j++] = '.';
441 term_dict[j++] = '*';
444 term_dict[j++] = term_sub[i];
446 dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle);
448 case 102: /* regular expression */
449 strcat (term_dict, term_sub);
450 dict_lookup_grep (zi->wordDict, term_dict, 0, grep_info, grep_handle);
453 logf (LOG_DEBUG, "%d positions", grep_info->isam_p_indx);
457 static void trans_term (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
461 Z_Term *term = zapt->term;
463 sizez = term->u.general->len;
464 if (sizez > IT_MAX_WORD)
466 for (i = 0; i < sizez; i++)
467 termz[i] = index_char_cvt (term->u.general->buf[i]);
471 static RSET rpn_search_APT_relevance (ZServerInfo *zi,
472 Z_AttributesPlusTerm *zapt,
473 oid_value attributeSet)
475 rset_relevance_parms parms;
476 char termz[IT_MAX_WORD+1];
477 char term_sub[IT_MAX_WORD+1];
478 struct grep_info grep_info;
479 char *p0 = termz, *p1 = NULL;
482 parms.key_size = sizeof(struct it_key);
484 parms.cmp = key_compare;
485 parms.is = zi->wordIsam;
487 if (zapt->term->which != Z_Term_general)
492 trans_term (zi, zapt, termz);
493 grep_info.isam_p_indx = 0;
494 grep_info.isam_p_size = 0;
495 grep_info.isam_p_buf = NULL;
498 if ((p1 = strchr (p0, ' ')))
500 memcpy (term_sub, p0, p1-p0);
501 term_sub[p1-p0] = '\0';
504 strcpy (term_sub, p0);
505 if (trunc_term (zi, zapt, term_sub, attributeSet, &grep_info))
513 parms.isam_positions = grep_info.isam_p_buf;
514 parms.no_isam_positions = grep_info.isam_p_indx;
515 if (grep_info.isam_p_indx > 0)
516 result = rset_create (rset_kind_relevance, &parms);
518 result = rset_create (rset_kind_null, NULL);
519 xfree (grep_info.isam_p_buf);
523 static RSET rpn_search_APT_word (ZServerInfo *zi,
524 Z_AttributesPlusTerm *zapt,
525 oid_value attributeSet)
527 rset_isam_parms parms;
528 char termz[IT_MAX_WORD+1];
529 struct grep_info grep_info;
532 if (zapt->term->which != Z_Term_general)
537 trans_term (zi, zapt, termz);
539 grep_info.isam_p_indx = 0;
540 grep_info.isam_p_size = 0;
541 grep_info.isam_p_buf = NULL;
543 if (trunc_term (zi, zapt, termz, attributeSet, &grep_info))
545 if (grep_info.isam_p_indx < 1)
546 result = rset_create (rset_kind_null, NULL);
547 else if (grep_info.isam_p_indx == 1)
549 parms.is = zi->wordIsam;
550 parms.pos = *grep_info.isam_p_buf;
551 result = rset_create (rset_kind_isam, &parms);
554 result = rset_trunc (zi->wordIsam, grep_info.isam_p_buf, 0,
555 grep_info.isam_p_indx, 400);
556 xfree (grep_info.isam_p_buf);
560 static RSET rpn_prox (RSET *rset, int rset_no)
568 rset_temp_parms parms;
570 rsfd = xmalloc (sizeof(*rsfd)*rset_no);
571 more = xmalloc (sizeof(*more)*rset_no);
572 buf = xmalloc (sizeof(*buf)*rset_no);
574 for (i = 0; i<rset_no; i++)
576 buf[i] = xmalloc (sizeof(**buf));
577 rsfd[i] = rset_open (rset[i], 0);
578 more[i] = rset_read (rset[i], rsfd[i], buf[i]);
580 parms.key_size = sizeof (struct it_key);
581 result = rset_create (rset_kind_temp, &parms);
582 rsfd_result = rset_open (result, 1);
586 for (i = 1; i<rset_no; i++)
595 cmp = key_compare (buf[i], buf[i-1]);
598 more[i-1] = rset_read (rset[i-1], rsfd[i-1], buf[i-1]);
603 if (buf[i-1]->seqno+1 != buf[i]->seqno)
605 more[i-1] = rset_read (rset[i-1], rsfd[i-1], buf[i-1]);
611 more[i] = rset_read (rset[i], rsfd[i], buf[i]);
617 rset_write (result, rsfd_result, buf[0]);
618 more[0] = rset_read (*rset, *rsfd, *buf);
622 for (i = 0; i<rset_no; i++)
624 rset_close (rset[i], rsfd[i]);
627 rset_close (result, rsfd_result);
634 static RSET rpn_search_APT_phrase (ZServerInfo *zi,
635 Z_AttributesPlusTerm *zapt,
636 oid_value attributeSet)
638 char termz[IT_MAX_WORD+1];
639 char term_sub[IT_MAX_WORD+1];
640 char *p0 = termz, *p1 = NULL;
641 RSET rset[60], result;
643 struct grep_info grep_info;
645 if (zapt->term->which != Z_Term_general)
650 trans_term (zi, zapt, termz);
652 grep_info.isam_p_size = 0;
653 grep_info.isam_p_buf = NULL;
657 if ((p1 = strchr (p0, ' ')))
659 memcpy (term_sub, p0, p1-p0);
660 term_sub[p1-p0] = '\0';
663 strcpy (term_sub, p0);
665 grep_info.isam_p_indx = 0;
666 if (trunc_term (zi, zapt, term_sub, attributeSet, &grep_info))
668 if (grep_info.isam_p_indx > 0)
670 if (grep_info.isam_p_indx > 1)
671 rset[rset_no] = rset_trunc (zi->wordIsam,
672 grep_info.isam_p_buf, 0,
673 grep_info.isam_p_indx, 400);
676 rset_isam_parms parms;
678 parms.is = zi->wordIsam;
679 parms.pos = *grep_info.isam_p_buf;
680 rset[rset_no] = rset_create (rset_kind_isam, &parms);
683 if (rset_no >= sizeof(rset)/sizeof(*rset))
692 xfree (grep_info.isam_p_buf);
694 return rset_create (rset_kind_null, NULL);
695 else if (rset_no == 1)
698 result = rpn_prox (rset, rset_no);
699 for (i = 0; i<rset_no; i++)
700 rset_delete (rset[i]);
704 static RSET rpn_search_APT_local (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
705 oid_value attributeSet)
710 rset_temp_parms parms;
711 char termz[IT_MAX_WORD+1];
713 if (zapt->term->which != Z_Term_general)
718 parms.key_size = sizeof (struct it_key);
719 result = rset_create (rset_kind_temp, &parms);
720 rsfd = rset_open (result, 1);
722 trans_term (zi, zapt, termz);
723 key.sysno = atoi (termz);
726 rset_write (result, rsfd, &key);
727 rset_close (result, rsfd);
732 static RSET rpn_search_APT (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
733 oid_value attributeSet)
737 int relation_value, structure_value;
739 attr_init (&relation, zapt, 2);
740 attr_init (&structure, zapt, 4);
742 relation_value = attr_find (&relation, NULL);
743 structure_value = attr_find (&structure, NULL);
744 switch (structure_value)
747 if (relation_value == 102) /* relevance relation */
748 return rpn_search_APT_relevance (zi, zapt, attributeSet);
749 return rpn_search_APT_phrase (zi, zapt, attributeSet);
751 if (relation_value == 102) /* relevance relation */
752 return rpn_search_APT_relevance (zi, zapt, attributeSet);
753 return rpn_search_APT_phrase (zi, zapt, attributeSet);
756 if (relation_value == 102) /* relevance relation */
757 return rpn_search_APT_relevance (zi, zapt, attributeSet);
758 return rpn_search_APT_word (zi, zapt, attributeSet);
763 case 5: /* date - normalized */
765 case 6: /* word list */
766 return rpn_search_APT_relevance (zi, zapt, attributeSet);
767 case 100: /* date - un-normalized */
769 case 101: /* name - normalized */
771 case 102: /* date - un-normalized */
773 case 103: /* structure */
777 case 105: /* free-form-text */
778 return rpn_search_APT_relevance (zi, zapt, attributeSet);
779 case 106: /* document-text */
780 return rpn_search_APT_relevance (zi, zapt, attributeSet);
781 case 107: /* local-number */
782 return rpn_search_APT_local (zi, zapt, attributeSet);
783 case 108: /* string */
784 return rpn_search_APT_word (zi, zapt, attributeSet);
785 case 109: /* numeric string */
792 static RSET rpn_search_ref (ZServerInfo *zi, Z_ResultSetId *resultSetId)
796 if (!(s = resultSetGet (zi, resultSetId)))
797 return rset_create (rset_kind_null, NULL);
801 static RSET rpn_search_structure (ZServerInfo *zi, Z_RPNStructure *zs,
802 oid_value attributeSet)
805 if (zs->which == Z_RPNStructure_complex)
807 rset_bool_parms bool_parms;
809 bool_parms.rset_l = rpn_search_structure (zi, zs->u.complex->s1,
811 if (bool_parms.rset_l == NULL)
813 bool_parms.rset_r = rpn_search_structure (zi, zs->u.complex->s2,
815 if (bool_parms.rset_r == NULL)
817 rset_delete (bool_parms.rset_l);
820 bool_parms.key_size = sizeof(struct it_key);
821 bool_parms.cmp = key_compare;
823 switch (zs->u.complex->operator->which)
826 r = rset_create (rset_kind_and, &bool_parms);
829 r = rset_create (rset_kind_or, &bool_parms);
831 case Z_Operator_and_not:
832 r = rset_create (rset_kind_not, &bool_parms);
838 else if (zs->which == Z_RPNStructure_simple)
840 if (zs->u.simple->which == Z_Operand_APT)
842 logf (LOG_DEBUG, "rpn_search_APT");
843 r = rpn_search_APT (zi, zs->u.simple->u.attributesPlusTerm,
846 else if (zs->u.simple->which == Z_Operand_resultSetId)
848 logf (LOG_DEBUG, "rpn_search_ref");
849 r = rpn_search_ref (zi, zs->u.simple->u.resultSetId);
863 static void count_set (RSET r, int *count)
869 logf (LOG_DEBUG, "rpn_save_set");
871 rfd = rset_open (r, 0);
872 while (rset_read (r, rfd, &key))
874 if (key.sysno != psysno)
881 logf (LOG_DEBUG, "%d distinct sysnos", *count);
884 int rpn_search (ZServerInfo *zi,
885 Z_RPNQuery *rpn, int num_bases, char **basenames,
886 const char *setname, int *hits)
890 oid_value attributeSet;
893 zi->errString = NULL;
895 attrset = oid_getentbyoid (rpn->attributeSetId);
896 attributeSet = attrset->value;
898 rset = rpn_search_structure (zi, rpn->RPNStructure, attributeSet);
901 count_set (rset, hits);
902 resultSetAdd (zi, setname, 1, rset);
904 logf (LOG_DEBUG, "search error: %d", zi->errCode);
909 struct scan_entry *list;
916 static int scan_handle (Dict_char *name, const char *info, int pos,
922 struct scan_info *scan_info = client;
924 rset_isam_parms parms;
926 len_prefix = strlen(scan_info->prefix);
927 if (memcmp (name, scan_info->prefix, len_prefix))
930 idx = scan_info->after - pos + scan_info->before;
933 scan_info->list[idx].term = odr_malloc (scan_info->odr,
934 strlen(name + len_prefix)+1);
935 strcpy (scan_info->list[idx].term, name + len_prefix);
936 assert (*info == sizeof(isam_p));
937 memcpy (&isam_p, info+1, sizeof(isam_p));
938 parms.is = scan_info->isam;
941 rset = rset_create (rset_kind_isam, &parms);
942 count_set (rset, &scan_info->list[idx].occurrences);
945 scan_info->list[idx].occurrences = 1;
947 logf (LOG_DEBUG, "pos=%3d idx=%3d name=%s", pos, idx, name);
951 int rpn_scan (ZServerInfo *zi, ODR odr, Z_AttributesPlusTerm *zapt,
952 int *position, int *num_entries, struct scan_entry **list,
957 int num = *num_entries;
960 char termz[IT_MAX_WORD+20];
963 Z_Term *term = zapt->term;
964 struct scan_info scan_info;
966 logf (LOG_DEBUG, "scan, position = %d, num = %d", pos, num);
967 scan_info.before = before = pos-1;
968 scan_info.after = after = 1+num-pos;
971 logf (LOG_DEBUG, "scan, before = %d, after = %d", before, after);
973 scan_info.isam = zi->wordIsam;
974 scan_info.list = odr_malloc (odr, (before+after)*sizeof(*scan_info.list));
975 for (j = 0; j<before+after; j++)
976 scan_info.list[j].term = NULL;
977 attr_init (&use, zapt, 1);
978 use_value = attr_find (&use, NULL);
979 logf (LOG_DEBUG, "use value %d", use_value);
983 i = index_word_prefix (termz, 1, use_value);
984 strcpy (scan_info.prefix, termz);
985 sizez = term->u.general->len;
986 if (sizez > IT_MAX_WORD)
988 for (j = 0; j<sizez; j++)
989 termz[j+i] = index_char_cvt (term->u.general->buf[j]);
992 dict_scan (zi->wordDict, termz, &before, &after, &scan_info, scan_handle);
994 *status = BEND_SCAN_SUCCESS;
996 for (i = 0; i<scan_info.after; i++)
997 if (scan_info.list[scan_info.before+scan_info.after-i-1].term)
1001 *status = BEND_SCAN_PARTIAL;
1003 for (i = 0; i<scan_info.before; i++)
1004 if (scan_info.list[i].term)
1007 *status = BEND_SCAN_PARTIAL;
1011 *list = scan_info.list+i; /* list is set to first 'real' entry */
1013 if (*num_entries == 0) /* signal 'unsupported use-attribute' */
1014 zi->errCode = 114; /* if no entries was found */
1015 logf (LOG_DEBUG, "position = %d, num_entries = %d",
1016 *position, *num_entries);
1018 logf (LOG_DEBUG, "scan error: %d", zi->errCode);