aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/OCTET_STRING.c
diff options
context:
space:
mode:
Diffstat (limited to 'skeletons/OCTET_STRING.c')
-rw-r--r--skeletons/OCTET_STRING.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c
index 5d603290..5420dede 100644
--- a/skeletons/OCTET_STRING.c
+++ b/skeletons/OCTET_STRING.c
@@ -548,7 +548,7 @@ OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
if(!cb) {
er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size;
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
}
/*
@@ -557,23 +557,23 @@ OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
if(type_variant == ASN_OSUBV_BIT) {
uint8_t b = st->bits_unused & 0x07;
if(b && st->size) fix_last_byte = 1;
- _ASN_CALLBACK(&b, 1);
+ ASN__CALLBACK(&b, 1);
er.encoded++;
}
/* Invoke callback for the main part of the buffer */
- _ASN_CALLBACK(st->buf, st->size - fix_last_byte);
+ ASN__CALLBACK(st->buf, st->size - fix_last_byte);
/* The last octet should be stripped off the unused bits */
if(fix_last_byte) {
uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused);
- _ASN_CALLBACK(&b, 1);
+ ASN__CALLBACK(&b, 1);
}
er.encoded += st->size;
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
cb_failed:
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
asn_enc_rval_t
@@ -590,7 +590,7 @@ OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
size_t i;
if(!st || (!st->buf && st->size))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
er.encoded = 0;
@@ -603,7 +603,7 @@ OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
char *scend = scratch + (sizeof(scratch) - 2);
for(; buf < end; buf++) {
if(p >= scend) {
- _ASN_CALLBACK(scratch, p - scratch);
+ ASN__CALLBACK(scratch, p - scratch);
er.encoded += p - scratch;
p = scratch;
}
@@ -611,12 +611,12 @@ OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
*p++ = h2c[*buf & 0x0F];
}
- _ASN_CALLBACK(scratch, p-scratch); /* Dump the rest */
+ ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */
er.encoded += p - scratch;
} else {
for(i = 0; buf < end; buf++, i++) {
if(!(i % 16) && (i || st->size > 16)) {
- _ASN_CALLBACK(scratch, p-scratch);
+ ASN__CALLBACK(scratch, p-scratch);
er.encoded += (p-scratch);
p = scratch;
ASN__TEXT_INDENT(1, ilevel);
@@ -627,16 +627,16 @@ OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
}
if(p - scratch) {
p--; /* Remove the tail space */
- _ASN_CALLBACK(scratch, p-scratch); /* Dump the rest */
+ ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */
er.encoded += p - scratch;
if(st->size > 16)
ASN__TEXT_INDENT(1, ilevel-1);
}
}
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
cb_failed:
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
static const struct OCTET_STRING__xer_escape_table_s {
@@ -746,7 +746,7 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
(void)flags; /* Unused argument */
if(!st || (!st->buf && st->size))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
buf = st->buf;
end = buf + st->size;
@@ -763,7 +763,7 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
if(((buf - ss) && cb(ss, buf - ss, app_key) < 0)
|| cb(OCTET_STRING__xer_escape_table[ch].string, s_len,
app_key) < 0)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
encoded_len += (buf - ss) + s_len;
ss = buf + 1;
}
@@ -771,10 +771,10 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
encoded_len += (buf - ss);
if((buf - ss) && cb(ss, buf - ss, app_key) < 0)
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
er.encoded = encoded_len;
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
}
/*
@@ -1520,7 +1520,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
int ct_extensible;
if(!st || (!st->buf && st->size))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
if(pc) {
cval = &pc->value;
@@ -1534,7 +1534,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
switch(specs->subvariant) {
default:
case ASN_OSUBV_ANY:
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
case ASN_OSUBV_BIT:
canonical_unit_bits = unit_bits = 1;
bpc = OS__BPC_BIT;
@@ -1582,7 +1582,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
unit_bits = canonical_unit_bits;
inext = 1;
} else
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
} else {
inext = 0;
@@ -1591,7 +1591,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
if(ct_extensible) {
/* Declare whether length is [not] within extension root */
if(per_put_few_bits(po, inext, 1))
- _ASN_ENCODE_FAILED;
+ ASN__ENCODE_FAILED;
}
/* X.691, #16.5: zero-length encoding */
@@ -1603,7 +1603,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
csiz->effective_bits);
ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound,
csiz->effective_bits);
- if(ret) _ASN_ENCODE_FAILED;
+ if(ret) ASN__ENCODE_FAILED;
if(bpc) {
ret = OCTET_STRING_per_put_characters(po, st->buf,
sizeinunits, bpc, unit_bits,
@@ -1612,22 +1612,22 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
ret = per_put_many_bits(po, st->buf,
sizeinunits * unit_bits);
}
- if(ret) _ASN_ENCODE_FAILED;
- _ASN_ENCODED_OK(er);
+ if(ret) ASN__ENCODE_FAILED;
+ ASN__ENCODED_OK(er);
}
ASN_DEBUG("Encoding %d bytes", st->size);
if(sizeinunits == 0) {
if(uper_put_length(po, 0))
- _ASN_ENCODE_FAILED;
- _ASN_ENCODED_OK(er);
+ ASN__ENCODE_FAILED;
+ ASN__ENCODED_OK(er);
}
buf = st->buf;
while(sizeinunits) {
ssize_t maySave = uper_put_length(po, sizeinunits);
- if(maySave < 0) _ASN_ENCODE_FAILED;
+ if(maySave < 0) ASN__ENCODE_FAILED;
ASN_DEBUG("Encoding %ld of %ld",
(long)maySave, (long)sizeinunits);
@@ -1639,7 +1639,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
} else {
ret = per_put_many_bits(po, buf, maySave * unit_bits);
}
- if(ret) _ASN_ENCODE_FAILED;
+ if(ret) ASN__ENCODE_FAILED;
if(bpc)
buf += maySave * bpc;
@@ -1649,7 +1649,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
assert(!(maySave & 0x07) || !sizeinunits);
}
- _ASN_ENCODED_OK(er);
+ ASN__ENCODED_OK(er);
}
int