aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/constr_SEQUENCE.c
diff options
context:
space:
mode:
Diffstat (limited to 'skeletons/constr_SEQUENCE.c')
-rw-r--r--skeletons/constr_SEQUENCE.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index 56400d5f..5923023d 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -532,7 +532,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
if(!memb_ptr) {
if(elm->optional) continue;
/* Mandatory element is missing */
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
} else {
memb_ptr = (void *)((char *)sptr + elm->memb_offset);
@@ -553,10 +553,10 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size);
if(ret == -1)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
erval.encoded = computed_size + ret;
- if(!cb) _ASN_ENCODED_OK(erval);
+ if(!cb) ASN__ENCODED_OK(erval);
/*
* Encode all members.
@@ -586,9 +586,9 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
/*
* Encoded size is not equal to the computed size.
*/
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
- _ASN_ENCODED_OK(erval);
+ ASN__ENCODED_OK(erval);
}
@@ -858,7 +858,7 @@ SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
int edx;
if(!sptr)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
er.encoded = 0;
@@ -875,29 +875,29 @@ SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if(elm->optional)
continue;
/* Mandatory element is missing */
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
} else {
memb_ptr = (void *)((char *)sptr + elm->memb_offset);
}
if(!xcan) ASN__TEXT_INDENT(1, ilevel);
- _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1);
+ ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
/* Print the member itself */
tmper = elm->type->xer_encoder(elm->type, memb_ptr,
ilevel + 1, flags, cb, app_key);
if(tmper.encoded == -1) return tmper;
- _ASN_CALLBACK3("</", 2, mname, mlen, ">", 1);
+ ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
er.encoded += 5 + (2 * mlen) + tmper.encoded;
}
if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
cb_failed:
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
int
@@ -981,7 +981,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
int edx;
if(!sptr) {
- _ASN_CTFAIL(app_key, td, sptr,
+ ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
@@ -999,7 +999,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
if(!memb_ptr) {
if(elm->optional)
continue;
- _ASN_CTFAIL(app_key, td, sptr,
+ ASN__CTFAIL(app_key, td, sptr,
"%s: mandatory element %s absent (%s:%d)",
td->name, elm->name, __FILE__, __LINE__);
return -1;
@@ -1040,12 +1040,12 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
(void)constraints;
- if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
- _ASN_DECODE_FAILED;
+ if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+ ASN__DECODE_FAILED;
if(!st) {
st = *sptr = CALLOC(1, specs->struct_size);
- if(!st) _ASN_DECODE_FAILED;
+ if(!st) ASN__DECODE_FAILED;
}
ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name);
@@ -1053,7 +1053,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Handle extensions */
if(specs->ext_before >= 0) {
extpresent = per_get_few_bits(pd, 1);
- if(extpresent < 0) _ASN_DECODE_STARVED;
+ if(extpresent < 0) ASN__DECODE_STARVED;
} else {
extpresent = 0;
}
@@ -1062,11 +1062,11 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
memset(&opmd, 0, sizeof(opmd));
if(specs->roms_count) {
opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
- if(!opres) _ASN_DECODE_FAILED;
+ if(!opres) ASN__DECODE_FAILED;
/* Get the presence map */
if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
FREEMEM(opres);
- _ASN_DECODE_STARVED;
+ ASN__DECODE_STARVED;
}
opmd.buffer = opres;
opmd.nbits = specs->roms_count;
@@ -1107,7 +1107,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Fill-in DEFAULT */
if(elm->default_value(1, memb_ptr2)) {
FREEMEM(opres);
- _ASN_DECODE_FAILED;
+ ASN__DECODE_FAILED;
}
ASN_DEBUG("Filled-in default");
}
@@ -1141,17 +1141,17 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_per_data_t epmd;
bmlength = uper_get_nslength(pd);
- if(bmlength < 0) _ASN_DECODE_STARVED;
+ if(bmlength < 0) ASN__DECODE_STARVED;
ASN_DEBUG("Extensions %ld present in %s", (long)bmlength, td->name);
epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
- if(!epres) _ASN_DECODE_STARVED;
+ if(!epres) ASN__DECODE_STARVED;
/* Get the extensions map */
if(per_get_many_bits(pd, epres, 0, bmlength)) {
FREEMEM(epres);
- _ASN_DECODE_STARVED;
+ ASN__DECODE_STARVED;
}
memset(&epmd, 0, sizeof(epmd));
@@ -1205,7 +1205,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
default:
if(uper_open_type_skip(opt_codec_ctx, pd)) {
FREEMEM(epres);
- _ASN_DECODE_STARVED;
+ ASN__DECODE_STARVED;
}
}
break;
@@ -1233,7 +1233,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Set default value */
if(elm->default_value(1, memb_ptr2)) {
- _ASN_DECODE_FAILED;
+ ASN__DECODE_FAILED;
}
}
@@ -1307,7 +1307,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
(void)constraints;
if(!sptr)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
er.encoded = 0;
@@ -1355,7 +1355,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
elm->default_value ? "def" : "wtv",
td->name, elm->name, present ? "present" : "absent");
if(per_put_few_bits(po, present, 1))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
/*
@@ -1383,7 +1383,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
if(elm->optional)
continue;
/* Mandatory element is missing */
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
} else {
memb_ptr = (void *)((char *)sptr + elm->memb_offset);
@@ -1402,24 +1402,24 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
}
/* No extensions to encode */
- if(!n_extensions) _ASN_ENCODED_OK(er);
+ if(!n_extensions) ASN__ENCODED_OK(er);
ASN_DEBUG("Length of %d bit-map", n_extensions);
/* #18.8. Write down the presence bit-map length. */
if(uper_put_nslength(po, n_extensions))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
ASN_DEBUG("Bit-map of %d elements", n_extensions);
/* #18.7. Encoding the extensions presence bit-map. */
/* TODO: act upon NOTE in #18.7 for canonical PER */
if(SEQUENCE_handle_extensions(td, sptr, po, 0) != n_extensions)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
ASN_DEBUG("Writing %d extensions", n_extensions);
/* #18.9. Encode extensions as open type fields. */
if(SEQUENCE_handle_extensions(td, sptr, 0, po) != n_extensions)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
}