-/* $Id: extract.c,v 1.199 2005-11-10 11:25:47 adam Exp $
+/* $Id: extract.c,v 1.200 2005-12-09 10:45:04 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
int force_update,
int allow_update)
{
+ SYSNO sysno0 = 0;
RecordAttr *recordAttr;
struct recExtractCtrl extractCtrl;
int r;
yaz_log (YLOG_WARN, "extract error: no such filter");
return ZEBRA_FAIL;
}
- /* match criteria */
- matchStr = NULL;
if (extractCtrl.match_criteria[0])
match_criteria = extractCtrl.match_criteria;
- if (! *sysno) {
- char *rinfo;
+ if (!sysno) {
+
+ sysno = &sysno0;
+
if (match_criteria && *match_criteria) {
matchStr = match_criteria;
} else {
}
}
if (matchStr) {
- rinfo = dict_lookup (zh->reg->matchDict, matchStr);
+ char *rinfo = dict_lookup (zh->reg->matchDict, matchStr);
if (rinfo)
{
assert(*rinfo == sizeof(*sysno));
-/* $Id: zebraapi.c,v 1.195 2005-12-07 17:00:46 adam Exp $
+/* $Id: zebraapi.c,v 1.196 2005-12-09 10:45:04 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
&sysno,
0, /* match */
0, /* fname */
- 0, /* force update */
+ 0, /* force update */
1 /* allow update */
);
if (res == ZEBRA_FAIL)
int zebra_add_record(ZebraHandle zh,
const char *buf, int buf_size)
{
- SYSNO sysno = 0;
- return zebra_update_record(zh, 0, &sysno, 0, 0, buf, buf_size, 0);
+ return zebra_update_record(zh, 0, 0 /* sysno */, 0, 0, buf, buf_size, 0);
}
ZEBRA_RES zebra_insert_record (ZebraHandle zh,
{
ZEBRA_RES res;
ASSERTZH;
- assert(sysno);
assert(buf);
- yaz_log(log_level, "zebra_update_record sysno=" ZINT_FORMAT, *sysno);
+ yaz_log(log_level, "zebra_update_record sysno=" ZINT_FORMAT,
+ sysno ? *sysno : "none");
if (buf_size < 1) buf_size = strlen(buf);
-/* $Id: zserver.c,v 1.142 2005-12-07 17:00:46 adam Exp $
+/* $Id: zserver.c,v 1.143 2005-12-09 10:45:05 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
Z_External *rec = notToKeep->elements[i]->record;
struct oident *oident = 0;
Odr_oct *opaque_recid = 0;
- SYSNO sysno = 0;
+ SYSNO *sysno = 0;
+ SYSNO sysno_tmp;
if (notToKeep->elements[i]->u.opaque)
{
opaque_recid = notToKeep->elements[i]->u.opaque;
break; /* OK, recid already set */
case Z_IUSuppliedRecords_elem_number:
- sysno = *notToKeep->elements[i]->u.number;
+ sysno_tmp = *notToKeep->elements[i]->u.number;
+ sysno = &sysno_tmp;
break;
}
}
r = zebra_insert_record(
zh,
0, /* recordType */
- &sysno,
+ sysno,
0, /* match */
0, /* fname */
(const char *) rec->u.octet_aligned->buf,
r = zebra_update_record(
zh,
0, /* recordType */
- &sysno,
+ sysno,
0, /* match */
0, /* fname */
(const char *) rec->u.octet_aligned->buf,
r = zebra_delete_record(
zh,
0, /* recordType */
- &sysno,
+ sysno,
0, /* match */
0, /* fname */
(const char *) rec->u.octet_aligned->buf,