static int largeSetLowerBound = 1;
static int mediumSetPresentNumber = 0;
static Z_ElementSetNames *elementSetNames = 0;
-static int setno = 1; /* current set offset */
+static odr_int_t setno = 1; /* current set offset */
static enum oid_proto protocol = PROTO_Z3950; /* current app protocol */
#define RECORDSYNTAX_MAX 20
static char *recordsyntax_list[RECORDSYNTAX_MAX];
case Z_DiagnosticFormat_s_defaultDiagRec: {
Z_DefaultDiagFormat *dd = ds->u.defaultDiagRec;
/* ### should check `dd->diagnosticSetId' */
- printf("code=%d (%s)", *dd->condition,
+ printf("code=" ODR_INT_PRINTF " (%s)", *dd->condition,
diagbib1_str(*dd->condition));
/* Both types of addinfo are the same, so use type-pun */
if (dd->u.v2Addinfo != 0)
if (oid_oidcmp(r->diagnosticSetId, yaz_oid_diagset_bib_1))
printf("Unknown diagset: %s\n", diag_name);
}
- printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition));
+ printf(" [" ODR_INT_PRINTF "] %s",
+ *r->condition, diagbib1_str(*r->condition));
switch (r->which)
{
case Z_DefaultDiagFormat_v2Addinfo:
names[0], names[1], names[2], names[3],
names[4], names[5], names[6], names[7]);
- req->deleteFunction = (int *)
- odr_malloc(out, sizeof(*req->deleteFunction));
+ req->deleteFunction = odr_intdup(out, 0);
if (req->num_resultSetList > 0)
{
*req->deleteFunction = Z_DeleteResultSetRequest_list;
printf("%s", term->u.characterString);
break;
case Z_Term_numeric:
- printf("%d", *term->u.numeric);
+ printf(ODR_INT_PRINTF, *term->u.numeric);
break;
case Z_Term_null:
printf("null");
display_queryExpression("recommendation",
sr->elements[j]->subqueryRecommendation);
if (sr->elements[j]->subqueryCount)
- printf(" cnt=%d", *sr->elements[j]->subqueryCount);
+ printf(" cnt=" ODR_INT_PRINTF,
+ *sr->elements[j]->subqueryCount);
if (sr->elements[j]->subqueryId)
printf(" id=%s ", sr->elements[j]->subqueryId);
}
printf("Search was a success.\n");
else
printf("Search was a bloomin' failure.\n");
- printf("Number of hits: %d", *res->resultCount);
+ printf("Number of hits: " ODR_INT_PRINTF, *res->resultCount);
last_hit_count = *res->resultCount;
if (setnumber >= 0)
printf(", setno %d", setnumber);
case Z_SearchResponse_estimate:
printf("estimate"); break;
default:
- printf("%d", *res->resultSetStatus);
+ printf(ODR_INT_PRINTF, *res->resultSetStatus);
}
putchar('\n');
}
display_searchResult(res->additionalSearchInfo);
- printf("records returned: %d\n",
+ printf("records returned: " ODR_INT_PRINTF "\n",
*res->numberOfRecordsReturned);
setno += *res->numberOfRecordsReturned;
if (res->records)
printf(" ");
}
-static void print_int(int iLevel, const char *pTag, int *pInt)
+static void print_int(int iLevel, const char *pTag, odr_int_t *pInt)
{
if (pInt != NULL)
{
print_level(iLevel);
- printf("%s: %d\n", pTag, *pInt);
+ printf("%s: " ODR_INT_PRINTF "\n", pTag, *pInt);
}
}
r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->resultSetId = "1";
r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item =
- (int *) odr_malloc(out, sizeof(int));
- *r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item = itemno;
-
+ odr_intdup(out, itemno);
if (!strcmp (type, "item") || !strcmp(type, "2"))
{
printf("using item-request\n");
}
toKeep->elementSetName = 0;
- toKeep->action = (int *) odr_malloc(out, sizeof(*toKeep->action));
- *toKeep->action = action_no;
+ toKeep->action = odr_intdup(out, action_no);
notToKeep = r->u.update0->u.esRequest->notToKeep = (Z_IU0SuppliedRecords *)
odr_malloc(out, sizeof(*r->u.update0->u.esRequest->notToKeep));
}
toKeep->elementSetName = 0;
toKeep->actionQualifier = 0;
- toKeep->action = (int *) odr_malloc(out, sizeof(*toKeep->action));
- *toKeep->action = action_no;
+ toKeep->action = odr_intdup(out, action_no);
notToKeep = r->u.update->u.esRequest->notToKeep = (Z_IUSuppliedRecords *)
odr_malloc(out, sizeof(*r->u.update->u.esRequest->notToKeep));
/* PRESENT SERVICE ----------------------------- */
static void parse_show_args(const char *arg_c, char *setstring,
- int *start, int *number)
+ odr_int_t *start, odr_int_t *number)
{
char arg[40];
char *p;
Z_APDU *apdu = zget_APDU(out, Z_APDU_presentRequest);
Z_PresentRequest *req = apdu->u.presentRequest;
Z_RecordComposition compo;
- int nos = 1;
+ odr_int_t nos = 1;
char setstring[100];
req->referenceId = set_refid(out);
compo.u.simple = elementSetNames;
}
send_apdu(apdu);
- printf("Sent presentRequest (%d+%d).\n", setno, nos);
+ printf("Sent presentRequest (" ODR_INT_PRINTF "+" ODR_INT_PRINTF ").\n",
+ setno, nos);
return 2;
}
static int send_SRW_presentRequest(const char *arg)
{
char setstring[100];
- int nos = 1;
+ odr_int_t nos = 1;
Z_SRW_PDU *sr = srw_sr;
if (!sr)
}
int send_scanrequest(const char *set, const char *query,
- int pp, int num, const char *term)
+ odr_int_t pp, odr_int_t num, const char *term)
{
Z_APDU *apdu = zget_APDU(out, Z_APDU_scanRequest);
Z_ScanRequest *req = apdu->u.scanRequest;
t->term->u.general->buf);
if (t->globalOccurrences)
- printf(" (%d)\n", *t->globalOccurrences);
+ printf(" (" ODR_INT_PRINTF ")\n", *t->globalOccurrences);
else
printf("\n");
}
printf("Received ScanResponse\n");
print_refid(res->referenceId);
- printf("%d entries", *res->numberOfEntriesReturned);
+ printf(ODR_INT_PRINTF " entries", *res->numberOfEntriesReturned);
if (res->positionOfTerm)
- printf(", position=%d", *res->positionOfTerm);
+ printf(", position=" ODR_INT_PRINTF, *res->positionOfTerm);
printf("\n");
if (*res->scanStatus != Z_Scan_success)
- printf("Scan returned code %d\n", *res->scanStatus);
+ printf("Scan returned code " ODR_INT_PRINTF "\n", *res->scanStatus);
if (!res->entries)
return;
if ((entries = res->entries->entries))
case Z_SortResponse_failure:
printf("failure"); break;
default:
- printf("unknown (%d)", *res->sortStatus);
+ printf("unknown (" ODR_INT_PRINTF ")", *res->sortStatus);
}
printf("\n");
print_refid (res->referenceId);
void process_deleteResultSetResponse(Z_DeleteResultSetResponse *res)
{
- printf("Got deleteResultSetResponse status=%d\n",
+ printf("Got deleteResultSetResponse status=" ODR_INT_PRINTF "\n",
*res->deleteOperationStatus);
if (res->deleteListStatuses)
{
int i;
for (i = 0; i < res->deleteListStatuses->num; i++)
{
- printf("%s status=%d\n", res->deleteListStatuses->elements[i]->id,
- *res->deleteListStatuses->elements[i]->status);
+ printf("%s status=" ODR_INT_PRINTF "\n",
+ res->deleteListStatuses->elements[i]->id,
+ *res->deleteListStatuses->elements[i]->status);
}
}
}
{
if (rec->recordPosition)
{
- printf("pos=%d", *rec->recordPosition);
+ printf("pos=" ODR_INT_PRINTF, *rec->recordPosition);
setno = *rec->recordPosition + 1;
}
if (rec->recordSchema)
printf("Details: %s\n", res->diagnostics[i].details);
}
if (res->numberOfRecords)
- printf("Number of hits: %d\n", *res->numberOfRecords);
+ printf("Number of hits: " ODR_INT_PRINTF "\n", *res->numberOfRecords);
for (i = 0; i<res->num_records; i++)
handle_srw_record(res->records + i);
}
else
printf("No value:");
if (term->numberOfRecords)
- printf(" %d", *term->numberOfRecords);
+ printf(" " ODR_INT_PRINTF, *term->numberOfRecords);
if (term->whereInList)
printf(" %s", term->whereInList);
if (term->value && term->displayTerm)
display_records(apdu->u.presentResponse->records);
else
printf("No records.\n");
- printf("nextResultSetPosition = %d\n",
+ printf("nextResultSetPosition = " ODR_INT_PRINTF "\n",
*apdu->u.presentResponse->nextResultSetPosition);
break;
case Z_APDU_sortResponse:
bend_request request;
bend_association association;
int *fd;
- int hits; /* number of hits */
+ odr_int_t hits; /* number of hits */
int errcode; /* 0==OK */
char *errstring; /* system error string or NULL */
Z_OtherInformation *search_info; /* additional search info */
/** \brief Information for scan entry */
struct scan_entry {
char *term; /* the returned scan term */
- int occurrences; /* no of occurrences or -1 if error (see below) */
+ odr_int_t occurrences;/* no of occurrences or -1 if error (see below) */
int errcode; /* Bib-1 diagnostic code; only used when occur.= -1 */
char *errstring; /* Additional string */
char *display_term;
ODR stream; /* encoding stream - memory source if required */
ODR print; /* printing stream */
- int *step_size; /* step size */
- int term_position; /* desired index of term in result list/returned */
+ odr_int_t *step_size; /* step size */
+ odr_int_t term_position; /* desired index of term in result list/returned */
int num_entries; /* number of entries requested/returned */
/* scan term entries. The called handler does not have
char **setnames;
Z_ReferenceId *referenceId;
int delete_status; /* status for the whole operation */
- int *statuses; /* status each set - indexed as setnames */
+ odr_int_t *statuses; /* status each set - indexed as setnames */
ODR stream;
ODR print;
} bend_delete_rr;
*/
YAZ_EXPORT int *nmem_intdup(NMEM nmem, int v);
+YAZ_EXPORT long long int *nmem_longintdup(NMEM nmem, long long int v);
+
/** \brief transfers memory from one NMEM handle to another
\param src source NMEM handle
\param dst destination NMEM handle
YAZ_BEGIN_CDECL
+#define ODR_INT_PRINTF "%lld"
+
+typedef long long int odr_int_t;
+typedef int odr_bool_t;
+
#ifndef bool_t
#define bool_t int
#endif
YAZ_EXPORT char *odr_strdup(ODR o, const char *str);
YAZ_EXPORT char *odr_strdupn(ODR o, const char *str, size_t n);
YAZ_EXPORT char *odr_strdup_null(ODR o, const char *str);
-YAZ_EXPORT int *odr_intdup(ODR o, int v);
+YAZ_EXPORT odr_int_t *odr_intdup(ODR o, odr_int_t v);
+YAZ_EXPORT odr_bool_t *odr_booldup(ODR o, odr_bool_t v);
YAZ_EXPORT Odr_oct *odr_create_Odr_oct(ODR o, const unsigned char *buf,
int sz);
YAZ_EXPORT NMEM odr_extract_mem(ODR o);
YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass,
int *tag, int *constructed, int max);
YAZ_EXPORT int odr_bool(ODR o, int **p, int opt, const char *name);
-YAZ_EXPORT int odr_integer(ODR o, int **p, int opt, const char *name);
-YAZ_EXPORT int odr_enum(ODR o, int **p, int opt, const char *name);
+YAZ_EXPORT int odr_integer(ODR o, odr_int_t **p, int opt, const char *name);
+YAZ_EXPORT int odr_enum(ODR o, odr_int_t **p, int opt, const char *name);
YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag);
YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact);
YAZ_EXPORT int ber_declen(const unsigned char *buf, int *len, int max);
YAZ_EXPORT void odr_prname(ODR o, const char *name);
YAZ_EXPORT int ber_null(ODR o);
YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt, const char *name);
-YAZ_EXPORT int ber_integer(ODR o, int *val);
+YAZ_EXPORT int ber_integer(ODR o, odr_int_t *val);
YAZ_EXPORT int odr_constructed_begin(ODR o, void *p, int zclass, int tag,
const char *name);
YAZ_EXPORT int odr_constructed_end(ODR o);
typedef struct Odr_external
{
Odr_oid *direct_reference; /* OPTIONAL */
- int *indirect_reference; /* OPTIONAL */
+ odr_int_t *indirect_reference; /* OPTIONAL */
char *descriptor; /* OPTIONAL */
int which;
#define ODR_EXTERNAL_single 0
struct Z_External
{
Odr_oid *direct_reference;
- int *indirect_reference;
+ odr_int_t *indirect_reference;
char *descriptor;
int which;
/* Generic types */
#define Z_SRW_recordPacking_URL 2
char *recordData_buf;
int recordData_len;
- int *recordPosition;
+ odr_int_t *recordPosition;
} Z_SRW_record;
typedef struct {
char *sortKeys;
char *xSortKeys;
} sort;
- int *startRecord;
- int *maximumRecords;
+ odr_int_t *startRecord;
+ odr_int_t *maximumRecords;
char *recordSchema;
char *recordPacking;
char *recordXPath;
char *database;
char *stylesheet;
- int *resultSetTTL;
+ odr_int_t *resultSetTTL;
} Z_SRW_searchRetrieveRequest;
typedef struct {
- int * numberOfRecords;
+ odr_int_t *numberOfRecords;
char * resultSetId;
- int * resultSetIdleTime;
+ odr_int_t *resultSetIdleTime;
Z_SRW_record *records;
int num_records;
Z_SRW_diagnostic *diagnostics;
int num_diagnostics;
- int *nextRecordPosition;
+ odr_int_t *nextRecordPosition;
Z_SRW_extra_record **extra_records; /* of size num_records */
} Z_SRW_searchRetrieveResponse;
char *xcql;
char *pqf;
} scanClause;
- int *responsePosition;
- int *maximumTerms;
+ odr_int_t *responsePosition;
+ odr_int_t *maximumTerms;
char *stylesheet;
char *database;
} Z_SRW_scanRequest;
typedef struct {
char *value;
- int *numberOfRecords;
+ odr_int_t *numberOfRecords;
char *displayTerm;
char *whereInList;
} Z_SRW_scanTerm;
YAZ_EXPORT char *yaz_uri_val(const char *path, const char *name, ODR o);
YAZ_EXPORT void yaz_uri_val_int(const char *path, const char *name,
- ODR o, int **intp);
+ ODR o, odr_int_t **intp);
YAZ_EXPORT int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
Z_SOAP **soap_package, ODR decode, char **charset);
YAZ_EXPORT int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
#include "odr-priv.h"
-static int ber_encinteger(ODR o, int val);
-static int ber_decinteger(const unsigned char *buf, int *val, int max);
+static int ber_encinteger(ODR o, odr_int_t val);
+static int ber_decinteger(const unsigned char *buf, odr_int_t *val, int max);
-int ber_integer(ODR o, int *val)
+int ber_integer(ODR o, odr_int_t *val)
{
int res;
/*
* Returns: number of bytes written or -1 for error (out of bounds).
*/
-int ber_encinteger(ODR o, int val)
+int ber_encinteger(ODR o, odr_int_t val)
{
int a, len;
union { int i; unsigned char c[sizeof(int)]; } tmp;
/*
* Returns: Number of bytes read or 0 if no match, -1 if error.
*/
-int ber_decinteger(const unsigned char *buf, int *val, int max)
+int ber_decinteger(const unsigned char *buf, odr_int_t *val, int max)
{
const unsigned char *b = buf;
unsigned char fill;
wrbuf_puts(type_str, yaz_tok_parse_string(tp));
t = yaz_tok_move(tp);
}
- elem->attributeType = nmem_intdup(ct->nmem, 0);
- if (sscanf(wrbuf_cstr(type_str), "%d", elem->attributeType)
+ elem->attributeType = nmem_longintdup(ct->nmem, 0);
+ if (sscanf(wrbuf_cstr(type_str), ODR_INT_PRINTF, elem->attributeType)
!= 1)
{
wrbuf_destroy(type_str);
{
elem->which = Z_AttributeValue_numeric;
elem->value.numeric =
- nmem_intdup(ct->nmem, atoi(value_str));
+ nmem_longintdup(ct->nmem, atoi(value_str));
}
else
{
for (i = 0; i < v->num_triples; i++)
{
- printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->zclass,
- *v->triples[i]->type);
+ printf("%*sclass=" ODR_INT_PRINTF ",type=" ODR_INT_PRINTF,
+ level * 4, "", *v->triples[i]->zclass,
+ *v->triples[i]->type);
if (v->triples[i]->which == Z_Triple_internationalString)
printf(",value=%s\n", v->triples[i]->value.internationalString);
else
t = r->elements[i];
wrbuf_printf(w, "(");
if (t->tagType)
- wrbuf_printf(w, "%d,", *t->tagType);
+ wrbuf_printf(w, ODR_INT_PRINTF, *t->tagType);
else
wrbuf_printf(w, "?,");
if (t->tagValue->which == Z_StringOrNumeric_numeric)
- wrbuf_printf(w, "%d) ", *t->tagValue->u.numeric);
+ wrbuf_printf(w, ODR_INT_PRINTF ") ", *t->tagValue->u.numeric);
else
wrbuf_printf(w, "%s) ", t->tagValue->u.string);
if (t->content->which == Z_ElementData_subtree)
}
else if (t->content->which == Z_ElementData_numeric)
{
- wrbuf_printf(w, "%d\n", *t->content->u.numeric);
+ wrbuf_printf(w, ODR_INT_PRINTF "\n", *t->content->u.numeric);
}
else if (t->content->which == Z_ElementData_oid)
{
return r;
}
-int *ill_get_int (struct ill_get_ctl *gc, const char *name,
- const char *sub, int val)
+odr_int_t *ill_get_int(struct ill_get_ctl *gc, const char *name,
+ const char *sub, odr_int_t val)
{
ODR o = gc->odr;
char element[128];
return odr_intdup(o, val);
}
-int *ill_get_enumerated (struct ill_get_ctl *gc, const char *name,
- const char *sub, int val)
+odr_int_t *ill_get_enumerated (struct ill_get_ctl *gc, const char *name,
+ const char *sub, odr_int_t val)
{
return ill_get_int(gc, name, sub, val);
}
yaz_log (loglevel, "%*.0s%s %s", depth, "", attset_name, str);
break;
case Z_AttributeValue_complex:
- yaz_log (loglevel, "%*.0s%s attributeType=%d complex",
+ yaz_log (loglevel, "%*.0s%s attributeType=" ODR_INT_PRINTF
+ " complex",
depth, "", attset_name, *element->attributeType);
for (i = 0; i<element->value.complex->num_list; i++)
{
element->value.complex->list[i]->u.string);
else if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_numeric)
- yaz_log (loglevel, "%*.0s numeric: '%d'", depth, "",
+ yaz_log (loglevel, "%*.0s numeric: '" ODR_INT_PRINTF
+ " '", depth, "",
*element->value.complex->list[i]->u.numeric);
}
break;
yaz_log (loglevel, "%*.0s %s", depth, "", complex_op_name(op) );
break;
case Z_Operator_prox:
- yaz_log (loglevel, "%*.0s prox excl=%s dist=%d order=%s "
+ yaz_log (loglevel, "%*.0s prox excl=%s dist=" ODR_INT_PRINTF
+ " order=%s "
"rel=%s unit=%s",
depth, "", op->u.prox->exclusion ?
(*op->u.prox->exclusion ? "T" : "F") : "N",
zapt->term->u.characterString);
break;
case Z_Term_numeric:
- yaz_log (loglevel, "%*.0s term '%d' (numeric)", depth, "",
+ yaz_log (loglevel, "%*.0s term '" ODR_INT_PRINTF
+ "' (numeric)", depth, "",
*zapt->term->u.numeric);
break;
case Z_Term_null:
return dst;
}
+long long int *nmem_longintdup(NMEM mem, long long int v)
+{
+ long long int *dst = (long long int*) nmem_malloc (mem, sizeof(*dst));
+ *dst = v;
+ return dst;
+}
+
int *nmem_intdup(NMEM mem, int v)
{
- int *dst = (int*) nmem_malloc (mem, sizeof(int));
+ int *dst = (int*) nmem_malloc (mem, sizeof(*dst));
*dst = v;
return dst;
}
* Top level enum en/decoder.
* Returns 1 on success, 0 on error.
*/
-int odr_enum(ODR o, int **p, int opt, const char *name)
+int odr_enum(ODR o, odr_int_t **p, int opt, const char *name)
{
int res, cons = 0;
return 0;
}
if (o->direction == ODR_DECODE)
- *p = (int *)odr_malloc(o, sizeof(int));
+ *p = (odr_int_t *)odr_malloc(o, sizeof(**p));
return ber_integer(o, *p);
}
/*
* Top level integer en/decoder.
* Returns 1 on success, 0 on error.
*/
-int odr_integer(ODR o, int **p, int opt, const char *name)
+int odr_integer(ODR o, odr_int_t **p, int opt, const char *name)
{
int res, cons = 0;
return 0;
}
if (o->direction == ODR_DECODE)
- *p = (int *)odr_malloc(o, sizeof(int));
+ *p = (odr_int_t *)odr_malloc(o, sizeof(**p));
return ber_integer(o, *p);
}
/*
return nmem_strdupn(o->mem, str, n);
}
-int *odr_intdup(ODR o, int v)
+odr_int_t *odr_intdup(ODR o, odr_int_t v)
+{
+ return nmem_longintdup(o->mem, v);
+}
+
+odr_bool_t *odr_booldup(ODR o, odr_bool_t v)
{
return nmem_intdup(o->mem, v);
}
static Z_RPNStructure *rpn_structure(struct yaz_pqf_parser *li, ODR o,
int num_attr, int max_attr,
- int *attr_list, char **attr_clist,
+ odr_int_t *attr_list, char **attr_clist,
Odr_oid **attr_set);
static Odr_oid *query_oid_getvalbyname(struct yaz_pqf_parser *li, ODR o)
}
static int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o,
- int num_attr, int *attr_list,
+ int num_attr, odr_int_t *attr_list,
char **attr_clist, Odr_oid **attr_set)
{
const char *cp;
}
static Z_AttributesPlusTerm *rpn_term(struct yaz_pqf_parser *li, ODR o,
- int num_attr, int *attr_list,
+ int num_attr, odr_int_t *attr_list,
char **attr_clist, Odr_oid **attr_set)
{
Z_AttributesPlusTerm *zapt;
else
{
int i, k = 0;
- int *attr_tmp;
+ odr_int_t *attr_tmp;
elements = (Z_AttributeElement**)
odr_malloc (o, num_attr * sizeof(*elements));
- attr_tmp = (int *)odr_malloc (o, num_attr * 2 * sizeof(int));
- memcpy (attr_tmp, attr_list, num_attr * 2 * sizeof(int));
+ attr_tmp = (odr_int_t *)odr_malloc(o, num_attr * 2 * sizeof(*attr_tmp));
+ memcpy(attr_tmp, attr_list, num_attr * 2 * sizeof(*attr_tmp));
for (i = num_attr; --i >= 0; )
{
int j;
}
static Z_Operand *rpn_simple(struct yaz_pqf_parser *li, ODR o,
- int num_attr, int *attr_list, char **attr_clist,
+ int num_attr, odr_int_t *attr_list,
+ char **attr_clist,
Odr_oid **attr_set)
{
Z_Operand *zo;
return NULL;
}
if (*li->lex_buf == '1')
- p->exclusion = odr_intdup (o, 1);
+ p->exclusion = odr_booldup(o, 1);
else if (*li->lex_buf == '0')
- p->exclusion = odr_intdup (o, 0);
+ p->exclusion = odr_booldup(o, 0);
else if (*li->lex_buf == 'v' || *li->lex_buf == 'n')
p->exclusion = NULL;
else
return NULL;
}
if (*li->lex_buf == '1')
- p->ordered = odr_intdup (o, 1);
+ p->ordered = odr_booldup(o, 1);
else if (*li->lex_buf == '0')
- p->ordered = odr_intdup (o, 0);
+ p->ordered = odr_booldup(o, 0);
else
{
li->error = YAZ_PQF_ERROR_PROXIMITY;
static Z_Complex *rpn_complex(struct yaz_pqf_parser *li, ODR o,
int num_attr, int max_attr,
- int *attr_list, char **attr_clist,
+ odr_int_t *attr_list, char **attr_clist,
Odr_oid **attr_set)
{
Z_Complex *zc;
static Z_RPNStructure *rpn_structure(struct yaz_pqf_parser *li, ODR o,
int num_attr, int max_attr,
- int *attr_list,
+ odr_int_t *attr_list,
char **attr_clist,
Odr_oid **attr_set)
{
Z_RPNQuery *p_query_rpn_mk(ODR o, struct yaz_pqf_parser *li, const char *qbuf)
{
Z_RPNQuery *zq;
- int attr_array[1024];
+ odr_int_t attr_array[1024];
char *attr_clist[512];
Odr_oid *attr_set[512];
Odr_oid *top_set = 0;
Odr_oid **attributeSetP,
const char *qbuf)
{
- int attr_list[1024];
+ odr_int_t attr_list[1024];
char *attr_clist[512];
Odr_oid *attr_set[512];
int num_attr = 0;
switch (element->which)
{
case Z_AttributeValue_numeric:
- wrbuf_printf(b,"@attr %s%s%d=%d ", setname, sep,
+ wrbuf_printf(b,"@attr %s%s" ODR_INT_PRINTF "=" ODR_INT_PRINTF " ",
+ setname, sep,
*element->attributeType, *element->value.numeric);
break;
case Z_AttributeValue_complex:
- wrbuf_printf(b,"@attr %s%s\"%d=", setname, sep,
+ wrbuf_printf(b,"@attr %s%s\""ODR_INT_PRINTF "=", setname, sep,
*element->attributeType);
for (i = 0; i<element->value.complex->num_list; i++)
{
element->value.complex->list[i]->u.string);
else if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_numeric)
- wrbuf_printf (b, "%d",
+ wrbuf_printf (b, ODR_INT_PRINTF,
*element->value.complex->list[i]->u.numeric);
}
wrbuf_printf(b, "\" ");
strlen(zapt->term->u.characterString));
break;
case Z_Term_numeric:
- wrbuf_printf(b, "@term numeric %d ", *zapt->term->u.numeric);
+ wrbuf_printf(b, "@term numeric " ODR_INT_PRINTF " ",
+ *zapt->term->u.numeric);
break;
case Z_Term_null:
wrbuf_printf(b, "@term null x");
else
wrbuf_putc(b, '0');
- wrbuf_printf(b, " %d %d %d ", *op->u.prox->distance,
+ wrbuf_printf(b, " " ODR_INT_PRINTF " %d "
+ ODR_INT_PRINTF " ", *op->u.prox->distance,
*op->u.prox->ordered,
*op->u.prox->relationType);
wrbuf_printf(b, "%d", op->u.prox->which);
}
if (op->u.prox->u.known)
- wrbuf_printf(b, " %d ", *op->u.prox->u.known);
+ wrbuf_printf(b, " " ODR_INT_PRINTF " ", *op->u.prox->u.known);
else
wrbuf_printf(b, " 0 ");
}
{
Z_DefaultDiagFormat *e=diags[0]->u.defaultFormat;
if (e->condition)
- wrbuf_printf(b, "%d ",*e->condition);
+ wrbuf_printf(b, ODR_INT_PRINTF " ",*e->condition);
else
wrbuf_printf(b, "?? ");
if ((e->which==Z_DefaultDiagFormat_v2Addinfo) && (e->u.v2Addinfo))
sterm = (const char *) term->u.general->buf;
break;
case Z_Term_numeric:
- wrbuf_printf(w, "%d", *term->u.numeric);
+ wrbuf_printf(w, ODR_INT_PRINTF, *term->u.numeric);
break;
case Z_Term_characterString:
sterm = term->u.characterString;
int number = srw_req->maximumRecords ? *srw_req->maximumRecords : 0;
int start = srw_req->startRecord ? *srw_req->startRecord : 1;
- yaz_log(log_requestdetail, "Request to pack %d+%d out of %d",
+ yaz_log(log_requestdetail, "Request to pack %d+%d out of "
+ ODR_INT_PRINTF,
start, number, rr.hits);
srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits);
wrbuf_printf(wr, "ERROR info:http/%d", *http_code);
else if (srw_res->numberOfRecords)
{
- wrbuf_printf(wr, "OK %d",
+ wrbuf_printf(wr, "OK " ODR_INT_PRINTF,
(srw_res->numberOfRecords ?
*srw_res->numberOfRecords : 0));
}
- wrbuf_printf(wr, " %s %d+%d",
+ wrbuf_printf(wr, " %s " ODR_INT_PRINTF " +%d",
(srw_res->resultSetId ?
srw_res->resultSetId : "-"),
(srw_req->startRecord ? *srw_req->startRecord : 1),
else
wrbuf_printf(wr, "OK - - ");
- wrbuf_printf(wr, "%d+%d+0 ",
+ wrbuf_printf(wr, ODR_INT_PRINTF "+" ODR_INT_PRINTF " ",
(srw_req->responsePosition ?
*srw_req->responsePosition : 1),
(srw_req->maximumTerms ?
return zget_surrogateDiagRec(assoc->encode, dbname, error, addinfo);
}
-static Z_Records *pack_records(association *a, char *setname, int start,
- int *num, Z_RecordComposition *comp,
- int *next, int *pres,
+static Z_Records *pack_records(association *a, char *setname, odr_int_t start,
+ odr_int_t *num, Z_RecordComposition *comp,
+ odr_int_t *next, odr_int_t *pres,
Z_ReferenceId *referenceId,
Odr_oid *oid, int *errcode)
{
*num = 0;
*next = 0;
- yaz_log(log_requestdetail, "Request to pack %d+%d %s", start, toget, setname);
- yaz_log(log_requestdetail, "pms=%d, mrs=%d", a->preferredMessageSize,
+ yaz_log(log_requestdetail, "Request to pack " ODR_INT_PRINTF "+%d %s", start, toget, setname);
+ yaz_log(log_requestdetail, "pms=" ODR_INT_PRINTF
+ ", mrs=" ODR_INT_PRINTF, a->preferredMessageSize,
a->maximumRecordSize);
for (recno = start; reclist->num_records < toget; recno++)
{
}
else /* too big entirely */
{
- yaz_log(log_requestdetail, "Record > maxrcdsz this=%d max=%d",
+ yaz_log(log_requestdetail, "Record > maxrcdsz "
+ "this=%d max=" ODR_INT_PRINTF,
this_length, a->maximumRecordSize);
reclist->records[reclist->num_records] =
surrogatediagrec(a, freq.basename, 17, 0);
Z_APDU *apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu));
Z_SearchResponse *resp = (Z_SearchResponse *)
odr_malloc(assoc->encode, sizeof(*resp));
- int *nulint = odr_intdup(assoc->encode, 0);
- int *next = odr_intdup(assoc->encode, 0);
- int *none = odr_intdup(assoc->encode, Z_SearchResponse_none);
+ odr_int_t *nulint = odr_intdup(assoc->encode, 0);
+ odr_int_t *next = odr_intdup(assoc->encode, 0);
+ odr_int_t *none = odr_intdup(assoc->encode, Z_SearchResponse_none);
int returnedrecs = 0;
apdu->which = Z_APDU_searchResponse;
resp->resultCount = nulint;
resp->numberOfRecordsReturned = nulint;
resp->nextResultSetPosition = nulint;
- resp->searchStatus = nulint;
+ resp->searchStatus = odr_booldup(assoc->encode, 0);
resp->resultSetStatus = none;
resp->presentStatus = 0;
}
else
{
- bool_t *sr = odr_intdup(assoc->encode, 1);
- int *toget = odr_intdup(assoc->encode, 0);
+ bool_t *sr = odr_booldup(assoc->encode, 1);
+ odr_int_t *toget = odr_intdup(assoc->encode, 0);
Z_RecordComposition comp, *compp = 0;
- yaz_log(log_requestdetail, "resultCount: %d", bsrt->hits);
+ yaz_log(log_requestdetail, "resultCount: " ODR_INT_PRINTF, bsrt->hits);
resp->records = 0;
resp->resultCount = &bsrt->hits;
if (*toget && !resp->records)
{
- int *presst = odr_intdup(assoc->encode, 0);
+ odr_int_t *presst = odr_intdup(assoc->encode, 0);
/* Call bend_present if defined */
if (assoc->init->bend_present)
{
if (bsrt->errcode)
wrbuf_printf(wr, "ERROR %d", bsrt->errcode);
else
- wrbuf_printf(wr, "OK %d", bsrt->hits);
+ wrbuf_printf(wr, "OK " ODR_INT_PRINTF, bsrt->hits);
wrbuf_printf(wr, " %s 1+%d ",
req->resultSetName, returnedrecs);
yaz_query_to_wrbuf(wr, req->query);
Z_PresentRequest *req = reqb->apdu_request->u.presentRequest;
Z_APDU *apdu;
Z_PresentResponse *resp;
- int *next;
- int *num;
+ odr_int_t *next;
+ odr_int_t *num;
int errcode = 0;
const char *errstring = 0;
else if (*resp->presentStatus == Z_PresentStatus_success)
wrbuf_printf(wr, "OK - ");
else
- wrbuf_printf(wr, "Partial %d - ", *resp->presentStatus);
+ wrbuf_printf(wr, "Partial " ODR_INT_PRINTF " - ",
+ *resp->presentStatus);
- wrbuf_printf(wr, " %s %d+%d ",
+ wrbuf_printf(wr, " %s " ODR_INT_PRINTF "+" ODR_INT_PRINTF " ",
req->resultSetId, *req->resultSetStartPoint,
*req->numberOfRecordsRequested);
yaz_log(log_request, "%s", wrbuf_cstr(wr) );
Z_APDU *apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu));
Z_ScanResponse *res = (Z_ScanResponse *)
odr_malloc(assoc->encode, sizeof(*res));
- int *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure);
- int *numberOfEntriesReturned = odr_intdup(assoc->encode, 0);
+ odr_int_t *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure);
+ odr_int_t *numberOfEntriesReturned = odr_intdup(assoc->encode, 0);
Z_ListEntries *ents = (Z_ListEntries *)
odr_malloc(assoc->encode, sizeof(*ents));
Z_DiagRecs *diagrecs_p = NULL;
*scanStatus = Z_Scan_success;
ents->entries = tab;
ents->num_entries = bsrr->num_entries;
- res->numberOfEntriesReturned = &ents->num_entries;
+ res->numberOfEntriesReturned = odr_intdup(assoc->encode,
+ ents->num_entries);
res->positionOfTerm = &bsrr->term_position;
for (i = 0; i < bsrr->num_entries; i++)
{
odr_malloc(assoc->encode, o->len = o->size =
strlen(bsrr->entries[i].term));
memcpy(o->buf, bsrr->entries[i].term, o->len);
- yaz_log(YLOG_DEBUG, " term #%d: '%s' (%d)", i,
+ yaz_log(YLOG_DEBUG, " term #%d: '%s' (" ODR_INT_PRINTF ")", i,
bsrr->entries[i].term, bsrr->entries[i].occurrences);
}
else
else
wrbuf_printf(wr, "OK");
- wrbuf_printf(wr, " %d - %d+%d+%d",
+ wrbuf_printf(wr, " " ODR_INT_PRINTF " - " ODR_INT_PRINTF "+"
+ ODR_INT_PRINTF "+" ODR_INT_PRINTF,
res->numberOfEntriesReturned ?
*res->numberOfEntriesReturned : 0,
(req->preferredPositionInResponse ?
bdrr->statuses = 0;
if (bdrr->num_setnames > 0)
{
- bdrr->statuses = (int*)
+ bdrr->statuses = (odr_int_t*)
odr_malloc(assoc->encode, sizeof(*bdrr->statuses) *
bdrr->num_setnames);
for (i = 0; i < bdrr->num_setnames; i++)
association_state state;
/* session parameters */
- int preferredMessageSize;
- int maximumRecordSize;
+ odr_int_t preferredMessageSize;
+ odr_int_t maximumRecordSize;
int version; /* highest version-bit set (2 or 3) */
unsigned cs_get_mask;
return add_xsd_string_ns(ptr, elem, val, 0);
}
-static void add_xsd_integer(xmlNodePtr ptr, const char *elem, const int *val)
+static void add_xsd_integer(xmlNodePtr ptr, const char *elem,
+ const odr_int_t *val)
{
if (val)
{
- char str[30];
- sprintf(str, "%d", *val);
+ char str[40];
+ sprintf(str, ODR_INT_PRINTF, *val);
xmlNewTextChild(ptr, 0, BAD_CAST elem, BAD_CAST str);
}
}
return 1;
}
-static int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o, int **val)
+static int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o,
+ odr_int_t **val)
{
#if CHECK_TYPE
struct _xmlAttr *attr;
}
#endif
-void yaz_uri_val_int(const char *path, const char *name, ODR o, int **intp)
+void yaz_uri_val_int(const char *path, const char *name, ODR o, odr_int_t **intp)
{
const char *v = yaz_uri_val(path, name, o);
if (v)
#if YAZ_HAVE_XML2
static int yaz_sru_decode_integer(ODR odr, const char *pname,
- const char *valstr, int **valp,
+ const char *valstr, odr_int_t **valp,
Z_SRW_diagnostic **diag, int *num_diag,
int min_value)
{
}
static void add_val_int(ODR o, char **name, char **value, int *i,
- char *a_name, int *val)
+ char *a_name, odr_int_t *val)
{
if (val)
{
name[*i] = a_name;
- value[*i] = (char *) odr_malloc(o, 30);
- sprintf(value[*i], "%d", *val);
+ value[*i] = (char *) odr_malloc(o, 40);
+ sprintf(value[*i], ODR_INT_PRINTF, *val);
(*i)++;
}
}
if (setname)
xmlNewProp(node, BAD_CAST "set", BAD_CAST setname);
- sprintf(formstr, "%d", *element->attributeType);
+ assert(*element->attributeType > 0 && *element->attributeType < 20);
+ sprintf(formstr, ODR_INT_PRINTF, *element->attributeType);
xmlNewProp(node, BAD_CAST "type", BAD_CAST formstr);
- sprintf(formstr, "%d", *element->value.numeric);
+ sprintf(formstr, ODR_INT_PRINTF, *element->value.numeric);
xmlNewProp(node, BAD_CAST "value", BAD_CAST formstr);
}
else if (element->which == Z_AttributeValue_complex)
if (setname)
xmlNewProp(node, BAD_CAST "set", BAD_CAST setname);
- sprintf(formstr, "%d", *element->attributeType);
+ sprintf(formstr, ODR_INT_PRINTF, *element->attributeType);
xmlNewProp(node, BAD_CAST "type", BAD_CAST formstr);
if (element->value.complex->list[i]->which ==
else if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_numeric)
{
- sprintf(formstr, "%d",
+ sprintf(formstr, ODR_INT_PRINTF,
*element->value.complex->list[i]->u.numeric);
xmlNewProp(node, BAD_CAST "value", BAD_CAST formstr);
}
break;
case Z_Term_numeric:
type = "numeric";
- sprintf(formstr, "%d", *term->u.numeric);
+ sprintf(formstr, ODR_INT_PRINTF, *term->u.numeric);
t = xmlNewText(BAD_CAST formstr);
break;
case Z_Term_characterString:
else
xmlNewProp(node, BAD_CAST "exclusion", BAD_CAST "false");
}
- sprintf(formstr, "%d", *op->u.prox->distance);
+ sprintf(formstr, ODR_INT_PRINTF, *op->u.prox->distance);
xmlNewProp(node, BAD_CAST "distance", BAD_CAST formstr);
if (*op->u.prox->ordered)
else
xmlNewProp(node, BAD_CAST "ordered", BAD_CAST "false");
- sprintf(formstr, "%d", *op->u.prox->relationType);
+ sprintf(formstr, ODR_INT_PRINTF, *op->u.prox->relationType);
xmlNewProp(node, BAD_CAST "relationType", BAD_CAST formstr);
switch(op->u.prox->which)
{
case Z_ProximityOperator_known:
- sprintf(formstr, "%d", *op->u.prox->u.known);
+ sprintf(formstr, ODR_INT_PRINTF, *op->u.prox->u.known);
xmlNewProp(node, BAD_CAST "knownProximityUnit",
BAD_CAST formstr);
break;
bool_t *boolVal(ODR odr, const char *str)
{
if (*str == '\0' || strchr("0fF", *str))
- return odr_intdup(odr, 0);
- return odr_intdup(odr, 1);
+ return odr_booldup(odr, 0);
+ return odr_booldup(odr, 1);
}
-int *intVal(ODR odr, const char *str)
+odr_int_t *intVal(ODR odr, const char *str)
{
return odr_intdup(odr, atoi(str));
}
if (atval)
pop->ordered = boolVal(odr, atval);
else
- pop->ordered = odr_intdup(odr, 1);
+ pop->ordered = odr_booldup(odr, 1);
atval = (const char *) xmlGetProp((xmlNodePtr) ptr,
BAD_CAST "relationType");
ODR_MASK_ZERO(r->protocolVersion);
r->preferredMessageSize = odr_intdup(o, 30*1024);
r->maximumRecordSize = odr_intdup(o, 30*1024);
- r->result = odr_intdup(o, 1);
+ r->result = odr_booldup(o, 1);
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
r->smallSetUpperBound = odr_intdup(o, 0);
r->largeSetLowerBound = odr_intdup(o, 1);
r->mediumSetPresentNumber = odr_intdup(o, 0);
- r->replaceIndicator = odr_intdup(o, 1);
+ r->replaceIndicator = odr_booldup(o, 1);
r->resultSetName = "default";
r->num_databaseNames = 0;
r->databaseNames = 0;
r->resultCount = odr_intdup(o, 0);
r->numberOfRecordsReturned = odr_intdup(o, 0);
r->nextResultSetPosition = odr_intdup(o, 0);
- r->searchStatus = odr_intdup(o, 1);
+ r->searchStatus = odr_booldup(o, 1);
r->resultSetStatus = 0;
r->presentStatus = 0;
r->records = 0;
r->suspendedFlag = 0;
r->resourceReport = 0;
r->partialResultsAvailable = 0;
- r->responseRequired = odr_intdup(o, 0);
+ r->responseRequired = odr_booldup(o, 0);
r->triggeredRequestFlag = 0;
r->otherInfo = 0;
return r;
odr_malloc(o, sizeof(*r));
r->referenceId = 0;
- r->continueFlag = odr_intdup(o, 1);
+ r->continueFlag = odr_booldup(o, 1);
r->resultSetWanted = 0;
r->otherInfo = 0;
return r;
req->u.esRequest->notToKeep->resultSetItem->resultSetId =
odr_strdup(p->odr_out, str);
req->u.esRequest->notToKeep->resultSetItem->item =
- (int *) odr_malloc(p->odr_out, sizeof(int));
+ odr_intdup(p->odr_out, 0);
str = ZOOM_options_get(p->options, "itemorder-item");
*req->u.esRequest->notToKeep->resultSetItem->item =
else if (strcmp(output_expect_record, wrbuf_cstr(output_record)))
{
ret = 0;
- printf("got-output_record len=%d: %s\n",
- wrbuf_len(output_record),wrbuf_cstr(output_record));
- printf("output_expect_record len=%d %s\n",
- strlen(output_expect_record), output_expect_record);
+ printf("got-output_record len=%ld: %s\n",
+ (long) wrbuf_len(output_record),
+ wrbuf_cstr(output_record));
+ printf("output_expect_record len=%ld %s\n",
+ (long) strlen(output_expect_record),
+ output_expect_record);
}
else
{
s->second->buf = (unsigned char *) "hello";
s->second->len = 5;
s->second->size = 0;
- s->third = odr_intdup(encode, 1);
+ s->third = odr_booldup(encode, 1);
s->fourth = odr_nullval();
s->fifth = odr_intdup(encode, YC_MySequence_enum1);
s->second->buf = (unsigned char *) "hello";
s->second->len = 5;
s->second->size = 0;
- s->third = odr_intdup(encode, 1);
+ s->third = odr_booldup(encode, 1);
s->fourth = odr_nullval();
s->fifth = odr_intdup(encode, YC_MySequence_enum1);
s->myoid = odr_getoidbystr(encode, MYOID);
}
proc asnBasicINTEGER {} {
- return {odr_integer {int}}
+ return {odr_integer {odr_int_t}}
}
proc asnBasicENUMERATED {} {
- return {odr_enum {int}}
+ return {odr_enum {odr_int_t}}
}
proc asnBasicNULL {} {
odr_reset(odr_prt); /*!*/
e->identifier = odr_intdup(odr,1);
- e->critical = odr_intdup(odr,0);
+ e->critical = odr_booldup(odr,0);
e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item));
if ( ! z_External(odr_ext, &ext,0,0) ) {
yaz_log(YLOG_FATAL,"Encoding of z_External failed ");
odr_reset(odr_prt); /*!*/
e->identifier = odr_intdup(odr,1);
- e->critical = odr_intdup(odr,0);
+ e->critical = odr_booldup(odr,0);
e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item));
if ( ! z_External(odr_ext, &ext,0,0) ) {
yaz_log(YLOG_FATAL,"Encoding of z_External failed ");
printf("Already forwarded: \n");
break;
case ILL_User_Error_Report_intermediary_problem:
- printf("Intermediary problem: %d\n",
+ printf("Intermediary problem: " ODR_INT_PRINTF "\n",
*uerr->u.intermediary_problem);
break;
case ILL_User_Error_Report_security_problem:
getillstring(uerr->u.security_problem));
break;
case ILL_User_Error_Report_unable_to_perform:
- printf("Unable to perform: %d\n",
+ printf("Unable to perform: " ODR_INT_PRINTF "\n",
*uerr->u.unable_to_perform);
break;
default:
ILL_Provider_Error_Report *perr= err->provider_error_report;
switch( perr->which ) {
case ILL_Provider_Error_Report_general_problem:
- printf("General Problem: %d:",
+ printf("General Problem: " ODR_INT_PRINTF ":",
*perr->u.general_problem);
break;
case ILL_Provider_Error_Report_transaction_id_problem:
- printf("Transaction Id Problem: %d:",
+ printf("Transaction Id Problem: " ODR_INT_PRINTF ":",
*perr->u.general_problem);
break;
case ILL_Provider_Error_Report_state_transition_prohibited:
hc->circulationData[0] = (Z_CircRecord *)
odr_malloc(odr, sizeof(**hc->circulationData));
- hc->circulationData[0]->availableNow = odr_intdup(odr, 1);
+ hc->circulationData[0]->availableNow = odr_booldup(odr, 1);
hc->circulationData[0]->availablityDate = 0;
hc->circulationData[0]->availableThru = 0;
hc->circulationData[0]->restrictions = 0;
hc->circulationData[0]->itemId = "1226176";
- hc->circulationData[0]->renewable = odr_intdup(odr, 0);
- hc->circulationData[0]->onHold = odr_intdup(odr, 0);
+ hc->circulationData[0]->renewable = odr_booldup(odr, 0);
+ hc->circulationData[0]->onHold = odr_booldup(odr, 0);
hc->circulationData[0]->enumAndChron = 0;
hc->circulationData[0]->midspine = 0;
hc->circulationData[0]->temporaryLocation = 0;
if (rr->esr->packageName)
yaz_log(log_level, "packagename: %s", rr->esr->packageName);
- yaz_log(log_level, "Waitaction: %d", *rr->esr->waitAction);
+ yaz_log(log_level, "Waitaction: " ODR_INT_PRINTF, *rr->esr->waitAction);
- yaz_log(log_level, "function: %d", *rr->esr->function);
+ yaz_log(log_level, "function: " ODR_INT_PRINTF, *rr->esr->function);
if (!rr->esr->taskSpecificParameters)
{
{
yaz_log(log_level, "resultsetItem");
yaz_log(log_level, "setId: %s", n->resultSetItem->resultSetId);
- yaz_log(log_level, "item: %d", *n->resultSetItem->item);
+ yaz_log(log_level, "item: " ODR_INT_PRINTF, *n->resultSetItem->item);
}
if (n->itemRequest)
{
}
if (item_req)
{
- yaz_log(log_level, "ILL protocol version = %d",
+ yaz_log(log_level, "ILL protocol version = "
+ ODR_INT_PRINTF,
*item_req->protocol_version_num);
}
}
yaz_log(log_level, " specialUpdate");
break;
default:
- yaz_log(log_level, " unknown (%d)", *toKeep->action);
+ yaz_log(log_level, " unknown (" ODR_INT_PRINTF ")",
+ *toKeep->action);
}
}
if (toKeep->databaseName)
ext->u.update->u.taskPackage->originPart = keep;
ext->u.update->u.taskPackage->targetPart = targetPart;
- keep->action = (int *) odr_malloc(rr->stream, sizeof(int));
- *keep->action = *toKeep->action;
+ keep->action = odr_intdup(rr->stream, *toKeep->action);
keep->databaseName =
odr_strdup(rr->stream, toKeep->databaseName);
keep->schema = 0;