return 1;
}
-static int *f_integer(ExpHandle *eh, data1_node *c)
+static Odr_int *f_integer(ExpHandle *eh, data1_node *c)
{
- int *r;
char intbuf[64];
c = c->child;
- if (!is_data_tag (eh, c) || c->u.data.len > 63)
+ if (!is_data_tag (eh, c) || c->u.data.len >= sizeof(intbuf))
return 0;
- r = (int *)odr_malloc(eh->o, sizeof(*r));
sprintf(intbuf, "%.*s", c->u.data.len, c->u.data.data);
- *r = atoi(intbuf);
- return r;
+ return odr_intdup(eh->o, atoi(intbuf));
}
static char *f_string(ExpHandle *eh, data1_node *c)
(res->num_operators)++;
}
if (res->num_operators)
- res->operators = (int **)
+ res->operators = (Odr_int **)
odr_malloc (eh->o, res->num_operators
* sizeof(*res->operators));
for (n = c->child; n; n = n->next)
return res;
}
-static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
+static Odr_int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
{
- int *r= (int *)odr_malloc(eh->o, sizeof(*r));
int *wp = which;
char intbuf[64];
*wp = Z_DatabaseInfo_approxNumber;
else
return 0;
- if (!c->child || c->child->which != DATA1N_data)
+ if (!c->child || c->child->which != DATA1N_data ||
+ c->child->u.data.len >= sizeof(intbuf))
return 0;
sprintf(intbuf, "%.*s", c->child->u.data.len, c->child->u.data.data);
- *r = atoi(intbuf);
- return r;
+ return odr_intdup(eh->o, atoi(intbuf));
}
static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n)
sk->u.sortAttributes->id = odr_oiddup_nmem(stream, attributeSet);
sk->u.sortAttributes->list = zapt->attributes;
- sks->sortRelation = (int *)
+ sks->sortRelation = (Odr_int *)
nmem_malloc(stream, sizeof(*sks->sortRelation));
if (sort_relation_value == 1)
*sks->sortRelation = Z_SortKeySpec_ascending;
else
*sks->sortRelation = Z_SortKeySpec_ascending;
- sks->caseSensitivity = (int *)
+ sks->caseSensitivity = (Odr_int *)
nmem_malloc(stream, sizeof(*sks->caseSensitivity));
*sks->caseSensitivity = 0;
se->subqueryId = term_ref_id ?
odr_strdup(r->stream, term_ref_id) : 0;
- se->fullQuery = odr_intdup(r->stream, 0);
+ se->fullQuery = odr_booldup(r->stream, 0);
se->subqueryExpression =
odr_malloc(r->stream, sizeof(Z_QueryExpression));
se->subqueryExpression->which =
{
ZebraHandle zh = (ZebraHandle) handle;
- yaz_log(YLOG_LOG, "function: %d", *rr->esr->function);
+ yaz_log(YLOG_LOG, "function: " ODR_INT_PRINTF, *rr->esr->function);
if (rr->esr->packageName)
yaz_log(YLOG_LOG, "packagename: %s", rr->esr->packageName);
- yaz_log(YLOG_LOG, "Waitaction: %d", *rr->esr->waitAction);
+ yaz_log(YLOG_LOG, "Waitaction: " ODR_INT_PRINTF, *rr->esr->waitAction);
if (!rr->esr->taskSpecificParameters)
{
yaz_log(YLOG_LOG, "start");
break;
default:
- yaz_log(YLOG_LOG, " unknown (%d)", *toKeep->action);
+ yaz_log(YLOG_LOG, " unknown (" ODR_INT_PRINTF ")",
+ *toKeep->action);
}
}
if (toKeep->databaseName)