2 * Copyright (c) 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
5 #ifndef _PER_ENCODER_H_
6 #define _PER_ENCODER_H_
8 #include <asn_application.h>
9 #include <per_support.h>
15 struct asn_TYPE_descriptor_s; /* Forward declaration */
18 * Unaligned PER encoder of any ASN.1 type. May be invoked by the application.
20 asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor,
21 void *struct_ptr, /* Structure to be encoded */
22 asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */
23 void *app_key /* Arbitrary callback argument */
26 /* A variant of uper_encode() which encodes data into the existing buffer */
27 asn_enc_rval_t uper_encode_to_buffer(
28 struct asn_TYPE_descriptor_s *type_descriptor,
29 void *struct_ptr, /* Structure to be encoded */
30 void *buffer, /* Pre-allocated buffer */
31 size_t buffer_size /* Initial buffer size (max) */
36 * Type of the generic PER encoder function.
38 typedef asn_enc_rval_t (per_type_encoder_f)(
39 struct asn_TYPE_descriptor_s *type_descriptor,
40 asn_per_constraints_t *constraints,
42 asn_per_outp_t *per_output
49 #endif /* _PER_ENCODER_H_ */