aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/NULL.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-10-22 08:20:32 +0000
committerLev Walkin <vlm@lionet.info>2004-10-22 08:20:32 +0000
commitb8ec15dc188b472b3212a71238eb5338b851c39b (patch)
tree3c1b341a130605a71abbd078938e5f350156e711 /skeletons/NULL.c
parentdde25b3e7be8122b4712c18977667091e73fdc58 (diff)
NULL XER encoding
Diffstat (limited to 'skeletons/NULL.c')
-rw-r--r--skeletons/NULL.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/skeletons/NULL.c b/skeletons/NULL.c
index 3b41be2f..8cccc66c 100644
--- a/skeletons/NULL.c
+++ b/skeletons/NULL.c
@@ -3,6 +3,7 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
+#include <asn_codecs_prim.h>
#include <NULL.h>
#include <BOOLEAN.h> /* Implemented in terms of BOOLEAN type */
@@ -20,8 +21,8 @@ asn_TYPE_descriptor_t asn_DEF_NULL = {
asn_generic_no_constraint,
BOOLEAN_decode_ber, /* Implemented in terms of BOOLEAN */
NULL_encode_der, /* Special handling of DER encoding */
- 0, /* Not implemented yet */
- NULL_encode_xer, /* Special handling of DER encoding */
+ NULL_decode_xer,
+ NULL_encode_xer,
0, /* Use generic outmost tag fetcher */
asn_DEF_NULL_tags,
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
@@ -65,6 +66,25 @@ NULL_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
return er;
}
+
+static ssize_t
+NULL__xer_body_decode(void *sptr, void *chunk_buf, size_t chunk_size) {
+ (void)sptr;
+ if(xer_is_whitespace(chunk_buf, chunk_size))
+ return chunk_size;
+ return -1;
+}
+
+asn_dec_rval_t
+NULL_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+ asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
+ void *buf_ptr, size_t size) {
+
+ return xer_decode_primitive(opt_codec_ctx, td,
+ sptr, sizeof(NULL_t), opt_mname, buf_ptr, size,
+ NULL__xer_body_decode);
+}
+
int
NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {