Skip to content

Commit f4a1f58

Browse files
committed
Add aper_encode_to_buffer()
1 parent 755538f commit f4a1f58

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

skeletons/per_encoder.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ _uper_encode_flush_outp(asn_per_outp_t *po) {
163163
return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
164164
}
165165

166+
asn_enc_rval_t
167+
aper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
168+
const asn_per_constraints_t *constraints,
169+
const void *sptr, void *buffer, size_t buffer_size) {
170+
enc_to_buf_arg key;
171+
172+
key.buffer = buffer;
173+
key.left = buffer_size;
174+
175+
if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
176+
177+
return aper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
178+
}
179+
166180
ssize_t
167181
aper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
168182
const asn_per_constraints_t *constraints,

0 commit comments

Comments
 (0)