rec->u.intermediateFragment->u.notExternallyTagged = oct;
oct->len = status.st_size;
-#if OCT_SIZE
- oct->size = status.st_size;
-#endif
oct->buf = (char *) odr_malloc (out, oct->len);
if (fread(oct->buf, 1, oct->len, inf) != (size_t) oct->len)
{
return 0;
id = (Z_ReferenceId *) odr_malloc(out, sizeof(*id));
id->len = strlen(refid);
-#if OCT_SIZE
- id->size = id->len;
-#endif
id->buf = (char *) odr_malloc(out, id->len);
memcpy(id->buf, refid, id->len);
return id;
/* send a very big referenceid to test transport stack etc. */
memset(big, 'A', 2100);
bigo.len = 2100;
-#if OCT_SIZE
- bigo.size = bigo.len;
-#endif
bigo.buf = big;
req->referenceId = &bigo;
}
r->u.single_ASN1_type->buf = (char *)
odr_malloc(out, item_request_size);
r->u.single_ASN1_type->len = item_request_size;
-#if OCT_SIZE
- r->u.single_ASN1_type->size = item_request_size;
-#endif
memcpy(r->u.single_ASN1_type->buf, item_request_buf,
item_request_size);
r->u.single_ASN1_type->buf = (char *)
odr_malloc(out, ill_request_size);
r->u.single_ASN1_type->len = ill_request_size;
-#if OCT_SIZE
- r->u.single_ASN1_type->size = ill_request_size;
-#endif
memcpy(r->u.single_ASN1_type->buf, ill_request_buf, ill_request_size);
/* printf("len = %d\n", ill_request_size); */
/* do_hex_dump(ill_request_buf,ill_request_size); */
notToKeep->elements[0]->u.opaque = (Odr_oct *)
odr_malloc(out, sizeof(Odr_oct));
notToKeep->elements[0]->u.opaque->buf = (char *) recid;
-#if OCT_SIZE
- notToKeep->elements[0]->u.opaque->size = strlen(recid);
-#endif
notToKeep->elements[0]->u.opaque->len = strlen(recid);
}
else
notToKeep->elements[0]->u.opaque = (Odr_oct *)
odr_malloc(out, sizeof(Odr_oct));
notToKeep->elements[0]->u.opaque->buf = (char *) recid;
-#if OCT_SIZE
- notToKeep->elements[0]->u.opaque->size = strlen(recid);
-#endif
notToKeep->elements[0]->u.opaque->len = strlen(recid);
}
else
req->termListAndStartPoint->term->u.general->buf =
odr_strdup(out, term);
req->termListAndStartPoint->term->u.general->len = strlen(term);
-#if OCT_SIZE
- req->termListAndStartPoint->term->u.general->size = strlen(term);
-#endif
}
}
req->referenceId = set_refid(out);
#define ODR_ENCODE 1
#define ODR_PRINT 2
-#define OCT_SIZE 0
-
typedef struct odr_oct
{
char *buf;
int len;
-#if OCT_SIZE
- int size;
-#endif
} Odr_oct;
typedef void Odr_null;
(*p)->buf = (char *)odr_malloc(o, res);
memcpy((*p)->buf, o->bp, res);
(*p)->len = res;
-#if OCT_SIZE
- (*p)->size = res;
-#endif
o->bp += res;
return 1;
case ODR_ENCODE:
{
int res, len;
const char *base;
-#if OCT_SIZE
- unsigned char *c;
-#endif
switch (o->direction)
{
odr_seterror(o, OOTHER, 16);
return 0;
}
-#if OCT_SIZE
- assert(p->size == 0);
- assert(p->len == 0);
- if (len + 1 > p->size - p->len)
- {
- c = (unsigned char *)odr_malloc(o, p->size += len + 1);
- if (p->len)
- memcpy(c, p->buf, p->len);
- p->buf = c;
- }
- if (len)
- memcpy(p->buf + p->len, o->bp, len);
- p->len += len;
- o->bp += len;
- /* the final null is really not part of the buffer, but */
- /* it helps somes applications that assumes C strings */
- if (len)
- p->buf[p->len] = '\0';
-#else
p->len = len;
p->buf = odr_malloc(o, len + 1);
memcpy(p->buf, o->bp, len);
p->buf[len] = '\0';
o->bp += len;
-#endif
return 1;
case ODR_ENCODE:
if ((res = ber_enclen(o, p->len, 5, 0)) < 0)
if (!(p->u.octet_aligned->buf = (char *)odr_malloc(o, len)))
return 0;
p->u.octet_aligned->len = len;
-#if OCT_SIZE
- p->u.octet_aligned->size = len;
-#endif
memcpy(p->u.octet_aligned->buf, buf, len);
return p;
Odr_oct *p = (Odr_oct *) odr_malloc(o, sizeof(Odr_oct));
p->buf = (char *) odr_malloc(o, sz);
memcpy(p->buf, buf, sz);
-#if OCT_SIZE
- p->size = sz;
-#endif
p->len = sz;
return p;
}
if (o->direction == ODR_DECODE)
{
*p = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct));
-#if OCT_SIZE
- (*p)->size= 0;
-#endif
(*p)->len = 0;
(*p)->buf = 0;
}
{
t->buf = *p;
t->len = strlen(*p);
-#if OCT_SIZE
- t->size = t->len;
-#endif
}
else
{
-#if OCT_SIZE
- t->size= 0;
-#endif
t->len = 0;
t->buf = 0;
}
return 0;
}
t->len = outbuf - (char*) t->buf;
-#if OCT_SIZE
- t->size = t->len;
-#endif
}
if (!t->buf)
{
t->buf = *p;
t->len = strlen(*p);
-#if OCT_SIZE
- t->size = t->len;
-#endif
}
}
else
{
-#if OCT_SIZE
- t->size= 0;
-#endif
t->len = 0;
t->buf = 0;
}
term_octet->buf = (char *)odr_malloc(o, 1 + len);
memcpy(term_octet->buf, buf, len);
term_octet->len = len;
-#if OCT_SIZE
- term_octet->size = len;
-#endif
term_octet->buf[term_octet->len] = 0; /* null terminate */
switch (term_type)
thisext->u.sutrs = sutrs;
sutrs->buf = (char *)nmem_malloc(nmem, len);
sutrs->len = len;
-#if OCT_SIZE
- sutrs->size = len;
-#endif
memcpy(sutrs->buf, buf, len);
}
else
return 0;
memcpy(thisext->u.octet_aligned->buf, buf, len);
thisext->u.octet_aligned->len = len;
-#if OCT_SIZE
- thisext->u.octet_aligned->size = len;
-#endif
}
return thisext;
}
return 0;
memcpy(thisext->u.single_ASN1_type->buf, buf, len);
thisext->u.single_ASN1_type->len = len;
-#if OCT_SIZE
- thisext->u.single_ASN1_type->size = len;
-#endif
return thisext;
}
o->buf = (char *)
odr_malloc(assoc->encode, o->len =
strlen(bsrr->entries[i].term));
-#if OCT_SIZE
- o->size = o->len;
-#endif
memcpy(o->buf, bsrr->entries[i].term, o->len);
yaz_log(YLOG_DEBUG, " term #%d: '%s' (" ODR_INT_PRINTF ")", i,
bsrr->entries[i].term, bsrr->entries[i].occurrences);
odr_malloc(out, sizeof(Odr_oct));
i++;
sks->u.missingValueData->len = strlen(sort_flags+i);
-#if OCT_SIZE
- sks->u.missingValueData->size = sks->u.missingValueData->len;
-#endif
sks->u.missingValueData->buf = odr_strdup(out, sort_flags+i);
i += strlen(sort_flags+i) - 1;
break;
sru_rec->recordData_buf;
npr->u.databaseRecord->u.octet_aligned->len =
sru_rec->recordData_len;
-#if OCT_SIZE
- npr->u.databaseRecord->u.octet_aligned->size =
- sru_rec->recordData_len;
-#endif
if (sru_rec->recordSchema
&& !strcmp(sru_rec->recordSchema,
"info:srw/schema/1/diagnostics-v1.1"))
s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second));
s->second->buf = (char *) "hello";
s->second->len = 5;
-#if OCT_SIZE
- s->second->size = 0;
-#endif
s->third = odr_booldup(encode, 1);
s->fourth = odr_nullval();
s->fifth = odr_intdup(encode, YC_MySequence_enum1);
s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second));
s->second->buf = (char *) "hello";
s->second->len = 5;
-#if OCT_SIZE
- s->second->size = 0;
-#endif
s->third = odr_booldup(encode, 1);
s->fourth = odr_nullval();
s->fifth = odr_intdup(encode, YC_MySequence_enum1);
ext->u.single_ASN1_type->buf= (char *) odr_malloc(odr, siz);
memcpy(ext->u.single_ASN1_type->buf,buf, siz );
ext->u.single_ASN1_type->len = siz;
-#if OCT_SIZE
- ext->u.single_ASN1_type->size = siz;
-#endif
odr_reset(odr_ext);
odr_reset(odr_prt); /*!*/
e->item->buf= (char *) odr_malloc(odr, siz);
memcpy(e->item->buf,buf, siz );
e->item->len = siz;
-#if OCT_SIZE
- e->item->size = siz;
-#endif
odr_destroy(odr_prt);
odr_destroy(odr_ext);
ext->u.single_ASN1_type->buf = (char *) odr_malloc(odr, siz);
memcpy(ext->u.single_ASN1_type->buf,buf, siz );
ext->u.single_ASN1_type->len = siz;
-#if OCT_SIZE
- ext->u.single_ASN1_type->size = siz;
-#endif
odr_reset(odr_ext);
odr_reset(odr_prt); /*!*/
e->item->buf= (char *) odr_malloc(odr, siz);
memcpy(e->item->buf, buf, siz);
e->item->len = siz;
-#if OCT_SIZE
- e->item->size = siz;
-#endif
odr_destroy(odr_prt);
odr_destroy(odr_ext);
odr_strdup(rr->stream, "911");
rr->taskPackage->targetReference->len =
strlen((char *) (rr->taskPackage->targetReference->buf));
-#if OCT_SIZE
- rr->taskPackage->targetReference->size =
- strlen((char *) (rr->taskPackage->targetReference->buf));
-#endif
rr->taskPackage->creationDateTime = 0;
rr->taskPackage->taskStatus = odr_intdup(rr->stream, 0);
rr->taskPackage->packageDiagnostics = 0;
odr_strdup(rr->stream, "123");
rr->taskPackage->targetReference->len =
strlen((char *) (rr->taskPackage->targetReference->buf));
-#if OCT_SIZE
- rr->taskPackage->targetReference->size =
- rr->taskPackage->targetReference->len;
-#endif
rr->taskPackage->creationDateTime = 0;
rr->taskPackage->taskStatus = odr_intdup(rr->stream, 0);
rr->taskPackage->packageDiagnostics = 0;