* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
- * Revision 1.75 1998-03-05 08:45:13 adam
+ * Revision 1.78 1998-06-08 14:43:17 adam
+ * Added suport for EXPLAIN Proxy servers - added settings databasePath
+ * and explainDatabase to facilitate this. Increased maximum number
+ * of databases and attributes in one register.
+ *
+ * Revision 1.77 1998/05/20 10:12:22 adam
+ * Implemented automatic EXPLAIN database maintenance.
+ * Modified Zebra to work with ASN.1 compiled version of YAZ.
+ *
+ * Revision 1.76 1998/04/02 14:35:29 adam
+ * First version of Zebra that works with compiled ASN.1.
+ *
+ * Revision 1.75 1998/03/05 08:45:13 adam
* New result set model and modular ranking system. Moved towards
* descent server API. System information stored as "SGML" records.
*
static int attr_find (AttrType *src, oid_value *attributeSetP)
{
- while (src->major < src->zapt->num_attributes)
+ int num_attributes;
+
+#ifdef ASN_COMPILED
+ num_attributes = src->zapt->attributes->num_attributes;
+#else
+ num_attributes = src->zapt->num_attributes;
+#endif
+ while (src->major < num_attributes)
{
Z_AttributeElement *element;
+#ifdef ASN_COMPILED
+ element = src->zapt->attributes->attributes[src->major];
+#else
element = src->zapt->attributeList[src->major];
+#endif
if (src->type == *element->attributeType)
{
switch (element->which)
assert (*info == sizeof(*p->isam_p_buf));
memcpy (p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf));
+#if 0
term_untrans (p->zh, p->reg_type, term_tmp, name+2);
logf (LOG_DEBUG, "grep: %s", term_tmp);
-
+#endif
(p->isam_p_indx)++;
}
local_attr = local_attr->next)
{
int ord;
+ char ord_buf[32];
+ int i, ord_len;
ord = zebraExplain_lookupSU (zh->zei, attp.attset_ordinal,
local_attr->local);
term_dict[prefix_len++] = '|';
else
term_dict[prefix_len++] = '(';
- term_dict[prefix_len++] = 1;
- term_dict[prefix_len++] = ord;
+
+ ord_len = key_SU_code (ord, ord_buf);
+ for (i = 0; i<ord_len; i++)
+ {
+ term_dict[prefix_len++] = 1;
+ term_dict[prefix_len++] = ord_buf[i];
+ }
}
if (!prefix_len)
{
r = rset_create (rset_kind_not, &bool_parms);
break;
case Z_Operator_prox:
+#ifdef ASN_COMPILED
+ if (zop->u.prox->which != Z_ProximityOperator_known)
+ {
+ zh->errCode = 132;
+ return NULL;
+ }
+#else
if (zop->u.prox->which != Z_ProxCode_known)
{
zh->errCode = 132;
return NULL;
}
+#endif
+
+#ifdef ASN_COMPILED
+ if (*zop->u.prox->u.known != Z_ProxUnit_word)
+ {
+ char *val = odr_malloc (stream, 16);
+ zh->errCode = 132;
+ zh->errString = val;
+ sprintf (val, "%d", *zop->u.prox->u.known);
+ return NULL;
+ }
+#else
if (*zop->u.prox->proximityUnitCode != Z_ProxUnit_word)
{
char *val = odr_malloc (stream, 16);
sprintf (val, "%d", *zop->u.prox->proximityUnitCode);
return NULL;
}
+#endif
r = rpn_proximity (zh, bool_parms.rset_l, bool_parms.rset_r,
*zop->u.prox->ordered,
(!zop->u.prox->exclusion ? 0 :
}
static void scan_term_untrans (ZebraHandle zh, ODR stream, int reg_type,
- char **dstp, const char *src)
+ char **dst, const char *src)
{
- char term_dst[1024], **dst;
+ char term_dst[1024];
term_untrans (zh, reg_type, term_dst, src);
sizeof(*scan_info->list));
for (j = 0; j<before+after; j++)
scan_info->list[j].term = NULL;
- termz[prefix_len++] = ords[i];
+
+ prefix_len += key_SU_code (ords[i], termz + prefix_len);
termz[prefix_len++] = reg_id;
termz[prefix_len] = 0;
strcpy (scan_info->prefix, termz);