Commit dc9e792a authored by v0-e's avatar v0-e

jer: Remove unused arguments and variables

parent 87b80d47
...@@ -827,8 +827,7 @@ xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, ...@@ -827,8 +827,7 @@ xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx,
asn_dec_rval_t asn_dec_rval_t
jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx,
void *struct_key, const char *json_key, const void *buf_ptr, void *struct_key, const void *buf_ptr, size_t size,
size_t size,
int (*otd)(void *struct_key, const void *chunk_buf, int (*otd)(void *struct_key, const void *chunk_buf,
size_t chunk_size), size_t chunk_size),
ssize_t (*br)(void *struct_key, const void *chunk_buf, ssize_t (*br)(void *struct_key, const void *chunk_buf,
...@@ -837,7 +836,6 @@ jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, ...@@ -837,7 +836,6 @@ jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx,
(void)opt_codec_ctx; (void)opt_codec_ctx;
(void)ctx; (void)ctx;
(void)struct_key; (void)struct_key;
(void)json_key;
(void)buf_ptr; (void)buf_ptr;
(void)size; (void)size;
(void)otd; (void)otd;
......
...@@ -18,6 +18,9 @@ BIT_STRING_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -18,6 +18,9 @@ BIT_STRING_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
uint8_t *buf; uint8_t *buf;
uint8_t *end; uint8_t *end;
(void)ilevel;
(void)flags;
if(!st || !st->buf) if(!st || !st->buf)
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
......
...@@ -10,11 +10,10 @@ ...@@ -10,11 +10,10 @@
asn_dec_rval_t asn_dec_rval_t
BMPString_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, BMPString_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
asn_dec_rval_t rc; asn_dec_rval_t rc;
rc = OCTET_STRING_decode_jer_utf8(opt_codec_ctx, td, sptr, opt_mname, rc = OCTET_STRING_decode_jer_utf8(opt_codec_ctx, td, sptr, buf_ptr, size);
buf_ptr, size);
if(rc.code == RC_OK) { if(rc.code == RC_OK) {
/* /*
* Now we have a whole string in UTF-8 format. * Now we have a whole string in UTF-8 format.
......
...@@ -18,6 +18,7 @@ BOOLEAN__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -18,6 +18,7 @@ BOOLEAN__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
const char *p = (const char *)chunk_buf; const char *p = (const char *)chunk_buf;
(void)td; (void)td;
(void)chunk_size;
if(p[0] == 't' /* 'true' */) { if(p[0] == 't' /* 'true' */) {
*st = 1; *st = 1;
...@@ -34,9 +35,9 @@ BOOLEAN__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -34,9 +35,9 @@ BOOLEAN__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
BOOLEAN_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, BOOLEAN_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, sptr, sizeof(BOOLEAN_t), buf_ptr, size,
BOOLEAN__jer_body_decode); BOOLEAN__jer_body_decode);
} }
......
...@@ -118,8 +118,8 @@ ENUMERATED__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -118,8 +118,8 @@ ENUMERATED__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
ENUMERATED_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ENUMERATED_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(INTEGER_t), opt_mname, sptr, sizeof(INTEGER_t),
buf_ptr, size, ENUMERATED__jer_body_decode); buf_ptr, size, ENUMERATED__jer_body_decode);
} }
...@@ -182,9 +182,9 @@ INTEGER__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -182,9 +182,9 @@ INTEGER__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
INTEGER_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, INTEGER_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(INTEGER_t), opt_mname, sptr, sizeof(INTEGER_t),
buf_ptr, size, INTEGER__jer_body_decode); buf_ptr, size, INTEGER__jer_body_decode);
} }
......
...@@ -45,8 +45,8 @@ NULL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -45,8 +45,8 @@ NULL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
NULL_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, NULL_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(NULL_t), opt_mname, buf_ptr, size, sptr, sizeof(NULL_t), buf_ptr, size,
NULL__jer_body_decode); NULL__jer_body_decode);
} }
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
asn_dec_rval_t asn_dec_rval_t
NativeEnumerated_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, NativeEnumerated_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr, size_t size) {
size_t size) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics; (const asn_INTEGER_specifics_t *)td->specifics;
asn_dec_rval_t rval; asn_dec_rval_t rval;
...@@ -27,8 +26,7 @@ NativeEnumerated_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -27,8 +26,7 @@ NativeEnumerated_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
} }
memset(&st, 0, sizeof(st)); memset(&st, 0, sizeof(st));
rval = ENUMERATED_decode_jer(opt_codec_ctx, td, &st_ptr, rval = ENUMERATED_decode_jer(opt_codec_ctx, td, &st_ptr, buf_ptr, size);
opt_mname, buf_ptr, size);
if(rval.code == RC_OK) { if(rval.code == RC_OK) {
long l; long l;
if((specs&&specs->field_unsigned) if((specs&&specs->field_unsigned)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
asn_dec_rval_t asn_dec_rval_t
NativeInteger_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, NativeInteger_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr,
size_t size) { size_t size) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics; (const asn_INTEGER_specifics_t *)td->specifics;
...@@ -27,8 +27,7 @@ NativeInteger_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -27,8 +27,7 @@ NativeInteger_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
} }
memset(&st, 0, sizeof(st)); memset(&st, 0, sizeof(st));
rval = INTEGER_decode_jer(opt_codec_ctx, td, &st_ptr, rval = INTEGER_decode_jer(opt_codec_ctx, td, &st_ptr, buf_ptr, size);
opt_mname, buf_ptr, size);
if(rval.code == RC_OK) { if(rval.code == RC_OK) {
long l; long l;
if((specs&&specs->field_unsigned) if((specs&&specs->field_unsigned)
......
...@@ -13,13 +13,12 @@ ...@@ -13,13 +13,12 @@
asn_dec_rval_t asn_dec_rval_t
NativeReal_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, NativeReal_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
asn_dec_rval_t rval; asn_dec_rval_t rval;
REAL_t st = { 0, 0 }; REAL_t st = { 0, 0 };
REAL_t *stp = &st; REAL_t *stp = &st;
rval = REAL_decode_jer(opt_codec_ctx, td, (void **)&stp, opt_mname, rval = REAL_decode_jer(opt_codec_ctx, td, (void **)&stp, buf_ptr, size);
buf_ptr, size);
if(rval.code == RC_OK) { if(rval.code == RC_OK) {
double d; double d;
if(asn_REAL2double(&st, &d) || NativeReal__set(td, sptr, d) < 0) { if(asn_REAL2double(&st, &d) || NativeReal__set(td, sptr, d) < 0) {
......
...@@ -52,11 +52,11 @@ OBJECT_IDENTIFIER__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -52,11 +52,11 @@ OBJECT_IDENTIFIER__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
OBJECT_IDENTIFIER_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, OBJECT_IDENTIFIER_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr,
size_t size) { size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(OBJECT_IDENTIFIER_t), opt_mname, sptr, sizeof(OBJECT_IDENTIFIER_t),
buf_ptr, size, OBJECT_IDENTIFIER__jer_body_decode); buf_ptr, size, OBJECT_IDENTIFIER__jer_body_decode);
} }
asn_enc_rval_t asn_enc_rval_t
......
...@@ -20,6 +20,9 @@ OCTET_STRING_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -20,6 +20,9 @@ OCTET_STRING_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
uint8_t *end; uint8_t *end;
size_t i; size_t i;
(void)ilevel;
(void)flags;
if(!st || (!st->buf && st->size)) if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
...@@ -493,7 +496,7 @@ OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, ...@@ -493,7 +496,7 @@ OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf,
static asn_dec_rval_t static asn_dec_rval_t
OCTET_STRING__decode_jer( OCTET_STRING__decode_jer(
const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td, const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td,
void **sptr, const char *opt_mname, const void *buf_ptr, size_t size, void **sptr, const void *buf_ptr, size_t size,
int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf, int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf,
size_t chunk_size), size_t chunk_size),
ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf, ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf,
...@@ -502,7 +505,6 @@ OCTET_STRING__decode_jer( ...@@ -502,7 +505,6 @@ OCTET_STRING__decode_jer(
const asn_OCTET_STRING_specifics_t *specs = td->specifics const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
asn_struct_ctx_t *ctx; /* Per-structure parser context */ asn_struct_ctx_t *ctx; /* Per-structure parser context */
asn_dec_rval_t rval; /* Return value from the decoder */ asn_dec_rval_t rval; /* Return value from the decoder */
int st_allocated; int st_allocated;
...@@ -534,7 +536,7 @@ OCTET_STRING__decode_jer( ...@@ -534,7 +536,7 @@ OCTET_STRING__decode_jer(
/* Restore parsing context */ /* Restore parsing context */
ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset); ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
return jer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag, return jer_decode_general(opt_codec_ctx, ctx, *sptr,
buf_ptr, size, buf_ptr, size,
opt_unexpected_tag_decoder, opt_unexpected_tag_decoder,
body_receiver); body_receiver);
...@@ -553,9 +555,8 @@ sta_failed: ...@@ -553,9 +555,8 @@ sta_failed:
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_jer_hex(const asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_jer_hex(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr, size_t size) {
size_t size) { return OCTET_STRING__decode_jer(opt_codec_ctx, td, sptr,
return OCTET_STRING__decode_jer(opt_codec_ctx, td, sptr, opt_mname,
buf_ptr, size, 0, buf_ptr, size, 0,
OCTET_STRING__convert_hexadecimal); OCTET_STRING__convert_hexadecimal);
} }
...@@ -566,9 +567,8 @@ OCTET_STRING_decode_jer_hex(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -566,9 +567,8 @@ OCTET_STRING_decode_jer_hex(const asn_codec_ctx_t *opt_codec_ctx,
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_jer_utf8(const asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_jer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr, size_t size) {
size_t size) { return OCTET_STRING__decode_jer(opt_codec_ctx, td, sptr,
return OCTET_STRING__decode_jer(opt_codec_ctx, td, sptr, opt_mname,
buf_ptr, size, buf_ptr, size,
OCTET_STRING__handle_control_chars, OCTET_STRING__handle_control_chars,
OCTET_STRING__convert_entrefs); OCTET_STRING__convert_entrefs);
......
...@@ -103,7 +103,7 @@ OPEN_TYPE_jer_get(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -103,7 +103,7 @@ OPEN_TYPE_jer_get(const asn_codec_ctx_t *opt_codec_ctx,
+ elm->type->elements[selected.presence_index - 1].memb_offset; + elm->type->elements[selected.presence_index - 1].memb_offset;
rv = selected.type_descriptor->op->jer_decoder( rv = selected.type_descriptor->op->jer_decoder(
opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size); opt_codec_ctx, selected.type_descriptor, &inner_value, ptr, size);
ADVANCE(rv.consumed); ADVANCE(rv.consumed);
rv.consumed = 0; rv.consumed = 0;
switch(rv.code) { switch(rv.code) {
......
...@@ -323,9 +323,8 @@ REAL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -323,9 +323,8 @@ REAL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
REAL_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, REAL_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td, sptr, sizeof(REAL_t),
sptr, sizeof(REAL_t), opt_mname,
buf_ptr, size, REAL__jer_body_decode); buf_ptr, size, REAL__jer_body_decode);
} }
...@@ -72,10 +72,9 @@ RELATIVE_OID__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -72,10 +72,9 @@ RELATIVE_OID__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
asn_dec_rval_t asn_dec_rval_t
RELATIVE_OID_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, RELATIVE_OID_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr, size_t size) {
size_t size) {
return jer_decode_primitive(opt_codec_ctx, td, return jer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(RELATIVE_OID_t), opt_mname, sptr, sizeof(RELATIVE_OID_t),
buf_ptr, size, RELATIVE_OID__jer_body_decode); buf_ptr, size, RELATIVE_OID__jer_body_decode);
} }
......
...@@ -10,12 +10,10 @@ ...@@ -10,12 +10,10 @@
asn_dec_rval_t asn_dec_rval_t
UniversalString_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, UniversalString_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, const void *buf_ptr, size_t size) {
size_t size) {
asn_dec_rval_t rc; asn_dec_rval_t rc;
rc = OCTET_STRING_decode_jer_utf8(opt_codec_ctx, td, sptr, opt_mname, rc = OCTET_STRING_decode_jer_utf8(opt_codec_ctx, td, sptr, buf_ptr, size);
buf_ptr, size);
if(rc.code == RC_OK) { if(rc.code == RC_OK) {
/* /*
* Now we have a whole string in UTF-8 format. * Now we have a whole string in UTF-8 format.
......
...@@ -71,7 +71,7 @@ typedef enum jer_pbd_rval(jer_primitive_body_decoder_f)( ...@@ -71,7 +71,7 @@ typedef enum jer_pbd_rval(jer_primitive_body_decoder_f)(
asn_dec_rval_t jer_decode_primitive( asn_dec_rval_t jer_decode_primitive(
const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, size_t struct_size, const void *buf_ptr, size_t size,
jer_primitive_body_decoder_f *prim_body_decoder); jer_primitive_body_decoder_f *prim_body_decoder);
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
......
...@@ -117,10 +117,9 @@ jer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, ...@@ -117,10 +117,9 @@ jer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size,
asn_dec_rval_t asn_dec_rval_t
jer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, jer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr, const asn_TYPE_descriptor_t *td, void **sptr,
size_t struct_size, const char *opt_mname, size_t struct_size,
const void *buf_ptr, size_t size, const void *buf_ptr, size_t size,
jer_primitive_body_decoder_f *prim_body_decoder) { jer_primitive_body_decoder_f *prim_body_decoder) {
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
asn_struct_ctx_t s_ctx; asn_struct_ctx_t s_ctx;
struct jdp_arg_s s_arg; struct jdp_arg_s s_arg;
asn_dec_rval_t rc; asn_dec_rval_t rc;
...@@ -141,7 +140,7 @@ jer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -141,7 +140,7 @@ jer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
s_arg.want_more = 0; s_arg.want_more = 0;
rc = jer_decode_general(opt_codec_ctx, &s_ctx, &s_arg, rc = jer_decode_general(opt_codec_ctx, &s_ctx, &s_arg,
xml_tag, buf_ptr, size, buf_ptr, size,
jer_decode__unexpected_tag, jer_decode__unexpected_tag,
jer_decode__primitive_body); jer_decode__primitive_body);
switch(rc.code) { switch(rc.code) {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
asn_dec_rval_t asn_dec_rval_t
CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **struct_ptr, const asn_TYPE_descriptor_t *td, void **struct_ptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
*/ */
...@@ -99,7 +99,6 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -99,7 +99,6 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
/* Start/Continue decoding the inner member */ /* Start/Continue decoding the inner member */
tmprval = elm->type->op->jer_decoder(opt_codec_ctx, tmprval = elm->type->op->jer_decoder(opt_codec_ctx,
elm->type, memb_ptr2, elm->type, memb_ptr2,
elm->name,
buf_ptr, size); buf_ptr, size);
JER_ADVANCE(tmprval.consumed); JER_ADVANCE(tmprval.consumed);
ASN_DEBUG("JER/CHOICE: itdf: [%s] code=%d", ASN_DEBUG("JER/CHOICE: itdf: [%s] code=%d",
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
asn_dec_rval_t asn_dec_rval_t
SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **struct_ptr, const asn_TYPE_descriptor_t *td, void **struct_ptr,
const char *opt_mname, const void *ptr, size_t size) { const void *ptr, size_t size) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
*/ */
...@@ -108,7 +108,7 @@ SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -108,7 +108,7 @@ SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
} else { } else {
/* Invoke the inner type decoder, m.b. multiple times */ /* Invoke the inner type decoder, m.b. multiple times */
tmprval = elm->type->op->jer_decoder(opt_codec_ctx, tmprval = elm->type->op->jer_decoder(opt_codec_ctx,
elm->type, memb_ptr2, elm->name, elm->type, memb_ptr2,
ptr, size); ptr, size);
} }
JER_ADVANCE(tmprval.consumed); JER_ADVANCE(tmprval.consumed);
......
...@@ -32,13 +32,12 @@ ...@@ -32,13 +32,12 @@
asn_dec_rval_t asn_dec_rval_t
SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **struct_ptr, const asn_TYPE_descriptor_t *td, void **struct_ptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
*/ */
const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics; const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
const asn_TYPE_member_t *element = td->elements; const asn_TYPE_member_t *element = td->elements;
const char *elm_tag;
/* /*
* ... and parts of the structure being constructed. * ... and parts of the structure being constructed.
...@@ -57,14 +56,6 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -57,14 +56,6 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
if(st == 0) RETURN(RC_FAIL); if(st == 0) RETURN(RC_FAIL);
} }
/* Which tag is expected for the downstream */
if(specs->as_XMLValueList) {
elm_tag = (specs->as_XMLValueList == 1) ? 0 : "";
} else {
elm_tag = (*element->name)
? element->name : element->type->xml_tag;
}
/* /*
* Restore parsing context. * Restore parsing context.
*/ */
...@@ -88,10 +79,11 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -88,10 +79,11 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
asn_dec_rval_t tmprval = {RC_OK, 0}; asn_dec_rval_t tmprval = {RC_OK, 0};
/* Invoke the inner type decoder, m.b. multiple times */ /* Invoke the inner type decoder, m.b. multiple times */
ASN_DEBUG("JER/SET OF element [%s]", elm_tag); ASN_DEBUG("JER/SET OF element [%s]", elm_tag(*element->name) ?
element->name : element->type->xml_tag);
tmprval = element->type->op->jer_decoder(opt_codec_ctx, tmprval = element->type->op->jer_decoder(opt_codec_ctx,
element->type, element->type,
&ctx->ptr, elm_tag, &ctx->ptr,
buf_ptr, size); buf_ptr, size);
if(tmprval.code == RC_OK) { if(tmprval.code == RC_OK) {
asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
asn_dec_rval_t asn_dec_rval_t
SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **struct_ptr, const asn_TYPE_descriptor_t *td, void **struct_ptr,
const char *opt_mname, const void *ptr, size_t size) { const void *ptr, size_t size) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
*/ */
...@@ -112,7 +112,7 @@ SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -112,7 +112,7 @@ SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,
/* Invoke the inner type decoder, m.b. multiple times */ /* Invoke the inner type decoder, m.b. multiple times */
tmprval = elm->type->op->jer_decoder(opt_codec_ctx, tmprval = elm->type->op->jer_decoder(opt_codec_ctx,
elm->type, memb_ptr2, elm->name, elm->type, memb_ptr2,
ptr, size); ptr, size);
JER_ADVANCE(tmprval.consumed); JER_ADVANCE(tmprval.consumed);
if(tmprval.code != RC_OK) if(tmprval.code != RC_OK)
......
...@@ -35,7 +35,7 @@ jer_decode(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -35,7 +35,7 @@ jer_decode(const asn_codec_ctx_t *opt_codec_ctx,
/* /*
* Invoke type-specific decoder. * Invoke type-specific decoder.
*/ */
return td->op->jer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size); return td->op->jer_decoder(opt_codec_ctx, td, struct_ptr, buffer, size);
} }
...@@ -210,7 +210,6 @@ asn_dec_rval_t ...@@ -210,7 +210,6 @@ asn_dec_rval_t
jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
asn_struct_ctx_t *ctx, /* Type decoder context */ asn_struct_ctx_t *ctx, /* Type decoder context */
void *struct_key, void *struct_key,
const char *json_key, /* Expected JSON key */
const void *buf_ptr, size_t size, const void *buf_ptr, size_t size,
int (*opt_unexpected_key_decoder) int (*opt_unexpected_key_decoder)
(void *struct_key, const void *chunk_buf, size_t chunk_size), (void *struct_key, const void *chunk_buf, size_t chunk_size),
...@@ -223,6 +222,7 @@ jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, ...@@ -223,6 +222,7 @@ jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
ssize_t consumed_myself = 0; ssize_t consumed_myself = 0;
(void)opt_codec_ctx; (void)opt_codec_ctx;
(void)opt_unexpected_key_decoder;
/* /*
* Phases of jer/JSON processing: * Phases of jer/JSON processing:
......
...@@ -31,7 +31,6 @@ asn_dec_rval_t jer_decode( ...@@ -31,7 +31,6 @@ asn_dec_rval_t jer_decode(
typedef asn_dec_rval_t(jer_type_decoder_f)( typedef asn_dec_rval_t(jer_type_decoder_f)(
const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t *opt_codec_ctx,
const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
const char *opt_mname, /* Member name */
const void *buf_ptr, size_t size); const void *buf_ptr, size_t size);
/******************************* /*******************************
...@@ -48,7 +47,6 @@ asn_dec_rval_t jer_decode_general( ...@@ -48,7 +47,6 @@ asn_dec_rval_t jer_decode_general(
const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t *opt_codec_ctx,
asn_struct_ctx_t *ctx, /* Type decoder context */ asn_struct_ctx_t *ctx, /* Type decoder context */
void *struct_key, /* Treated as opaque pointer */ void *struct_key, /* Treated as opaque pointer */
const char *json_key, /* Expected XML tag name */
const void *buf_ptr, size_t size, const void *buf_ptr, size_t size,
int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf, int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
size_t chunk_size), size_t chunk_size),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment