Commit cd8f1e03 authored by Lev Walkin's avatar Lev Walkin

uper_encode() with NULL callback to ignore output and return the number of bits

parent 1a49ced9
...@@ -4,6 +4,14 @@ ...@@ -4,6 +4,14 @@
static int _uper_encode_flush_outp(asn_per_outp_t *po); static int _uper_encode_flush_outp(asn_per_outp_t *po);
static int
ignore_output(const void *data, size_t size, void *app_key) {
(void)data;
(void)size;
(void)app_key;
return 0;
}
asn_enc_rval_t asn_enc_rval_t
uper_encode(const asn_TYPE_descriptor_t *td, uper_encode(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr, const asn_per_constraints_t *constraints, const void *sptr,
...@@ -20,7 +28,7 @@ uper_encode(const asn_TYPE_descriptor_t *td, ...@@ -20,7 +28,7 @@ uper_encode(const asn_TYPE_descriptor_t *td,
po.buffer = po.tmpspace; po.buffer = po.tmpspace;
po.nboff = 0; po.nboff = 0;
po.nbits = 8 * sizeof(po.tmpspace); po.nbits = 8 * sizeof(po.tmpspace);
po.output = cb; po.output = cb ? cb : ignore_output;
po.op_key = app_key; po.op_key = app_key;
po.flushed_bytes = 0; po.flushed_bytes = 0;
......
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