/*
* The table below should be moved to the ODR structure itself and
* be an image of the association context: To help
/*
* The table below should be moved to the ODR structure itself and
* be an image of the association context: To help
encoding CHOICE {
single-ASN1-type [0] ABSTRACT_SYNTAX.&Type,
octet-aligned [1] IMPLICIT OCTET STRING,
encoding CHOICE {
single-ASN1-type [0] ABSTRACT_SYNTAX.&Type,
octet-aligned [1] IMPLICIT OCTET STRING,
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userInfo1,
(Odr_fun)z_OtherInformation, 0},
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userFacets,
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userInfo1,
(Odr_fun)z_OtherInformation, 0},
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userFacets,
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_charSetandLanguageNegotiation,
(Odr_fun)z_CharSetandLanguageNegotiation, 0},
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfPrompt1,
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_charSetandLanguageNegotiation,
(Odr_fun)z_CharSetandLanguageNegotiation, 0},
{ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfPrompt1,
if (zclass == ODR_CONTEXT && tag == 1 && cons == 0)
{
/* we have an OCTET STRING. decode BER contents from it */
if (zclass == ODR_CONTEXT && tag == 1 && cons == 0)
{
/* we have an OCTET STRING. decode BER contents from it */
int o_size;
char *voidp = 0;
Odr_oct *oct;
int r;
if (!odr_implicit_tag(o, odr_octetstring, &oct,
int o_size;
char *voidp = 0;
Odr_oct *oct;
int r;
if (!odr_implicit_tag(o, odr_octetstring, &oct,
- ODR_CONTEXT, 1, 0, "octetaligned"))
+ ODR_CONTEXT, 1, 0, "octetaligned"))
/* and decode that */
r = (*type->fun)(o, &voidp, 0, 0);
(*p)->which = type->what;
(*p)->u.single_ASN1_type = (Odr_any*) voidp;
/* and decode that */
r = (*type->fun)(o, &voidp, 0, 0);
(*p)->which = type->what;
(*p)->u.single_ASN1_type = (Odr_any*) voidp;
/* It's single ASN.1 type, bias the CHOICE. */
odr_choice_bias(o, type->what);
}
/* It's single ASN.1 type, bias the CHOICE. */
odr_choice_bias(o, type->what);
}
-Z_External *z_ext_record_oid(ODR o, const Odr_oid *oid, const char *buf, int len)
+Z_External *z_ext_record_oid_nmem(NMEM nmem, const Odr_oid *oid,
+ const char *buf, int len)
-
- oid_str = yaz_oid_to_string_buf(oid, &oclass, oid_str_buf);
-
- thisext->direct_reference = odr_oiddup(o, oid);
+ thisext->direct_reference = odr_oiddup_nmem(nmem, oid);
- else if (!oid_oidcmp(oid, yaz_oid_recsyn_sutrs)) /* SUTRS is a single-ASN.1-type */
- {
- Odr_oct *sutrs = (Odr_oct *)odr_malloc(o, sizeof(*sutrs));
-
+ else if (!oid_oidcmp(oid, yaz_oid_recsyn_sutrs))
+ { /* SUTRS is a single-ASN.1-type */
+ Odr_oct *sutrs = (Odr_oct *)nmem_malloc(nmem, sizeof(*sutrs));
+
memcpy(sutrs->buf, buf, len);
}
else
{
thisext->which = Z_External_octet;
if (!(thisext->u.octet_aligned = (Odr_oct *)
memcpy(sutrs->buf, buf, len);
}
else
{
thisext->which = Z_External_octet;
if (!(thisext->u.octet_aligned = (Odr_oct *)
+Z_External *z_ext_record_oid(ODR o, const Odr_oid *oid,
+ const char *buf, int len)
+{
+ return z_ext_record_oid_nmem(o->mem, oid, buf, len);
+}
+
Z_External *z_ext_record_oid_any(ODR o, const Odr_oid *oid,
const char *buf, int len)
{
Z_External *thisext;
Z_External *z_ext_record_oid_any(ODR o, const Odr_oid *oid,
const char *buf, int len)
{
Z_External *thisext;
if (!oid)
return 0;
thisext = (Z_External *) odr_malloc(o, sizeof(*thisext));
thisext->descriptor = 0;
thisext->indirect_reference = 0;
if (!oid)
return 0;
thisext = (Z_External *) odr_malloc(o, sizeof(*thisext));
thisext->descriptor = 0;
thisext->indirect_reference = 0;
thisext->direct_reference = odr_oiddup(o, oid);
thisext->which = Z_External_single;
thisext->u.single_ASN1_type = (Odr_any *) odr_malloc(o, sizeof(Odr_any));
if (!thisext->u.single_ASN1_type)
return 0;
thisext->direct_reference = odr_oiddup(o, oid);
thisext->which = Z_External_single;
thisext->u.single_ASN1_type = (Odr_any *) odr_malloc(o, sizeof(Odr_any));
if (!thisext->u.single_ASN1_type)
return 0;
if (!thisext->u.single_ASN1_type->buf)
return 0;
memcpy(thisext->u.single_ASN1_type->buf, buf, len);
if (!thisext->u.single_ASN1_type->buf)
return 0;
memcpy(thisext->u.single_ASN1_type->buf, buf, len);