asn1_* renamed into asn_*


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@446 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/skeletons/ANY.c b/skeletons/ANY.c
index 1825da1..ae19ab5 100644
--- a/skeletons/ANY.c
+++ b/skeletons/ANY.c
@@ -7,7 +7,7 @@
 #include <assert.h>
 #include <errno.h>
 
-asn1_TYPE_descriptor_t asn1_DEF_ANY = {
+asn_TYPE_descriptor_t asn_DEF_ANY = {
 	"ANY",
 	OCTET_STRING_free,
 	OCTET_STRING_print,
@@ -24,7 +24,7 @@
 
 
 asn_enc_rval_t
-ANY_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+ANY_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 
@@ -48,7 +48,7 @@
 static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
 
 int
-ANY_fromType(ANY_t *st, asn1_TYPE_descriptor_t *td, void *sptr) {
+ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
 	struct _callback_arg arg;
 	asn_enc_rval_t erval;
 
@@ -81,7 +81,7 @@
 }
 
 ANY_t *
-ANY_new_fromType(asn1_TYPE_descriptor_t *td, void *sptr) {
+ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
 	ANY_t tmp;
 	ANY_t *st;
 
@@ -105,7 +105,7 @@
 }
 
 int
-ANY_to_type(ANY_t *st, asn1_TYPE_descriptor_t *td, void **struct_ptr) {
+ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
 	ber_dec_rval_t rval;
 	void *newst = 0;
 
@@ -120,7 +120,7 @@
 		return 0;
 	}
 
-	rval = ber_decode(td, (void **)&newst, st->buf, st->size);
+	rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
 	if(rval.code == RC_OK) {
 		*struct_ptr = newst;
 		return 0;
diff --git a/skeletons/ANY.h b/skeletons/ANY.h
index ae62596..588f295 100644
--- a/skeletons/ANY.h
+++ b/skeletons/ANY.h
@@ -11,10 +11,10 @@
 	uint8_t *buf;	/* BER-encoded ANY contents */
 	int size;	/* Size of the above buffer */
 
-	ber_dec_ctx_t _ber_dec_ctx;	/* Parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
 } ANY_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_ANY;
+extern asn_TYPE_descriptor_t asn_DEF_ANY;
 
 asn_struct_free_f ANY_free;
 asn_struct_print_f ANY_print;
@@ -27,11 +27,11 @@
  ******************************/
 
 /* Convert another ASN.1 type into the ANY. This implies DER encoding. */
-int ANY_fromType(ANY_t *, asn1_TYPE_descriptor_t *td, void *struct_ptr);
-ANY_t *ANY_new_fromType(asn1_TYPE_descriptor_t *td, void *struct_ptr);
+int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
+ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
 
 /* Convert the contents of the ANY type into the specified type. */
-int ANY_to_type(ANY_t *, asn1_TYPE_descriptor_t *td, void **struct_ptr);
+int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
 
 #define	ANY_fromBuf(s, buf, size)	OCTET_STRING_fromBuf((s), (buf), (size))
 #define	ANY_new_fromBuf(buf, size)	OCTET_STRING_new_fromBuf((buf), (size))
diff --git a/skeletons/BIT_STRING.c b/skeletons/BIT_STRING.c
index e0e2507..b3b77d1 100644
--- a/skeletons/BIT_STRING.c
+++ b/skeletons/BIT_STRING.c
@@ -9,10 +9,10 @@
 /*
  * BIT STRING basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_BIT_STRING_tags[] = {
+static ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_BIT_STRING = {
+asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
 	"BIT STRING",
 	OCTET_STRING_free,         /* Implemented in terms of OCTET STRING */
 	BIT_STRING_print,
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	BIT_STRING_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_BIT_STRING_tags,
-	sizeof(asn1_DEF_BIT_STRING_tags)
-	  / sizeof(asn1_DEF_BIT_STRING_tags[0]),
-	asn1_DEF_BIT_STRING_tags,	/* Same as above */
-	sizeof(asn1_DEF_BIT_STRING_tags)
-	  / sizeof(asn1_DEF_BIT_STRING_tags[0]),
+	asn_DEF_BIT_STRING_tags,
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	asn_DEF_BIT_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
 	0, 0,	/* No members */
 	(void *)1	/* Special indicator that this is a BIT STRING */
 };
@@ -36,7 +36,7 @@
  * BIT STRING generic constraint.
  */
 int
-BIT_STRING_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+BIT_STRING_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
 
@@ -70,7 +70,7 @@
 };
 
 asn_enc_rval_t
-BIT_STRING_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+BIT_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
@@ -118,7 +118,7 @@
 		int mbit = st->buf[0];	/* bits to skip from the right */
 		int i;
 		for(i = 7; i >= mbit; i--)
-			*p++ = (v & (1 << i)) ? '1' : '0';
+			*p++ = (v & (1 << i)) ? 0x31 : 0x30;
 		er.encoded += p - scratch;
 		_ASN_CALLBACK(scratch, p - scratch);
 	}
@@ -133,7 +133,7 @@
  * BIT STRING specific contents printer.
  */
 int
-BIT_STRING_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+BIT_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	static const char *h2c = "0123456789ABCDEF";
 	char scratch[64];
diff --git a/skeletons/BIT_STRING.h b/skeletons/BIT_STRING.h
index ff622a3..665d036 100644
--- a/skeletons/BIT_STRING.h
+++ b/skeletons/BIT_STRING.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t BIT_STRING_t; /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_BIT_STRING;
+extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
 
 asn_struct_print_f BIT_STRING_print;	/* Human-readable output */
 asn_constr_check_f BIT_STRING_constraint;
diff --git a/skeletons/BMPString.c b/skeletons/BMPString.c
index 2a11299..e03d334 100644
--- a/skeletons/BMPString.c
+++ b/skeletons/BMPString.c
@@ -8,11 +8,11 @@
 /*
  * BMPString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_BMPString_tags[] = {
+static ber_tlv_tag_t asn_DEF_BMPString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (30 << 2)),	/* [UNIVERSAL 30] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_BMPString = {
+asn_TYPE_descriptor_t asn_DEF_BMPString = {
 	"BMPString",
 	OCTET_STRING_free,          /* Implemented in terms of OCTET STRING */
 	BMPString_print,
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	BMPString_encode_xer,		/* Conver to UTF8 */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_BMPString_tags,
-	sizeof(asn1_DEF_BMPString_tags)
-	  / sizeof(asn1_DEF_BMPString_tags[0]) - 1,
-	asn1_DEF_BMPString_tags,
-	sizeof(asn1_DEF_BMPString_tags)
-	  / sizeof(asn1_DEF_BMPString_tags[0]),
+	asn_DEF_BMPString_tags,
+	sizeof(asn_DEF_BMPString_tags)
+	  / sizeof(asn_DEF_BMPString_tags[0]) - 1,
+	asn_DEF_BMPString_tags,
+	sizeof(asn_DEF_BMPString_tags)
+	  / sizeof(asn_DEF_BMPString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -74,7 +74,7 @@
 }
 
 asn_enc_rval_t
-BMPString_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+BMPString_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const BMPString_t *st = (const BMPString_t *)sptr;
@@ -93,7 +93,7 @@
 }
 
 int
-BMPString_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+BMPString_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const BMPString_t *st = (const BMPString_t *)sptr;
 
diff --git a/skeletons/BMPString.h b/skeletons/BMPString.h
index 2860e6b..3ff2baf 100644
--- a/skeletons/BMPString.h
+++ b/skeletons/BMPString.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t BMPString_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_BMPString;
+extern asn_TYPE_descriptor_t asn_DEF_BMPString;
 
 asn_struct_print_f BMPString_print;	/* Human-readable output */
 xer_type_encoder_f BMPString_encode_xer;
diff --git a/skeletons/BOOLEAN.c b/skeletons/BOOLEAN.c
index ef6926a..992b9a8 100644
--- a/skeletons/BOOLEAN.c
+++ b/skeletons/BOOLEAN.c
@@ -8,10 +8,10 @@
 /*
  * BOOLEAN basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_BOOLEAN_tags[] = {
+static ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_BOOLEAN = {
+asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
 	"BOOLEAN",
 	BOOLEAN_free,
 	BOOLEAN_print,
@@ -21,10 +21,10 @@
 	0,				/* Not implemented yet */
 	BOOLEAN_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_BOOLEAN_tags,
-	sizeof(asn1_DEF_BOOLEAN_tags) / sizeof(asn1_DEF_BOOLEAN_tags[0]),
-	asn1_DEF_BOOLEAN_tags,	/* Same as above */
-	sizeof(asn1_DEF_BOOLEAN_tags) / sizeof(asn1_DEF_BOOLEAN_tags[0]),
+	asn_DEF_BOOLEAN_tags,
+	sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
+	asn_DEF_BOOLEAN_tags,	/* Same as above */
+	sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -33,7 +33,8 @@
  * Decode BOOLEAN type.
  */
 ber_dec_rval_t
-BOOLEAN_decode_ber(asn1_TYPE_descriptor_t *td,
+BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+		asn_TYPE_descriptor_t *td,
 		void **bool_value, void *buf_ptr, size_t size,
 		int tag_mode) {
 	BOOLEAN_t *st = (BOOLEAN_t *)*bool_value;
@@ -56,7 +57,8 @@
 	/*
 	 * Check tags.
 	 */
-	rval = ber_check_tags(td, 0, buf_ptr, size, tag_mode, 0, &length, 0);
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+		tag_mode, 0, &length, 0);
 	if(rval.code != RC_OK)
 		return rval;
 
@@ -94,7 +96,7 @@
 }
 
 asn_enc_rval_t
-BOOLEAN_encode_der(asn1_TYPE_descriptor_t *td, void *sptr,
+BOOLEAN_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
@@ -126,7 +128,7 @@
 }
 
 asn_enc_rval_t
-BOOLEAN_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+BOOLEAN_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
@@ -149,7 +151,7 @@
 }
 
 int
-BOOLEAN_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+BOOLEAN_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
 	const char *buf;
@@ -175,7 +177,7 @@
 }
 
 void
-BOOLEAN_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+BOOLEAN_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
 	if(td && ptr && !contents_only) {
 		FREEMEM(ptr);
 	}
diff --git a/skeletons/BOOLEAN.h b/skeletons/BOOLEAN.h
index 2b195dc..217d36f 100644
--- a/skeletons/BOOLEAN.h
+++ b/skeletons/BOOLEAN.h
@@ -14,7 +14,7 @@
  */
 typedef int BOOLEAN_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_BOOLEAN;
+extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN;
 
 asn_struct_free_f BOOLEAN_free;
 asn_struct_print_f BOOLEAN_print;
diff --git a/skeletons/ENUMERATED.c b/skeletons/ENUMERATED.c
index 821a467..13d7e05 100644
--- a/skeletons/ENUMERATED.c
+++ b/skeletons/ENUMERATED.c
@@ -9,10 +9,10 @@
 /*
  * ENUMERATED basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_ENUMERATED_tags[] = {
+static ber_tlv_tag_t asn_DEF_ENUMERATED_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_ENUMERATED = {
+asn_TYPE_descriptor_t asn_DEF_ENUMERATED = {
 	"ENUMERATED",
 	ASN__PRIMITIVE_TYPE_free,
 	INTEGER_print,			/* Implemented in terms of INTEGER */
@@ -22,10 +22,10 @@
 	0,				/* Not implemented yet */
 	INTEGER_encode_xer,		/* Implemented in terms of INTEGER */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_ENUMERATED_tags,
-	sizeof(asn1_DEF_ENUMERATED_tags) / sizeof(asn1_DEF_ENUMERATED_tags[0]),
-	asn1_DEF_ENUMERATED_tags,	/* Same as above */
-	sizeof(asn1_DEF_ENUMERATED_tags) / sizeof(asn1_DEF_ENUMERATED_tags[0]),
+	asn_DEF_ENUMERATED_tags,
+	sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]),
+	asn_DEF_ENUMERATED_tags,	/* Same as above */
+	sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/ENUMERATED.h b/skeletons/ENUMERATED.h
index b926eb2..45733cb 100644
--- a/skeletons/ENUMERATED.h
+++ b/skeletons/ENUMERATED.h
@@ -9,6 +9,6 @@
 
 typedef INTEGER_t ENUMERATED_t;		/* Implemented via INTEGER */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_ENUMERATED;
+extern asn_TYPE_descriptor_t asn_DEF_ENUMERATED;
 
 #endif	/* _ENUMERATED_H_ */
diff --git a/skeletons/GeneralString.c b/skeletons/GeneralString.c
index 02c1c7e..f846c02 100644
--- a/skeletons/GeneralString.c
+++ b/skeletons/GeneralString.c
@@ -8,11 +8,11 @@
 /*
  * GeneralString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_GeneralString_tags[] = {
+static ber_tlv_tag_t asn_DEF_GeneralString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (27 << 2)),	/* [UNIVERSAL 27] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_GeneralString = {
+asn_TYPE_descriptor_t asn_DEF_GeneralString = {
 	"GeneralString",
 	OCTET_STRING_free,
 	OCTET_STRING_print,         /* non-ascii string */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer,    /* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_GeneralString_tags,
-	sizeof(asn1_DEF_GeneralString_tags)
-	  / sizeof(asn1_DEF_GeneralString_tags[0]) - 1,
-	asn1_DEF_GeneralString_tags,
-	sizeof(asn1_DEF_GeneralString_tags)
-	  / sizeof(asn1_DEF_GeneralString_tags[0]),
+	asn_DEF_GeneralString_tags,
+	sizeof(asn_DEF_GeneralString_tags)
+	  / sizeof(asn_DEF_GeneralString_tags[0]) - 1,
+	asn_DEF_GeneralString_tags,
+	sizeof(asn_DEF_GeneralString_tags)
+	  / sizeof(asn_DEF_GeneralString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/GeneralString.h b/skeletons/GeneralString.h
index d8d07e9..d284674 100644
--- a/skeletons/GeneralString.h
+++ b/skeletons/GeneralString.h
@@ -9,6 +9,6 @@
 
 typedef OCTET_STRING_t GeneralString_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_GeneralString;
+extern asn_TYPE_descriptor_t asn_DEF_GeneralString;
 
 #endif	/* _GeneralString_H_ */
diff --git a/skeletons/GeneralizedTime.c b/skeletons/GeneralizedTime.c
index 161898f..631f3ed 100644
--- a/skeletons/GeneralizedTime.c
+++ b/skeletons/GeneralizedTime.c
@@ -109,12 +109,12 @@
 /*
  * GeneralizedTime basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_GeneralizedTime_tags[] = {
+static ber_tlv_tag_t asn_DEF_GeneralizedTime_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (24 << 2)),	/* [UNIVERSAL 24] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),  /* [UNIVERSAL 26] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))    /* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_GeneralizedTime = {
+asn_TYPE_descriptor_t asn_DEF_GeneralizedTime = {
 	"GeneralizedTime",
 	OCTET_STRING_free,
 	GeneralizedTime_print,
@@ -124,12 +124,12 @@
 	0,				/* Not implemented yet */
 	GeneralizedTime_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_GeneralizedTime_tags,
-	sizeof(asn1_DEF_GeneralizedTime_tags)
-	  / sizeof(asn1_DEF_GeneralizedTime_tags[0]) - 2,
-	asn1_DEF_GeneralizedTime_tags,
-	sizeof(asn1_DEF_GeneralizedTime_tags)
-	  / sizeof(asn1_DEF_GeneralizedTime_tags[0]),
+	asn_DEF_GeneralizedTime_tags,
+	sizeof(asn_DEF_GeneralizedTime_tags)
+	  / sizeof(asn_DEF_GeneralizedTime_tags[0]) - 2,
+	asn_DEF_GeneralizedTime_tags,
+	sizeof(asn_DEF_GeneralizedTime_tags)
+	  / sizeof(asn_DEF_GeneralizedTime_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -140,7 +140,7 @@
  * Check that the time looks like the time.
  */
 int
-GeneralizedTime_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+GeneralizedTime_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const GeneralizedTime_t *st = (const GeneralizedTime_t *)sptr;
 	time_t tloc;
@@ -158,14 +158,14 @@
 }
 
 asn_enc_rval_t
-GeneralizedTime_encode_der(asn1_TYPE_descriptor_t *td, void *ptr,
+GeneralizedTime_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	GeneralizedTime_t *st = (GeneralizedTime_t *)ptr;
 	asn_enc_rval_t erval;
 
 	/* If not canonical DER, re-encode into canonical DER. */
-	if(st->size && st->buf[st->size-1] != 'Z') {
+	if(st->size && st->buf[st->size-1] != 0x5a) {
 		struct tm tm;
 		time_t tloc;
 
@@ -199,7 +199,7 @@
 }
 
 asn_enc_rval_t
-GeneralizedTime_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+GeneralizedTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	OCTET_STRING_t st;
@@ -229,7 +229,7 @@
 }
 
 int
-GeneralizedTime_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+GeneralizedTime_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const GeneralizedTime_t *st = (const GeneralizedTime_t *)sptr;
 
@@ -445,7 +445,7 @@
 		tloc = timegm(&tm_s);
 	} else {
 		/*
-		 * Without an offset (or 'Z'),
+		 * Without an offset (or "Z"),
 		 * we can only guess that it is a local zone.
 		 * Interpret it in this fashion.
 		 */
@@ -523,7 +523,7 @@
 
 	p = buf + size;
 	if(force_gmt) {
-		*p++ = 0x5a;	/* 'Z' */
+		*p++ = 0x5a;	/* "Z" */
 		*p++ = 0;
 		size++;
 	} else {
diff --git a/skeletons/GeneralizedTime.h b/skeletons/GeneralizedTime.h
index 6681183..21a680c 100644
--- a/skeletons/GeneralizedTime.h
+++ b/skeletons/GeneralizedTime.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t GeneralizedTime_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_GeneralizedTime;
+extern asn_TYPE_descriptor_t asn_DEF_GeneralizedTime;
 
 asn_struct_print_f GeneralizedTime_print;
 asn_constr_check_f GeneralizedTime_constraint;
@@ -36,7 +36,7 @@
  * Convert a struct tm into GeneralizedTime.
  * If __opt_gt is not given, this function will try to allocate one.
  * If force_gmt is given, the resulting GeneralizedTime will be forced
- * into a GMT time zone (encoding ends with 'Z').
+ * into a GMT time zone (encoding ends with a "Z").
  * On error, this function returns 0 and sets errno.
  */
 GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *__opt_gt, const struct tm *,
diff --git a/skeletons/GraphicString.c b/skeletons/GraphicString.c
index 98a8d48..67442fc 100644
--- a/skeletons/GraphicString.c
+++ b/skeletons/GraphicString.c
@@ -8,11 +8,11 @@
 /*
  * GraphicString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_GraphicString_tags[] = {
+static ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)),	/* [UNIVERSAL 25] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_GraphicString = {
+asn_TYPE_descriptor_t asn_DEF_GraphicString = {
 	"GraphicString",
 	OCTET_STRING_free,
 	OCTET_STRING_print,         /* non-ascii string */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer,    /* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_GraphicString_tags,
-	sizeof(asn1_DEF_GraphicString_tags)
-	  / sizeof(asn1_DEF_GraphicString_tags[0]) - 1,
-	asn1_DEF_GraphicString_tags,
-	sizeof(asn1_DEF_GraphicString_tags)
-	  / sizeof(asn1_DEF_GraphicString_tags[0]),
+	asn_DEF_GraphicString_tags,
+	sizeof(asn_DEF_GraphicString_tags)
+	  / sizeof(asn_DEF_GraphicString_tags[0]) - 1,
+	asn_DEF_GraphicString_tags,
+	sizeof(asn_DEF_GraphicString_tags)
+	  / sizeof(asn_DEF_GraphicString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/GraphicString.h b/skeletons/GraphicString.h
index 64fcf64..ac78f3e 100644
--- a/skeletons/GraphicString.h
+++ b/skeletons/GraphicString.h
@@ -9,6 +9,6 @@
 
 typedef OCTET_STRING_t GraphicString_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_GraphicString;
+extern asn_TYPE_descriptor_t asn_DEF_GraphicString;
 
 #endif	/* _GraphicString_H_ */
diff --git a/skeletons/IA5String.c b/skeletons/IA5String.c
index e9d2a61..42eb17c 100644
--- a/skeletons/IA5String.c
+++ b/skeletons/IA5String.c
@@ -8,11 +8,11 @@
 /*
  * IA5String basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_IA5String_tags[] = {
+static ber_tlv_tag_t asn_DEF_IA5String_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),	/* [UNIVERSAL 22] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_IA5String = {
+asn_TYPE_descriptor_t asn_DEF_IA5String = {
 	"IA5String",
 	OCTET_STRING_free,
 	OCTET_STRING_print_ascii,  /* ASCII subset */
@@ -22,18 +22,18 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,/* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_IA5String_tags,
-	sizeof(asn1_DEF_IA5String_tags)
-	  / sizeof(asn1_DEF_IA5String_tags[0]) - 1,
-	asn1_DEF_IA5String_tags,
-	sizeof(asn1_DEF_IA5String_tags)
-	  / sizeof(asn1_DEF_IA5String_tags[0]),
+	asn_DEF_IA5String_tags,
+	sizeof(asn_DEF_IA5String_tags)
+	  / sizeof(asn_DEF_IA5String_tags[0]) - 1,
+	asn_DEF_IA5String_tags,
+	sizeof(asn_DEF_IA5String_tags)
+	  / sizeof(asn_DEF_IA5String_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
 
 int
-IA5String_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+IA5String_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const IA5String_t *st = (const IA5String_t *)sptr;
 
diff --git a/skeletons/IA5String.h b/skeletons/IA5String.h
index 6c40a95..c20bc6b 100644
--- a/skeletons/IA5String.h
+++ b/skeletons/IA5String.h
@@ -12,7 +12,7 @@
 /*
  * IA5String ASN.1 type definition.
  */
-extern asn1_TYPE_descriptor_t asn1_DEF_IA5String;
+extern asn_TYPE_descriptor_t asn_DEF_IA5String;
 
 asn_constr_check_f IA5String_constraint;
 
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index 89be79e..f485bac 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -11,10 +11,10 @@
 /*
  * INTEGER basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_INTEGER_tags[] = {
+static ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_INTEGER = {
+asn_TYPE_descriptor_t asn_DEF_INTEGER = {
 	"INTEGER",
 	ASN__PRIMITIVE_TYPE_free,
 	INTEGER_print,
@@ -24,10 +24,10 @@
 	0,				/* Not implemented yet */
 	INTEGER_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_INTEGER_tags,
-	sizeof(asn1_DEF_INTEGER_tags) / sizeof(asn1_DEF_INTEGER_tags[0]),
-	asn1_DEF_INTEGER_tags,	/* Same as above */
-	sizeof(asn1_DEF_INTEGER_tags) / sizeof(asn1_DEF_INTEGER_tags[0]),
+	asn_DEF_INTEGER_tags,
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	asn_DEF_INTEGER_tags,	/* Same as above */
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -36,7 +36,7 @@
  * Encode INTEGER type using DER.
  */
 asn_enc_rval_t
-INTEGER_encode_der(asn1_TYPE_descriptor_t *td, void *sptr,
+INTEGER_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	INTEGER_t *st = (INTEGER_t *)sptr;
@@ -146,10 +146,10 @@
 		}
 		*p++ = h2c[*buf >> 4];
 		*p++ = h2c[*buf & 0x0F];
-		*p++ = ':';
+		*p++ = 0x3a;	/* ":" */
 	}
 	if(p != scratch)
-		p--;	/* Remove the last ':' */
+		p--;	/* Remove the last ":" */
 
 	wrote += p - scratch;
 	return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote;
@@ -159,7 +159,7 @@
  * INTEGER specific human-readable output.
  */
 int
-INTEGER_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+INTEGER_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const INTEGER_t *st = (const INTEGER_t *)sptr;
 	ssize_t ret;
@@ -176,7 +176,7 @@
 }
 
 asn_enc_rval_t
-INTEGER_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const INTEGER_t *st = (const INTEGER_t *)sptr;
@@ -195,7 +195,7 @@
 }
 
 int
-asn1_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
+asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
 	uint8_t *b, *end;
 	size_t size;
 	long l;
diff --git a/skeletons/INTEGER.h b/skeletons/INTEGER.h
index b42321b..eb7e9c9 100644
--- a/skeletons/INTEGER.h
+++ b/skeletons/INTEGER.h
@@ -10,7 +10,7 @@
 
 typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_INTEGER;
+extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
 
 asn_struct_print_f INTEGER_print;
 ber_type_decoder_f INTEGER_decode_ber;
@@ -26,6 +26,6 @@
  * -1/EINVAL: Mandatory argument missing
  * -1/ERANGE: Value encoded is out of range for long representation
  */
-int asn1_INTEGER2long(const INTEGER_t *i, long *l);
+int asn_INTEGER2long(const INTEGER_t *i, long *l);
 
 #endif	/* _INTEGER_H_ */
diff --git a/skeletons/ISO646String.c b/skeletons/ISO646String.c
index dd94be2..751139d 100644
--- a/skeletons/ISO646String.c
+++ b/skeletons/ISO646String.c
@@ -8,11 +8,11 @@
 /*
  * ISO646String basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_ISO646String_tags[] = {
+static ber_tlv_tag_t asn_DEF_ISO646String_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),	/* [UNIVERSAL 26] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_ISO646String = {
+asn_TYPE_descriptor_t asn_DEF_ISO646String = {
 	"ISO646String",
 	OCTET_STRING_free,
 	OCTET_STRING_print_ascii,   /* ASCII subset */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,/* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_ISO646String_tags,
-	sizeof(asn1_DEF_ISO646String_tags)
-	  / sizeof(asn1_DEF_ISO646String_tags[0]) - 1,
-	asn1_DEF_ISO646String_tags,
-	sizeof(asn1_DEF_ISO646String_tags)
-	  / sizeof(asn1_DEF_ISO646String_tags[0]),
+	asn_DEF_ISO646String_tags,
+	sizeof(asn_DEF_ISO646String_tags)
+	  / sizeof(asn_DEF_ISO646String_tags[0]) - 1,
+	asn_DEF_ISO646String_tags,
+	sizeof(asn_DEF_ISO646String_tags)
+	  / sizeof(asn_DEF_ISO646String_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/ISO646String.h b/skeletons/ISO646String.h
index c1ff80f..5c3c73a 100644
--- a/skeletons/ISO646String.h
+++ b/skeletons/ISO646String.h
@@ -10,6 +10,6 @@
 
 typedef VisibleString_t ISO646String_t;	/* Implemented using VisibleString */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_ISO646String;
+extern asn_TYPE_descriptor_t asn_DEF_ISO646String;
 
 #endif	/* _ISO646String_H_ */
diff --git a/skeletons/NULL.c b/skeletons/NULL.c
index 8276368..7375d0f 100644
--- a/skeletons/NULL.c
+++ b/skeletons/NULL.c
@@ -9,10 +9,10 @@
 /*
  * NULL basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_NULL_tags[] = {
+static ber_tlv_tag_t asn_DEF_NULL_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_NULL = {
+asn_TYPE_descriptor_t asn_DEF_NULL = {
 	"NULL",
 	BOOLEAN_free,
 	NULL_print,
@@ -22,16 +22,16 @@
 	0,				/* Not implemented yet */
 	NULL_encode_xer,	/* Special handling of DER encoding */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_NULL_tags,
-	sizeof(asn1_DEF_NULL_tags) / sizeof(asn1_DEF_NULL_tags[0]),
-	asn1_DEF_NULL_tags,	/* Same as above */
-	sizeof(asn1_DEF_NULL_tags) / sizeof(asn1_DEF_NULL_tags[0]),
+	asn_DEF_NULL_tags,
+	sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
+	asn_DEF_NULL_tags,	/* Same as above */
+	sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
 
 asn_enc_rval_t
-NULL_encode_der(asn1_TYPE_descriptor_t *td, void *ptr,
+NULL_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
@@ -46,7 +46,7 @@
 }
 
 asn_enc_rval_t
-NULL_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+NULL_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
@@ -65,7 +65,7 @@
 }
 
 int
-NULL_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 
 	(void)td;	/* Unused argument */
diff --git a/skeletons/NULL.h b/skeletons/NULL.h
index 64c02f7..1a9f703 100644
--- a/skeletons/NULL.h
+++ b/skeletons/NULL.h
@@ -13,7 +13,7 @@
  */
 typedef int NULL_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_NULL;
+extern asn_TYPE_descriptor_t asn_DEF_NULL;
 
 asn_struct_print_f NULL_print;
 der_type_encoder_f NULL_encode_der;
diff --git a/skeletons/NativeEnumerated.c b/skeletons/NativeEnumerated.c
index bbbc3fb..19c7559 100644
--- a/skeletons/NativeEnumerated.c
+++ b/skeletons/NativeEnumerated.c
@@ -15,10 +15,10 @@
 /*
  * NativeEnumerated basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_NativeEnumerated_tags[] = {
+static ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_NativeEnumerated = {
+asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
 	"ENUMERATED",			/* The ASN.1 type is still ENUMERATED */
 	NativeInteger_free,
 	NativeInteger_print,
@@ -28,10 +28,10 @@
 	0,				/* Not implemented yet */
 	NativeInteger_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_NativeEnumerated_tags,
-	sizeof(asn1_DEF_NativeEnumerated_tags) / sizeof(asn1_DEF_NativeEnumerated_tags[0]),
-	asn1_DEF_NativeEnumerated_tags,	/* Same as above */
-	sizeof(asn1_DEF_NativeEnumerated_tags) / sizeof(asn1_DEF_NativeEnumerated_tags[0]),
+	asn_DEF_NativeEnumerated_tags,
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	asn_DEF_NativeEnumerated_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/NativeEnumerated.h b/skeletons/NativeEnumerated.h
index 681147c..2e6e1d0 100644
--- a/skeletons/NativeEnumerated.h
+++ b/skeletons/NativeEnumerated.h
@@ -14,6 +14,6 @@
 
 #include <NativeInteger.h>
 
-extern asn1_TYPE_descriptor_t asn1_DEF_NativeEnumerated;
+extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
 
 #endif	/* _NativeEnumerated_H_ */
diff --git a/skeletons/NativeInteger.c b/skeletons/NativeInteger.c
index 2310c07..ae71c04 100644
--- a/skeletons/NativeInteger.c
+++ b/skeletons/NativeInteger.c
@@ -17,10 +17,10 @@
 /*
  * NativeInteger basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_NativeInteger_tags[] = {
+static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_NativeInteger = {
+asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
 	"INTEGER",			/* The ASN.1 type is still INTEGER */
 	NativeInteger_free,
 	NativeInteger_print,
@@ -30,10 +30,10 @@
 	0,				/* Not implemented yet */
 	NativeInteger_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_NativeInteger_tags,
-	sizeof(asn1_DEF_NativeInteger_tags) / sizeof(asn1_DEF_NativeInteger_tags[0]),
-	asn1_DEF_NativeInteger_tags,	/* Same as above */
-	sizeof(asn1_DEF_NativeInteger_tags) / sizeof(asn1_DEF_NativeInteger_tags[0]),
+	asn_DEF_NativeInteger_tags,
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	asn_DEF_NativeInteger_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -42,7 +42,8 @@
  * Decode INTEGER type.
  */
 ber_dec_rval_t
-NativeInteger_decode_ber(asn1_TYPE_descriptor_t *td,
+NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+	asn_TYPE_descriptor_t *td,
 	void **int_ptr, void *buf_ptr, size_t size, int tag_mode) {
 	int *Int = (int *)*int_ptr;
 	ber_dec_rval_t rval;
@@ -66,7 +67,8 @@
 	/*
 	 * Check tags.
 	 */
-	rval = ber_check_tags(td, 0, buf_ptr, size, tag_mode, 0, &length, 0);
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
 	if(rval.code != RC_OK)
 		return rval;
 
@@ -94,7 +96,7 @@
 		tmp.buf = (uint8_t *)buf_ptr;
 		tmp.size = length;
 
-		if(asn1_INTEGER2long(&tmp, &l)) {
+		if(asn_INTEGER2long(&tmp, &l)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
 			return rval;
@@ -128,7 +130,7 @@
  * Encode the NativeInteger using the standard INTEGER type DER encoder.
  */
 asn_enc_rval_t
-NativeInteger_encode_der(asn1_TYPE_descriptor_t *sd, void *ptr,
+NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	unsigned int Int = *(unsigned int *)ptr;	/* Disable sign ext. */
@@ -162,7 +164,7 @@
 }
 
 asn_enc_rval_t
-NativeInteger_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	char scratch[32];	/* Enough for 64-bit int */
@@ -186,7 +188,7 @@
  * INTEGER specific human-readable output.
  */
 int
-NativeInteger_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const int *Int = (const int *)sptr;
 	char scratch[32];	/* Enough for 64-bit int */
@@ -205,7 +207,7 @@
 }
 
 void
-NativeInteger_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
 
 	if(!td || !ptr)
 		return;
diff --git a/skeletons/NativeInteger.h b/skeletons/NativeInteger.h
index 5c1e5e4..4de0d66 100644
--- a/skeletons/NativeInteger.h
+++ b/skeletons/NativeInteger.h
@@ -14,7 +14,7 @@
 
 #include <asn_application.h>
 
-extern asn1_TYPE_descriptor_t asn1_DEF_NativeInteger;
+extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
 
 asn_struct_free_f  NativeInteger_free;
 asn_struct_print_f NativeInteger_print;
diff --git a/skeletons/NativeReal.c b/skeletons/NativeReal.c
index 8fc9ca6..83b1676 100644
--- a/skeletons/NativeReal.c
+++ b/skeletons/NativeReal.c
@@ -17,10 +17,10 @@
 /*
  * NativeReal basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_NativeReal_tags[] = {
+static ber_tlv_tag_t asn_DEF_NativeReal_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_NativeReal = {
+asn_TYPE_descriptor_t asn_DEF_NativeReal = {
 	"REAL",			/* The ASN.1 type is still REAL */
 	NativeReal_free,
 	NativeReal_print,
@@ -30,10 +30,10 @@
 	0,				/* Not implemented yet */
 	NativeReal_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_NativeReal_tags,
-	sizeof(asn1_DEF_NativeReal_tags) / sizeof(asn1_DEF_NativeReal_tags[0]),
-	asn1_DEF_NativeReal_tags,	/* Same as above */
-	sizeof(asn1_DEF_NativeReal_tags) / sizeof(asn1_DEF_NativeReal_tags[0]),
+	asn_DEF_NativeReal_tags,
+	sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
+	asn_DEF_NativeReal_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -42,7 +42,8 @@
  * Decode REAL type.
  */
 ber_dec_rval_t
-NativeReal_decode_ber(asn1_TYPE_descriptor_t *td,
+NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+	asn_TYPE_descriptor_t *td,
 	void **dbl_ptr, void *buf_ptr, size_t size, int tag_mode) {
 	double *Dbl = (double *)*dbl_ptr;
 	ber_dec_rval_t rval;
@@ -66,7 +67,8 @@
 	/*
 	 * Check tags.
 	 */
-	rval = ber_check_tags(td, 0, buf_ptr, size, tag_mode, 0, &length, 0);
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
 	if(rval.code != RC_OK)
 		return rval;
 
@@ -94,7 +96,7 @@
 		tmp.buf = (uint8_t *)buf_ptr;
 		tmp.size = length;
 
-		if(asn1_REAL2double(&tmp, &d)) {
+		if(asn_REAL2double(&tmp, &d)) {
 			rval.code = RC_FAIL;
 			rval.consumed = 0;
 			return rval;
@@ -116,14 +118,14 @@
  * Encode the NativeReal using the standard REAL type DER encoder.
  */
 asn_enc_rval_t
-NativeReal_encode_der(asn1_TYPE_descriptor_t *td, void *ptr,
+NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	double Dbl = *(const double *)ptr;
 	asn_enc_rval_t erval;
 	REAL_t tmp;
 
-	if(asn1_double2REAL(&tmp, Dbl)) {
+	if(asn_double2REAL(&tmp, Dbl)) {
 		erval.encoded = -1;
 		erval.failed_type = td;
 		erval.structure_ptr = ptr;
@@ -141,7 +143,7 @@
 
 
 asn_enc_rval_t
-NativeReal_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+NativeReal_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const double *Dbl = (const double *)sptr;
@@ -161,7 +163,7 @@
  * REAL specific human-readable output.
  */
 int
-NativeReal_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+NativeReal_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const double *Dbl = (const double *)sptr;
 
@@ -174,7 +176,7 @@
 }
 
 void
-NativeReal_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+NativeReal_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
 
 	if(!td || !ptr)
 		return;
diff --git a/skeletons/NativeReal.h b/skeletons/NativeReal.h
index 2f3b0a6..b1c58bf 100644
--- a/skeletons/NativeReal.h
+++ b/skeletons/NativeReal.h
@@ -13,7 +13,7 @@
 
 #include <asn_application.h>
 
-extern asn1_TYPE_descriptor_t asn1_DEF_NativeReal;
+extern asn_TYPE_descriptor_t asn_DEF_NativeReal;
 
 asn_struct_free_f  NativeReal_free;
 asn_struct_print_f NativeReal_print;
diff --git a/skeletons/NumericString.c b/skeletons/NumericString.c
index fa43558..7d47198 100644
--- a/skeletons/NumericString.c
+++ b/skeletons/NumericString.c
@@ -8,11 +8,11 @@
 /*
  * NumericString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_NumericString_tags[] = {
+static ber_tlv_tag_t asn_DEF_NumericString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (18 << 2)),	/* [UNIVERSAL 18] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_NumericString = {
+asn_TYPE_descriptor_t asn_DEF_NumericString = {
 	"NumericString",
 	OCTET_STRING_free,
 	OCTET_STRING_print_ascii,   /* ASCII subset */
@@ -22,18 +22,18 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,/* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_NumericString_tags,
-	sizeof(asn1_DEF_NumericString_tags)
-	  / sizeof(asn1_DEF_NumericString_tags[0]) - 1,
-	asn1_DEF_NumericString_tags,
-	sizeof(asn1_DEF_NumericString_tags)
-	  / sizeof(asn1_DEF_NumericString_tags[0]),
+	asn_DEF_NumericString_tags,
+	sizeof(asn_DEF_NumericString_tags)
+	  / sizeof(asn_DEF_NumericString_tags[0]) - 1,
+	asn_DEF_NumericString_tags,
+	sizeof(asn_DEF_NumericString_tags)
+	  / sizeof(asn_DEF_NumericString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
 
 int
-NumericString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+NumericString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const NumericString_t *st = (const NumericString_t *)sptr;
 
diff --git a/skeletons/NumericString.h b/skeletons/NumericString.h
index 2e06255..5ace1dd 100644
--- a/skeletons/NumericString.h
+++ b/skeletons/NumericString.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t NumericString_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_NumericString;
+extern asn_TYPE_descriptor_t asn_DEF_NumericString;
 
 asn_constr_check_f NumericString_constraint;
 
diff --git a/skeletons/OBJECT_IDENTIFIER.c b/skeletons/OBJECT_IDENTIFIER.c
index 9e8f2e2..db2fd7a 100644
--- a/skeletons/OBJECT_IDENTIFIER.c
+++ b/skeletons/OBJECT_IDENTIFIER.c
@@ -11,10 +11,10 @@
 /*
  * OBJECT IDENTIFIER basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_OBJECT_IDENTIFIER_tags[] = {
+static ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (6 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_OBJECT_IDENTIFIER = {
+asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER = {
 	"OBJECT IDENTIFIER",
 	ASN__PRIMITIVE_TYPE_free,
 	OBJECT_IDENTIFIER_print,
@@ -24,19 +24,19 @@
 	0,				/* Not implemented yet */
 	OBJECT_IDENTIFIER_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_OBJECT_IDENTIFIER_tags,
-	sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags)
-	    / sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags[0]),
-	asn1_DEF_OBJECT_IDENTIFIER_tags,	/* Same as above */
-	sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags)
-	    / sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags[0]),
+	asn_DEF_OBJECT_IDENTIFIER_tags,
+	sizeof(asn_DEF_OBJECT_IDENTIFIER_tags)
+	    / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]),
+	asn_DEF_OBJECT_IDENTIFIER_tags,	/* Same as above */
+	sizeof(asn_DEF_OBJECT_IDENTIFIER_tags)
+	    / sizeof(asn_DEF_OBJECT_IDENTIFIER_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
 
 
 int
-OBJECT_IDENTIFIER_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+OBJECT_IDENTIFIER_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr;
 
@@ -263,7 +263,7 @@
 }
 
 asn_enc_rval_t
-OBJECT_IDENTIFIER_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+OBJECT_IDENTIFIER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr;
@@ -282,7 +282,7 @@
 }
 
 int
-OBJECT_IDENTIFIER_print(asn1_TYPE_descriptor_t *td, const void *sptr,
+OBJECT_IDENTIFIER_print(asn_TYPE_descriptor_t *td, const void *sptr,
 	int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
 	const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr;
 
diff --git a/skeletons/OBJECT_IDENTIFIER.h b/skeletons/OBJECT_IDENTIFIER.h
index 3ccbc64..8945a32 100644
--- a/skeletons/OBJECT_IDENTIFIER.h
+++ b/skeletons/OBJECT_IDENTIFIER.h
@@ -10,7 +10,7 @@
 
 typedef ASN__PRIMITIVE_TYPE_t OBJECT_IDENTIFIER_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_OBJECT_IDENTIFIER;
+extern asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER;
 
 asn_struct_print_f OBJECT_IDENTIFIER_print;
 asn_constr_check_f OBJECT_IDENTIFIER_constraint;
diff --git a/skeletons/OCTET_STRING.h b/skeletons/OCTET_STRING.h
index 3c4509b..7291585 100644
--- a/skeletons/OCTET_STRING.h
+++ b/skeletons/OCTET_STRING.h
@@ -11,10 +11,10 @@
 	uint8_t *buf;	/* Buffer with consecutive OCTET_STRING bits */
 	int size;	/* Size of the buffer */
 
-	ber_dec_ctx_t _ber_dec_ctx;	/* Parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
 } OCTET_STRING_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING;
+extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING;
 
 asn_struct_free_f OCTET_STRING_free;
 asn_struct_print_f OCTET_STRING_print;
diff --git a/skeletons/ObjectDescriptor.c b/skeletons/ObjectDescriptor.c
index 192b468..125e695 100644
--- a/skeletons/ObjectDescriptor.c
+++ b/skeletons/ObjectDescriptor.c
@@ -8,11 +8,11 @@
 /*
  * ObjectDescriptor basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_ObjectDescriptor_tags[] = {
+static ber_tlv_tag_t asn_DEF_ObjectDescriptor_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (7 << 2)),	/* [UNIVERSAL 7] IMPLICIT ... */
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor = {
+asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor = {
 	"ObjectDescriptor",
 	OCTET_STRING_free,
 	OCTET_STRING_print_ascii,   /* Treat as ASCII subset (it's not) */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,/* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_ObjectDescriptor_tags,
-	sizeof(asn1_DEF_ObjectDescriptor_tags)
-	  / sizeof(asn1_DEF_ObjectDescriptor_tags[0]) - 1,
-	asn1_DEF_ObjectDescriptor_tags,
-	sizeof(asn1_DEF_ObjectDescriptor_tags)
-	  / sizeof(asn1_DEF_ObjectDescriptor_tags[0]),
+	asn_DEF_ObjectDescriptor_tags,
+	sizeof(asn_DEF_ObjectDescriptor_tags)
+	  / sizeof(asn_DEF_ObjectDescriptor_tags[0]) - 1,
+	asn_DEF_ObjectDescriptor_tags,
+	sizeof(asn_DEF_ObjectDescriptor_tags)
+	  / sizeof(asn_DEF_ObjectDescriptor_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/ObjectDescriptor.h b/skeletons/ObjectDescriptor.h
index 2620d13..54a0000 100644
--- a/skeletons/ObjectDescriptor.h
+++ b/skeletons/ObjectDescriptor.h
@@ -9,6 +9,6 @@
 
 typedef GraphicString_t ObjectDescriptor_t;  /* Implemented via GraphicString */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor;
+extern asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor;
 
 #endif	/* _ObjectDescriptor_H_ */
diff --git a/skeletons/PrintableString.c b/skeletons/PrintableString.c
index f0d4b16..dfe4f9c 100644
--- a/skeletons/PrintableString.c
+++ b/skeletons/PrintableString.c
@@ -8,11 +8,11 @@
 /*
  * PrintableString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_PrintableString_tags[] = {
+static ber_tlv_tag_t asn_DEF_PrintableString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)),	/* [UNIVERSAL 19] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_PrintableString = {
+asn_TYPE_descriptor_t asn_DEF_PrintableString = {
 	"PrintableString",
 	OCTET_STRING_free,
 	OCTET_STRING_print_ascii,   /* ASCII subset */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,/* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_PrintableString_tags,
-	sizeof(asn1_DEF_PrintableString_tags)
-	  / sizeof(asn1_DEF_PrintableString_tags[0]) - 1,
-	asn1_DEF_PrintableString_tags,
-	sizeof(asn1_DEF_PrintableString_tags)
-	  / sizeof(asn1_DEF_PrintableString_tags[0]),
+	asn_DEF_PrintableString_tags,
+	sizeof(asn_DEF_PrintableString_tags)
+	  / sizeof(asn_DEF_PrintableString_tags[0]) - 1,
+	asn_DEF_PrintableString_tags,
+	sizeof(asn_DEF_PrintableString_tags)
+	  / sizeof(asn_DEF_PrintableString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -56,7 +56,7 @@
 };
 
 int
-PrintableString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+PrintableString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const PrintableString_t *st = (const PrintableString_t *)sptr;
 
diff --git a/skeletons/PrintableString.h b/skeletons/PrintableString.h
index fffb86e..e4a230d 100644
--- a/skeletons/PrintableString.h
+++ b/skeletons/PrintableString.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t PrintableString_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_PrintableString;
+extern asn_TYPE_descriptor_t asn_DEF_PrintableString;
 
 asn_constr_check_f PrintableString_constraint;
 
diff --git a/skeletons/REAL.c b/skeletons/REAL.c
index b03a70d..c6d90f3 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -20,10 +20,10 @@
 /*
  * REAL basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_REAL_tags[] = {
+static ber_tlv_tag_t asn_DEF_REAL_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_REAL = {
+asn_TYPE_descriptor_t asn_DEF_REAL = {
 	"REAL",
 	ASN__PRIMITIVE_TYPE_free,
 	REAL_print,
@@ -33,10 +33,10 @@
 	0,				/* Not implemented yet */
 	REAL_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_REAL_tags,
-	sizeof(asn1_DEF_REAL_tags) / sizeof(asn1_DEF_REAL_tags[0]),
-	asn1_DEF_REAL_tags,	/* Same as above */
-	sizeof(asn1_DEF_REAL_tags) / sizeof(asn1_DEF_REAL_tags[0]),
+	asn_DEF_REAL_tags,
+	sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
+	asn_DEF_REAL_tags,	/* Same as above */
+	sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -182,7 +182,7 @@
 }
 
 int
-REAL_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+REAL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const REAL_t *st = (const REAL_t *)sptr;
 	ssize_t ret;
@@ -193,7 +193,7 @@
 
 	if(!st || !st->buf)
 		ret = cb("<absent>", 8, app_key);
-	else if(asn1_REAL2double(st, &d))
+	else if(asn_REAL2double(st, &d))
 		ret = cb("<error>", 7, app_key);
 	else
 		ret = REAL__dump(d, 0, cb, app_key);
@@ -202,7 +202,7 @@
 }
 
 asn_enc_rval_t
-REAL_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+REAL_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	REAL_t *st = (REAL_t *)sptr;
@@ -211,7 +211,7 @@
 
 	(void)ilevel;
 
-	if(!st || !st->buf || asn1_REAL2double(st, &d))
+	if(!st || !st->buf || asn_REAL2double(st, &d))
 		_ASN_ENCODE_FAILED;
 
 	er.encoded = REAL__dump(d, flags & XER_F_CANONICAL, cb, app_key);
@@ -221,7 +221,7 @@
 }
 
 int
-asn1_REAL2double(const REAL_t *st, double *dbl_value) {
+asn_REAL2double(const REAL_t *st, double *dbl_value) {
 	unsigned int octv;
 
 	if(!st || !st->buf) {
@@ -372,7 +372,7 @@
  * [1 bit sign]  [11 bits exponent]  [52 bits mantissa]
  */
 int
-asn1_double2REAL(REAL_t *st, double dbl_value) {
+asn_double2REAL(REAL_t *st, double dbl_value) {
 #ifdef	WORDS_BIGENDIAN		/* Known to be big-endian */
 	int littleEndian = 0;
 #else				/* need to test: have no explicit information */
diff --git a/skeletons/REAL.h b/skeletons/REAL.h
index c478f41..bd59799 100644
--- a/skeletons/REAL.h
+++ b/skeletons/REAL.h
@@ -10,7 +10,7 @@
 
 typedef ASN__PRIMITIVE_TYPE_t REAL_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_REAL;
+extern asn_TYPE_descriptor_t asn_DEF_REAL;
 
 asn_struct_print_f REAL_print;
 xer_type_encoder_f REAL_encode_xer;
@@ -27,7 +27,7 @@
  *  0: Value converted successfully
  * -1: An error occured while converting the value: invalid format.
  */
-int asn1_REAL2double(const REAL_t *real_ptr, double *d);
-int asn1_double2REAL(REAL_t *real_ptr, double d);
+int asn_REAL2double(const REAL_t *real_ptr, double *d);
+int asn_double2REAL(REAL_t *real_ptr, double d);
 
 #endif	/* ASN_TYPE_REAL_H */
diff --git a/skeletons/RELATIVE-OID.c b/skeletons/RELATIVE-OID.c
index e928bd0..899e69c 100644
--- a/skeletons/RELATIVE-OID.c
+++ b/skeletons/RELATIVE-OID.c
@@ -12,10 +12,10 @@
 /*
  * RELATIVE-OID basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_RELATIVE_OID_tags[] = {
+static ber_tlv_tag_t asn_DEF_RELATIVE_OID_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (13 << 2))
 };
-asn1_TYPE_descriptor_t asn1_DEF_RELATIVE_OID = {
+asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID = {
 	"RELATIVE-OID",
 	ASN__PRIMITIVE_TYPE_free,
 	RELATIVE_OID_print,
@@ -25,12 +25,12 @@
 	0,				/* Not implemented yet */
 	RELATIVE_OID_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_RELATIVE_OID_tags,
-	sizeof(asn1_DEF_RELATIVE_OID_tags)
-	    / sizeof(asn1_DEF_RELATIVE_OID_tags[0]),
-	asn1_DEF_RELATIVE_OID_tags,	/* Same as above */
-	sizeof(asn1_DEF_RELATIVE_OID_tags)
-	    / sizeof(asn1_DEF_RELATIVE_OID_tags[0]),
+	asn_DEF_RELATIVE_OID_tags,
+	sizeof(asn_DEF_RELATIVE_OID_tags)
+	    / sizeof(asn_DEF_RELATIVE_OID_tags[0]),
+	asn_DEF_RELATIVE_OID_tags,	/* Same as above */
+	sizeof(asn_DEF_RELATIVE_OID_tags)
+	    / sizeof(asn_DEF_RELATIVE_OID_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -65,7 +65,7 @@
 }
 
 int
-RELATIVE_OID_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+RELATIVE_OID_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const RELATIVE_OID_t *st = (const RELATIVE_OID_t *)sptr;
 
@@ -86,7 +86,7 @@
 }
 
 asn_enc_rval_t
-RELATIVE_OID_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+RELATIVE_OID_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	RELATIVE_OID_t *st = (RELATIVE_OID_t *)sptr;
diff --git a/skeletons/RELATIVE-OID.h b/skeletons/RELATIVE-OID.h
index 855391c..9435172 100644
--- a/skeletons/RELATIVE-OID.h
+++ b/skeletons/RELATIVE-OID.h
@@ -10,7 +10,7 @@
 /* Implemented via OBJECT IDENTIFIER */
 typedef OBJECT_IDENTIFIER_t RELATIVE_OID_t;
 
-extern asn1_TYPE_descriptor_t asn1_DEF_RELATIVE_OID;
+extern asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID;
 
 asn_struct_print_f RELATIVE_OID_print;
 xer_type_encoder_f RELATIVE_OID_encode_xer;
diff --git a/skeletons/T61String.c b/skeletons/T61String.c
index 14a86b9..41835c4 100644
--- a/skeletons/T61String.c
+++ b/skeletons/T61String.c
@@ -8,11 +8,11 @@
 /*
  * T61String basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_T61String_tags[] = {
+static ber_tlv_tag_t asn_DEF_T61String_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)),	/* [UNIVERSAL 20] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_T61String = {
+asn_TYPE_descriptor_t asn_DEF_T61String = {
 	"T61String",
 	OCTET_STRING_free,
 	OCTET_STRING_print,         /* non-ascii string */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer,    /* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_T61String_tags,
-	sizeof(asn1_DEF_T61String_tags)
-	  / sizeof(asn1_DEF_T61String_tags[0]) - 1,
-	asn1_DEF_T61String_tags,
-	sizeof(asn1_DEF_T61String_tags)
-	  / sizeof(asn1_DEF_T61String_tags[0]),
+	asn_DEF_T61String_tags,
+	sizeof(asn_DEF_T61String_tags)
+	  / sizeof(asn_DEF_T61String_tags[0]) - 1,
+	asn_DEF_T61String_tags,
+	sizeof(asn_DEF_T61String_tags)
+	  / sizeof(asn_DEF_T61String_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/T61String.h b/skeletons/T61String.h
index f523444..46b12ce 100644
--- a/skeletons/T61String.h
+++ b/skeletons/T61String.h
@@ -9,6 +9,6 @@
 
 typedef OCTET_STRING_t T61String_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_T61String;
+extern asn_TYPE_descriptor_t asn_DEF_T61String;
 
 #endif	/* _T61String_H_ */
diff --git a/skeletons/TeletexString.c b/skeletons/TeletexString.c
index 965ada8..aa8d2a9 100644
--- a/skeletons/TeletexString.c
+++ b/skeletons/TeletexString.c
@@ -8,11 +8,11 @@
 /*
  * TeletexString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_TeletexString_tags[] = {
+static ber_tlv_tag_t asn_DEF_TeletexString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)),	/* [UNIVERSAL 20] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_TeletexString = {
+asn_TYPE_descriptor_t asn_DEF_TeletexString = {
 	"TeletexString",
 	OCTET_STRING_free,
 	OCTET_STRING_print,         /* non-ascii string */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer,    /* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_TeletexString_tags,
-	sizeof(asn1_DEF_TeletexString_tags)
-	  / sizeof(asn1_DEF_TeletexString_tags[0]) - 1,
-	asn1_DEF_TeletexString_tags,
-	sizeof(asn1_DEF_TeletexString_tags)
-	  / sizeof(asn1_DEF_TeletexString_tags[0]),
+	asn_DEF_TeletexString_tags,
+	sizeof(asn_DEF_TeletexString_tags)
+	  / sizeof(asn_DEF_TeletexString_tags[0]) - 1,
+	asn_DEF_TeletexString_tags,
+	sizeof(asn_DEF_TeletexString_tags)
+	  / sizeof(asn_DEF_TeletexString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/TeletexString.h b/skeletons/TeletexString.h
index e92f7c2..a408d58 100644
--- a/skeletons/TeletexString.h
+++ b/skeletons/TeletexString.h
@@ -9,6 +9,6 @@
 
 typedef OCTET_STRING_t TeletexString_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_TeletexString;
+extern asn_TYPE_descriptor_t asn_DEF_TeletexString;
 
 #endif	/* _TeletexString_H_ */
diff --git a/skeletons/UTCTime.c b/skeletons/UTCTime.c
index f884eeb..045b172 100644
--- a/skeletons/UTCTime.c
+++ b/skeletons/UTCTime.c
@@ -14,12 +14,12 @@
 /*
  * UTCTime basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_UTCTime_tags[] = {
+static ber_tlv_tag_t asn_DEF_UTCTime_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (23 << 2)),	/* [UNIVERSAL 23] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)),  /* [UNIVERSAL 26] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))    /* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_UTCTime = {
+asn_TYPE_descriptor_t asn_DEF_UTCTime = {
 	"UTCTime",
 	OCTET_STRING_free,
 	UTCTime_print,
@@ -29,12 +29,12 @@
 	0,				/* Not implemented yet */
 	UTCTime_encode_xer,
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_UTCTime_tags,
-	sizeof(asn1_DEF_UTCTime_tags)
-	  / sizeof(asn1_DEF_UTCTime_tags[0]) - 2,
-	asn1_DEF_UTCTime_tags,
-	sizeof(asn1_DEF_UTCTime_tags)
-	  / sizeof(asn1_DEF_UTCTime_tags[0]),
+	asn_DEF_UTCTime_tags,
+	sizeof(asn_DEF_UTCTime_tags)
+	  / sizeof(asn_DEF_UTCTime_tags[0]) - 2,
+	asn_DEF_UTCTime_tags,
+	sizeof(asn_DEF_UTCTime_tags)
+	  / sizeof(asn_DEF_UTCTime_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -45,7 +45,7 @@
  * Check that the time looks like the time.
  */
 int
-UTCTime_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+UTCTime_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	const UTCTime_t *st = (const UTCTime_t *)sptr;
 	time_t tloc;
@@ -63,7 +63,7 @@
 }
 
 asn_enc_rval_t
-UTCTime_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+UTCTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	OCTET_STRING_t st;
@@ -93,7 +93,7 @@
 }
 
 int
-UTCTime_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+UTCTime_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const UTCTime_t *st = (const UTCTime_t *)sptr;
 
diff --git a/skeletons/UTCTime.h b/skeletons/UTCTime.h
index 65de7a3..6d26807 100644
--- a/skeletons/UTCTime.h
+++ b/skeletons/UTCTime.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t UTCTime_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_UTCTime;
+extern asn_TYPE_descriptor_t asn_DEF_UTCTime;
 
 asn_struct_print_f UTCTime_print;
 asn_constr_check_f UTCTime_constraint;
diff --git a/skeletons/UTF8String.c b/skeletons/UTF8String.c
index 2d474e9..7d3fcd2 100644
--- a/skeletons/UTF8String.c
+++ b/skeletons/UTF8String.c
@@ -8,11 +8,11 @@
 /*
  * UTF8String basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_UTF8String_tags[] = {
+static ber_tlv_tag_t asn_DEF_UTF8String_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),	/* [UNIVERSAL 12] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_UTF8String = {
+asn_TYPE_descriptor_t asn_DEF_UTF8String = {
 	"UTF8String",
 	OCTET_STRING_free,
 	UTF8String_print,
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer_ascii,	/* Already in UTF-8 format */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_UTF8String_tags,
-	sizeof(asn1_DEF_UTF8String_tags)
-	  / sizeof(asn1_DEF_UTF8String_tags[0]) - 1,
-	asn1_DEF_UTF8String_tags,
-	sizeof(asn1_DEF_UTF8String_tags)
-	  / sizeof(asn1_DEF_UTF8String_tags[0]),
+	asn_DEF_UTF8String_tags,
+	sizeof(asn_DEF_UTF8String_tags)
+	  / sizeof(asn_DEF_UTF8String_tags[0]) - 1,
+	asn_DEF_UTF8String_tags,
+	sizeof(asn_DEF_UTF8String_tags)
+	  / sizeof(asn_DEF_UTF8String_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -42,7 +42,7 @@
 };
 
 int
-UTF8String_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+UTF8String_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	ssize_t len;
 	len = UTF8String_length((const UTF8String_t *)sptr, td->name,
@@ -113,7 +113,7 @@
 }
 
 int
-UTF8String_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+UTF8String_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const UTF8String_t *st = (const UTF8String_t *)sptr;
 
diff --git a/skeletons/UTF8String.h b/skeletons/UTF8String.h
index bb58bbe..a1149e4 100644
--- a/skeletons/UTF8String.h
+++ b/skeletons/UTF8String.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t UTF8String_t;	/* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_UTF8String;
+extern asn_TYPE_descriptor_t asn_DEF_UTF8String;
 
 asn_struct_print_f UTF8String_print;
 asn_constr_check_f UTF8String_constraint;
diff --git a/skeletons/UniversalString.c b/skeletons/UniversalString.c
index 3dc0441..f43de18 100644
--- a/skeletons/UniversalString.c
+++ b/skeletons/UniversalString.c
@@ -8,11 +8,11 @@
 /*
  * UniversalString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_UniversalString_tags[] = {
+static ber_tlv_tag_t asn_DEF_UniversalString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (28 << 2)),	/* [UNIVERSAL 28] IMPLICIT ...*/
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_UniversalString = {
+asn_TYPE_descriptor_t asn_DEF_UniversalString = {
 	"UniversalString",
 	OCTET_STRING_free,
 	UniversalString_print,      /* Convert into UTF8 and print */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	UniversalString_encode_xer,	/* Conver into UTF8 */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_UniversalString_tags,
-	sizeof(asn1_DEF_UniversalString_tags)
-	  / sizeof(asn1_DEF_UniversalString_tags[0]) - 1,
-	asn1_DEF_UniversalString_tags,
-	sizeof(asn1_DEF_UniversalString_tags)
-	  / sizeof(asn1_DEF_UniversalString_tags[0]),
+	asn_DEF_UniversalString_tags,
+	sizeof(asn_DEF_UniversalString_tags)
+	  / sizeof(asn_DEF_UniversalString_tags[0]) - 1,
+	asn_DEF_UniversalString_tags,
+	sizeof(asn_DEF_UniversalString_tags)
+	  / sizeof(asn_DEF_UniversalString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
@@ -93,7 +93,7 @@
 }
 
 asn_enc_rval_t
-UniversalString_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+UniversalString_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	const UniversalString_t *st = (const UniversalString_t *)sptr;
@@ -112,7 +112,7 @@
 }
 
 int
-UniversalString_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+UniversalString_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	const UniversalString_t *st = (const UniversalString_t *)sptr;
 
diff --git a/skeletons/UniversalString.h b/skeletons/UniversalString.h
index fe74f0f..6d4a291 100644
--- a/skeletons/UniversalString.h
+++ b/skeletons/UniversalString.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t UniversalString_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_UniversalString;
+extern asn_TYPE_descriptor_t asn_DEF_UniversalString;
 
 asn_struct_print_f UniversalString_print;	/* Human-readable output */
 xer_type_encoder_f UniversalString_encode_xer;
diff --git a/skeletons/VideotexString.c b/skeletons/VideotexString.c
index 3520471..fa6892e 100644
--- a/skeletons/VideotexString.c
+++ b/skeletons/VideotexString.c
@@ -8,11 +8,11 @@
 /*
  * VideotexString basic type description.
  */
-static ber_tlv_tag_t asn1_DEF_VideotexString_tags[] = {
+static ber_tlv_tag_t asn_DEF_VideotexString_tags[] = {
 	(ASN_TAG_CLASS_UNIVERSAL | (21 << 2)),	/* [UNIVERSAL 21] IMPLICIT */
 	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))	/* ... OCTET STRING */
 };
-asn1_TYPE_descriptor_t asn1_DEF_VideotexString = {
+asn_TYPE_descriptor_t asn_DEF_VideotexString = {
 	"VideotexString",
 	OCTET_STRING_free,
 	OCTET_STRING_print,         /* non-ascii string */
@@ -22,12 +22,12 @@
 	0,				/* Not implemented yet */
 	OCTET_STRING_encode_xer,    /* Implemented in terms of OCTET STRING */
 	0, /* Use generic outmost tag fetcher */
-	asn1_DEF_VideotexString_tags,
-	sizeof(asn1_DEF_VideotexString_tags)
-	  / sizeof(asn1_DEF_VideotexString_tags[0]) - 1,
-	asn1_DEF_VideotexString_tags,
-	sizeof(asn1_DEF_VideotexString_tags)
-	  / sizeof(asn1_DEF_VideotexString_tags[0]),
+	asn_DEF_VideotexString_tags,
+	sizeof(asn_DEF_VideotexString_tags)
+	  / sizeof(asn_DEF_VideotexString_tags[0]) - 1,
+	asn_DEF_VideotexString_tags,
+	sizeof(asn_DEF_VideotexString_tags)
+	  / sizeof(asn_DEF_VideotexString_tags[0]),
 	0, 0,	/* No members */
 	0	/* No specifics */
 };
diff --git a/skeletons/VideotexString.h b/skeletons/VideotexString.h
index 6b60341..0a156e2 100644
--- a/skeletons/VideotexString.h
+++ b/skeletons/VideotexString.h
@@ -9,6 +9,6 @@
 
 typedef OCTET_STRING_t VideotexString_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_VideotexString;
+extern asn_TYPE_descriptor_t asn_DEF_VideotexString;
 
 #endif	/* _VideotexString_H_ */
diff --git a/skeletons/VisibleString.h b/skeletons/VisibleString.h
index b90234c..ca05bea 100644
--- a/skeletons/VisibleString.h
+++ b/skeletons/VisibleString.h
@@ -9,7 +9,7 @@
 
 typedef OCTET_STRING_t VisibleString_t;  /* Implemented via OCTET STRING */
 
-extern asn1_TYPE_descriptor_t asn1_DEF_VisibleString;
+extern asn_TYPE_descriptor_t asn_DEF_VisibleString;
 
 asn_constr_check_f VisibleString_constraint;
 
diff --git a/skeletons/asn_application.h b/skeletons/asn_application.h
index 14fe3a9..33de699 100644
--- a/skeletons/asn_application.h
+++ b/skeletons/asn_application.h
@@ -20,6 +20,6 @@
 typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size,
 	void *application_specific_key);
 
-#include <constr_TYPE.h>	/* for asn1_TYPE_descriptor_t */
+#include <constr_TYPE.h>	/* for asn_TYPE_descriptor_t */
 
 #endif	/* _ASN_APPLICATION_H_ */
diff --git a/skeletons/ber_codec_prim.c b/skeletons/ber_codec_prim.c
index 6bb3613..c4d06e1 100644
--- a/skeletons/ber_codec_prim.c
+++ b/skeletons/ber_codec_prim.c
@@ -11,7 +11,8 @@
  * Decode an always-primitive type.
  */
 ber_dec_rval_t
-ber_decode_primitive(asn1_TYPE_descriptor_t *td,
+ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
+	asn_TYPE_descriptor_t *td,
 	void **sptr, void *buf_ptr, size_t size, int tag_mode) {
 	ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
 	ber_dec_rval_t rval;
@@ -35,7 +36,8 @@
 	/*
 	 * Check tags and extract value length.
 	 */
-	rval = ber_check_tags(td, 0, buf_ptr, size, tag_mode, 0, &length, 0);
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
 	if(rval.code != RC_OK)
 		return rval;
 
@@ -78,7 +80,7 @@
  * Encode an always-primitive type using DER.
  */
 asn_enc_rval_t
-der_encode_primitive(asn1_TYPE_descriptor_t *td, void *sptr,
+der_encode_primitive(asn_TYPE_descriptor_t *td, void *sptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
@@ -113,7 +115,7 @@
 }
 
 void
-ASN__PRIMITIVE_TYPE_free(asn1_TYPE_descriptor_t *td, void *sptr,
+ASN__PRIMITIVE_TYPE_free(asn_TYPE_descriptor_t *td, void *sptr,
 		int contents_only) {
 	ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr;
 
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 5ad33c8..ab15846 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -70,8 +70,8 @@
  */
 static int
 _search4tag(const void *ap, const void *bp) {
-	const asn1_TYPE_tag2member_t *a = (const asn1_TYPE_tag2member_t *)ap;
-	const asn1_TYPE_tag2member_t *b = (const asn1_TYPE_tag2member_t *)bp;
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
 
 	int a_class = BER_TAG_CLASS(a->el_tag);
 	int b_class = BER_TAG_CLASS(b->el_tag);
@@ -97,23 +97,22 @@
  * The decoder of the CHOICE type.
  */
 ber_dec_rval_t
-CHOICE_decode_ber(asn1_TYPE_descriptor_t *td,
+CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
 	 */
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *elements = td->elements;
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
 
 	/*
 	 * Parts of the structure being constructed.
 	 */
 	void *st = *struct_ptr;	/* Target structure. */
-	ber_dec_ctx_t *ctx;	/* Decoder context */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
 
 	ber_tlv_tag_t tlv_tag;	/* T from TLV */
 	ssize_t tag_len;	/* Length of TLV's T */
-	//ber_tlv_len_t tlv_len;	/* L from TLV */
 	ber_dec_rval_t rval;	/* Return code from subparsers */
 
 	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
@@ -133,7 +132,7 @@
 	/*
 	 * Restore parsing context.
 	 */
-	ctx = (ber_dec_ctx_t *)((char *)st + specs->ctx_offset);
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
 	
 	/*
 	 * Start to parse where left previously
@@ -147,7 +146,7 @@
 		 */
 
 		if(tag_mode || td->tags_count) {
-			rval = ber_check_tags(td, ctx, ptr, size,
+			rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
 				tag_mode, -1, &ctx->left, 0);
 			if(rval.code != RC_OK) {
 				ASN_DEBUG("%s tagging check failed: %d",
@@ -184,8 +183,8 @@
 		}
 
 		do {
-			asn1_TYPE_tag2member_t *t2m;
-			asn1_TYPE_tag2member_t key;
+			asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
 
 			key.el_tag = tlv_tag;
 			(void *)t2m = bsearch(&key,
@@ -231,7 +230,7 @@
 		 * Read in the element.
 		 */
 	    do {
-		asn1_TYPE_member_t *elm;/* CHOICE's element */
+		asn_TYPE_member_t *elm;/* CHOICE's element */
 		void *memb_ptr;		/* Pointer to the member */
 		void **memb_ptr2;	/* Pointer to that pointer */
 
@@ -256,7 +255,7 @@
 		/*
 		 * Invoke the member fetch routine according to member's type
 		 */
-		rval = elm->type->ber_decoder(elm->type,
+		rval = elm->type->ber_decoder(opt_codec_ctx, elm->type,
 				memb_ptr2, ptr, LEFT,
 				elm->tag_mode);
 		switch(rval.code) {
@@ -353,12 +352,12 @@
 }
 
 asn_enc_rval_t
-CHOICE_encode_der(asn1_TYPE_descriptor_t *td,
+CHOICE_encode_der(asn_TYPE_descriptor_t *td,
 		void *struct_ptr,
 		int tag_mode, ber_tlv_tag_t tag,
 		asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *elm;	/* CHOICE element */
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE element */
 	asn_enc_rval_t erval;
 	void *memb_ptr;
 	size_t computed_size = 0;
@@ -453,8 +452,8 @@
 }
 
 ber_tlv_tag_t
-CHOICE_outmost_tag(asn1_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
+CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
 	int present;
 
 	assert(tag_mode == 0);
@@ -466,7 +465,7 @@
 	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
 
 	if(present > 0 || present <= td->elements_count) {
-		asn1_TYPE_member_t *elm = &td->elements[present-1];
+		asn_TYPE_member_t *elm = &td->elements[present-1];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
@@ -477,7 +476,7 @@
 					((const char *)ptr + elm->memb_offset);
 		}
 
-		return asn1_TYPE_outmost_tag(elm->type, memb_ptr,
+		return asn_TYPE_outmost_tag(elm->type, memb_ptr,
 			elm->tag_mode, elm->tag);
 	} else {
 		return (ber_tlv_tag_t)-1;
@@ -485,9 +484,9 @@
 }
 
 int
-CHOICE_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
 	int present;
 
 	if(!sptr) {
@@ -502,7 +501,7 @@
 	 */
 	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
 	if(present > 0 && present <= td->elements_count) {
-		asn1_TYPE_member_t *elm = &td->elements[present-1];
+		asn_TYPE_member_t *elm = &td->elements[present-1];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
@@ -541,10 +540,10 @@
 }
 
 asn_enc_rval_t
-CHOICE_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_CHOICE_specifics_t *specs=(asn1_CHOICE_specifics_t *)td->specifics;
+	asn_CHOICE_specifics_t *specs=(asn_CHOICE_specifics_t *)td->specifics;
 	asn_enc_rval_t er;
 	int present;
 
@@ -560,7 +559,7 @@
 		_ASN_ENCODE_FAILED;
 	}  else {
 		asn_enc_rval_t tmper;
-		asn1_TYPE_member_t *elm = &td->elements[present-1];
+		asn_TYPE_member_t *elm = &td->elements[present-1];
 		void *memb_ptr;
 		const char *mname = elm->name;
 		unsigned int mlen = strlen(mname);
@@ -592,9 +591,9 @@
 }
 
 int
-CHOICE_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
 	int present;
 
 	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
@@ -608,7 +607,7 @@
 	 * Print that element.
 	 */
 	if(present > 0 && present <= td->elements_count) {
-		asn1_TYPE_member_t *elm = &td->elements[present-1];
+		asn_TYPE_member_t *elm = &td->elements[present-1];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
@@ -633,8 +632,8 @@
 }
 
 void
-CHOICE_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
-	asn1_CHOICE_specifics_t *specs = (asn1_CHOICE_specifics_t *)td->specifics;
+CHOICE_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
 	int present;
 
 	if(!td || !ptr)
@@ -651,7 +650,7 @@
 	 * Free that element.
 	 */
 	if(present > 0 && present <= td->elements_count) {
-		asn1_TYPE_member_t *elm = &td->elements[present-1];
+		asn_TYPE_member_t *elm = &td->elements[present-1];
 		void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
diff --git a/skeletons/constr_CHOICE.h b/skeletons/constr_CHOICE.h
index 4e29641..8cd323a 100644
--- a/skeletons/constr_CHOICE.h
+++ b/skeletons/constr_CHOICE.h
@@ -7,7 +7,7 @@
 
 #include <asn_application.h>
 
-typedef struct asn1_CHOICE_specifics_s {
+typedef struct asn_CHOICE_specifics_s {
 	/*
 	 * Target structure description.
 	 */
@@ -19,14 +19,14 @@
 	/*
 	 * Tags to members mapping table.
 	 */
-	asn1_TYPE_tag2member_t *tag2el;
+	asn_TYPE_tag2member_t *tag2el;
 	int tag2el_count;
 
 	/*
 	 * Extensions-related stuff.
 	 */
 	int extensible;			/* Whether CHOICE is extensible */
-} asn1_CHOICE_specifics_t;
+} asn_CHOICE_specifics_t;
 
 /*
  * A set specialized functions dealing with the CHOICE type.
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index b00ae6f..740ce57 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -74,8 +74,8 @@
  */
 static int
 _t2e_cmp(const void *ap, const void *bp) {
-	const asn1_TYPE_tag2member_t *a = (const asn1_TYPE_tag2member_t *)ap;
-	const asn1_TYPE_tag2member_t *b = (const asn1_TYPE_tag2member_t *)bp;
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
 
 	int a_class = BER_TAG_CLASS(a->el_tag);
 	int b_class = BER_TAG_CLASS(b->el_tag);
@@ -108,22 +108,21 @@
  * The decoder of the SEQUENCE type.
  */
 ber_dec_rval_t
-SEQUENCE_decode_ber(asn1_TYPE_descriptor_t *td,
+SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
 	 */
-	asn1_SEQUENCE_specifics_t *specs = (asn1_SEQUENCE_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *elements = td->elements;
+	asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
 
 	/*
 	 * Parts of the structure being constructed.
 	 */
 	void *st = *struct_ptr;	/* Target structure. */
-	ber_dec_ctx_t *ctx;	/* Decoder context */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
 
 	ber_tlv_tag_t tlv_tag;	/* T from TLV */
-	//ber_tlv_len_t tlv_len;	/* L from TLV */
 	ber_dec_rval_t rval;	/* Return code from subparsers */
 
 	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
@@ -144,7 +143,7 @@
 	/*
 	 * Restore parsing context.
 	 */
-	ctx = (ber_dec_ctx_t *)((char *)st + specs->ctx_offset);
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
 	
 	/*
 	 * Start to parse where left previously
@@ -157,7 +156,7 @@
 		 * perfectly fits our expectations.
 		 */
 
-		rval = ber_check_tags(td, ctx, ptr, size,
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
 			tag_mode, 1, &ctx->left, 0);
 		if(rval.code != RC_OK) {
 			ASN_DEBUG("%s tagging check failed: %d",
@@ -282,16 +281,16 @@
 			 * Resort to a binary search over
 			 * sorted array of tags.
 			 */
-			asn1_TYPE_tag2member_t *t2m;
-			asn1_TYPE_tag2member_t key;
+			asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
 			key.el_tag = tlv_tag;
 			key.el_no = edx;
 			(void *)t2m = bsearch(&key,
 				specs->tag2el, specs->tag2el_count,
 				sizeof(specs->tag2el[0]), _t2e_cmp);
 			if(t2m) {
-				asn1_TYPE_tag2member_t *best = 0;
-				asn1_TYPE_tag2member_t *t2m_f, *t2m_l;
+				asn_TYPE_tag2member_t *best = 0;
+				asn_TYPE_tag2member_t *t2m_f, *t2m_l;
 				int edx_max = edx + elements[edx].optional;
 				/*
 				 * Rewind to the first element with that tag,
@@ -397,7 +396,7 @@
 		/*
 		 * Invoke the member fetch routine according to member's type
 		 */
-		rval = elements[edx].type->ber_decoder(
+		rval = elements[edx].type->ber_decoder(opt_codec_ctx,
 				elements[edx].type,
 				memb_ptr2, ptr, LEFT,
 				elements[edx].tag_mode);
@@ -498,7 +497,7 @@
  * The DER encoder of the SEQUENCE type.
  */
 asn_enc_rval_t
-SEQUENCE_encode_der(asn1_TYPE_descriptor_t *td,
+SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
 	void *ptr, int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
 	size_t computed_size = 0;
@@ -513,7 +512,7 @@
 	 * Gather the length of the underlying members sequence.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		void *memb_ptr;
 		if(elm->flags & ATF_POINTER) {
 			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
@@ -550,7 +549,7 @@
 	 * Encode all members.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		asn_enc_rval_t tmperval;
 		void *memb_ptr;
 
@@ -583,7 +582,7 @@
 }
 
 asn_enc_rval_t
-SEQUENCE_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
@@ -597,7 +596,7 @@
 
 	for(edx = 0; edx < td->elements_count; edx++) {
 		asn_enc_rval_t tmper;
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		void *memb_ptr;
 		const char *mname = elm->name;
 		unsigned int mlen = strlen(mname);
@@ -627,7 +626,7 @@
 }
 
 int
-SEQUENCE_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+SEQUENCE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	int edx;
 	int ret;
@@ -640,7 +639,7 @@
 		return -1;
 
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
@@ -671,7 +670,7 @@
 }
 
 void
-SEQUENCE_free(asn1_TYPE_descriptor_t *td, void *sptr, int contents_only) {
+SEQUENCE_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) {
 	int edx;
 
 	if(!td || !sptr)
@@ -680,7 +679,7 @@
 	ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
 
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		void *memb_ptr;
 		if(elm->flags & ATF_POINTER) {
 			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
@@ -698,7 +697,7 @@
 }
 
 int
-SEQUENCE_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	int edx;
 
@@ -713,7 +712,7 @@
 	 * Iterate over structure members and check their validity.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
diff --git a/skeletons/constr_SEQUENCE.h b/skeletons/constr_SEQUENCE.h
index 27903b1..0b36079 100644
--- a/skeletons/constr_SEQUENCE.h
+++ b/skeletons/constr_SEQUENCE.h
@@ -7,17 +7,17 @@
 
 #include <asn_application.h>
 
-typedef struct asn1_SEQUENCE_specifics_s {
+typedef struct asn_SEQUENCE_specifics_s {
 	/*
 	 * Target structure description.
 	 */
 	int struct_size;	/* Size of the target structure. */
-	int ctx_offset;		/* Offset of the ber_dec_ctx_t member */
+	int ctx_offset;		/* Offset of the asn_struct_ctx_t member */
 
 	/*
 	 * Tags to members mapping table (sorted).
 	 */
-	asn1_TYPE_tag2member_t *tag2el;
+	asn_TYPE_tag2member_t *tag2el;
 	int tag2el_count;
 
 	/*
@@ -25,7 +25,7 @@
 	 */
 	int ext_after;	/* Extensions start after this member */
 	int ext_before;	/* Extensions stop before this member */
-} asn1_SEQUENCE_specifics_t;
+} asn_SEQUENCE_specifics_t;
 
 
 /*
diff --git a/skeletons/constr_SEQUENCE_OF.c b/skeletons/constr_SEQUENCE_OF.c
index be2ed60..b99831f 100644
--- a/skeletons/constr_SEQUENCE_OF.c
+++ b/skeletons/constr_SEQUENCE_OF.c
@@ -10,10 +10,10 @@
  * The DER encoder of the SEQUENCE OF type.
  */
 asn_enc_rval_t
-SEQUENCE_OF_encode_der(asn1_TYPE_descriptor_t *td, void *ptr,
+SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_TYPE_member_t *elm = td->elements;
+	asn_TYPE_member_t *elm = td->elements;
 	A_SEQUENCE_OF(void) *list;
 	size_t computed_size = 0;
 	ssize_t encoding_size = 0;
@@ -84,12 +84,12 @@
 }
 
 asn_enc_rval_t
-SEQUENCE_OF_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
-        asn1_SET_OF_specifics_t *specs = (asn1_SET_OF_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *element = td->elements;
+        asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
+	asn_TYPE_member_t *element = td->elements;
 	A_SEQUENCE_OF(void) *list;
 	const char *mname = specs->as_XMLValueList
 		? 0 : ((*element->name) ? element->name : element->type->name);
diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c
index 6a604e4..647bb83 100644
--- a/skeletons/constr_SET.c
+++ b/skeletons/constr_SET.c
@@ -70,8 +70,8 @@
  */
 static int
 _t2e_cmp(const void *ap, const void *bp) {
-	const asn1_TYPE_tag2member_t *a = (const asn1_TYPE_tag2member_t *)ap;
-	const asn1_TYPE_tag2member_t *b = (const asn1_TYPE_tag2member_t *)bp;
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
 
 	int a_class = BER_TAG_CLASS(a->el_tag);
 	int b_class = BER_TAG_CLASS(b->el_tag);
@@ -97,22 +97,21 @@
  * The decoder of the SET type.
  */
 ber_dec_rval_t
-SET_decode_ber(asn1_TYPE_descriptor_t *td,
+SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
 	 */
-	asn1_SET_specifics_t *specs = (asn1_SET_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *elements = td->elements;
+	asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
 
 	/*
 	 * Parts of the structure being constructed.
 	 */
 	void *st = *struct_ptr;	/* Target structure. */
-	ber_dec_ctx_t *ctx;	/* Decoder context */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
 
 	ber_tlv_tag_t tlv_tag;	/* T from TLV */
-	//ber_tlv_len_t tlv_len;	/* L from TLV */
 	ber_dec_rval_t rval;	/* Return code from subparsers */
 
 	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
@@ -133,7 +132,7 @@
 	/*
 	 * Restore parsing context.
 	 */
-	ctx = (ber_dec_ctx_t *)((char *)st + specs->ctx_offset);
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
 	
 	/*
 	 * Start to parse where left previously
@@ -146,7 +145,7 @@
 		 * perfectly fits our expectations.
 		 */
 
-		rval = ber_check_tags(td, ctx, ptr, size,
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
 			tag_mode, 1, &ctx->left, 0);
 		if(rval.code != RC_OK) {
 			ASN_DEBUG("%s tagging check failed: %d",
@@ -235,8 +234,8 @@
 			 * but is not strongly anticipated either.
 			 */
 		} else {
-			asn1_TYPE_tag2member_t *t2m;
-			asn1_TYPE_tag2member_t key;
+			asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
 
 			key.el_tag = tlv_tag;
 			(void *)t2m = bsearch(&key,
@@ -312,7 +311,7 @@
 		/*
 		 * Invoke the member fetch routine according to member's type
 		 */
-		rval = elements[edx].type->ber_decoder(
+		rval = elements[edx].type->ber_decoder(opt_codec_ctx,
 				elements[edx].type,
 				memb_ptr2, ptr, LEFT,
 				elements[edx].tag_mode);
@@ -435,14 +434,14 @@
  * The DER encoder of the SET type.
  */
 asn_enc_rval_t
-SET_encode_der(asn1_TYPE_descriptor_t *td,
+SET_encode_der(asn_TYPE_descriptor_t *td,
 	void *ptr, int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_SET_specifics_t *specs = (asn1_SET_specifics_t *)td->specifics;
+	asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
 	size_t computed_size = 0;
 	asn_enc_rval_t my_erval;
 	int t2m_build_own = (specs->tag2el_count != td->elements_count);
-	asn1_TYPE_tag2member_t *t2m;
+	asn_TYPE_tag2member_t *t2m;
 	int t2m_count;
 	ssize_t ret;
 	int edx;
@@ -472,7 +471,7 @@
 	 * Gather the length of the underlying members sequence.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		asn_enc_rval_t erval;
 		void *memb_ptr;
 
@@ -504,7 +503,7 @@
 		 */
 		if(t2m_build_own) {
 			t2m[t2m_count].el_no = edx;
-			t2m[t2m_count].el_tag = asn1_TYPE_outmost_tag(
+			t2m[t2m_count].el_tag = asn_TYPE_outmost_tag(
 				elm->type, memb_ptr, elm->tag_mode, elm->tag);
 			t2m_count++;
 		} else {
@@ -548,7 +547,7 @@
 	 * Encode all members.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm;
+		asn_TYPE_member_t *elm;
 		asn_enc_rval_t erval;
 		void *memb_ptr;
 
@@ -582,7 +581,7 @@
 }
 
 asn_enc_rval_t
-SET_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+SET_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
@@ -596,7 +595,7 @@
 
 	for(edx = 0; edx < td->elements_count; edx++) {
 		asn_enc_rval_t tmper;
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		void *memb_ptr;
 		const char *mname = elm->name;
 		unsigned int mlen = strlen(elm->name);
@@ -628,7 +627,7 @@
 }
 
 int
-SET_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+SET_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	int edx;
 	int ret;
@@ -641,7 +640,7 @@
 		return -1;
 
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
@@ -671,7 +670,7 @@
 }
 
 void
-SET_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+SET_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
 	int edx;
 
 	if(!td || !ptr)
@@ -680,7 +679,7 @@
 	ASN_DEBUG("Freeing %s as SET", td->name);
 
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		void *memb_ptr;
 		if(elm->flags & ATF_POINTER) {
 			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
@@ -698,7 +697,7 @@
 }
 
 int
-SET_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+SET_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
 	int edx;
 
@@ -713,7 +712,7 @@
 	 * Iterate over structure members and check their validity.
 	 */
 	for(edx = 0; edx < td->elements_count; edx++) {
-		asn1_TYPE_member_t *elm = &td->elements[edx];
+		asn_TYPE_member_t *elm = &td->elements[edx];
 		const void *memb_ptr;
 
 		if(elm->flags & ATF_POINTER) {
diff --git a/skeletons/constr_SET.h b/skeletons/constr_SET.h
index 17fb613..8f9b265 100644
--- a/skeletons/constr_SET.h
+++ b/skeletons/constr_SET.h
@@ -8,18 +8,18 @@
 #include <asn_application.h>
 
 
-typedef struct asn1_SET_specifics_s {
+typedef struct asn_SET_specifics_s {
 	/*
 	 * Target structure description.
 	 */
 	int struct_size;	/* Size of the target structure. */
-	int ctx_offset;		/* Offset of the ber_dec_ctx_t member */
+	int ctx_offset;		/* Offset of the asn_struct_ctx_t member */
 	int pres_offset;	/* Offset of _presence_map member */
 
 	/*
 	 * Tags to members mapping table (sorted).
 	 */
-	asn1_TYPE_tag2member_t *tag2el;
+	asn_TYPE_tag2member_t *tag2el;
 	int tag2el_count;
 
 	/*
@@ -27,7 +27,7 @@
 	 */
 	int extensible;				/* Whether SET is extensible */
 	unsigned int *_mandatory_elements;	/* Bitmask of mandatory ones */
-} asn1_SET_specifics_t;
+} asn_SET_specifics_t;
 
 /*
  * A set specialized functions dealing with the SET type.
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index 2050d1a..00c4cb3 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -65,22 +65,21 @@
  * The decoder of the SET OF type.
  */
 ber_dec_rval_t
-SET_OF_decode_ber(asn1_TYPE_descriptor_t *td,
+SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
 	 */
-	asn1_SET_OF_specifics_t *specs = (asn1_SET_OF_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *element = td->elements;	/* Single one */
+	asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
+	asn_TYPE_member_t *element = td->elements;	/* Single one */
 
 	/*
 	 * Parts of the structure being constructed.
 	 */
 	void *st = *struct_ptr;	/* Target structure. */
-	ber_dec_ctx_t *ctx;	/* Decoder context */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
 
 	ber_tlv_tag_t tlv_tag;	/* T from TLV */
-	//ber_tlv_len_t tlv_len;	/* L from TLV */
 	ber_dec_rval_t rval;	/* Return code from subparsers */
 
 	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
@@ -100,7 +99,7 @@
 	/*
 	 * Restore parsing context.
 	 */
-	ctx = (ber_dec_ctx_t *)((char *)st + specs->ctx_offset);
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
 	
 	/*
 	 * Start to parse where left previously
@@ -113,7 +112,7 @@
 		 * perfectly fits our expectations.
 		 */
 
-		rval = ber_check_tags(td, ctx, ptr, size,
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
 			tag_mode, 1, &ctx->left, 0);
 		if(rval.code != RC_OK) {
 			ASN_DEBUG("%s tagging check failed: %d",
@@ -206,8 +205,8 @@
 		/*
 		 * Invoke the member fetch routine according to member's type
 		 */
-		rval = element->type->ber_decoder(element->type,
-				&ctx->ptr, ptr, LEFT, 0);
+		rval = element->type->ber_decoder(opt_codec_ctx,
+				element->type, &ctx->ptr, ptr, LEFT, 0);
 		ASN_DEBUG("In %s SET OF %s code %d consumed %d",
 			td->name, element->type->name,
 			rval.code, (int)rval.consumed);
@@ -310,11 +309,11 @@
  * The DER encoder of the SET OF type.
  */
 asn_enc_rval_t
-SET_OF_encode_der(asn1_TYPE_descriptor_t *td, void *ptr,
+SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
 	int tag_mode, ber_tlv_tag_t tag,
 	asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_TYPE_member_t *elm = td->elements;
-	asn1_TYPE_descriptor_t *elm_type = elm->type;
+	asn_TYPE_member_t *elm = td->elements;
+	asn_TYPE_descriptor_t *elm_type = elm->type;
 	der_type_encoder_f *der_encoder = elm_type->der_encoder;
 	A_SET_OF(void) *list;
 	size_t computed_size = 0;
@@ -451,12 +450,12 @@
 }
 
 asn_enc_rval_t
-SET_OF_encode_xer(asn1_TYPE_descriptor_t *td, void *sptr,
+SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
 	int ilevel, enum xer_encoder_flags_e flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er;
-	asn1_SET_OF_specifics_t *specs=(asn1_SET_OF_specifics_t *)td->specifics;
-	asn1_TYPE_member_t *element = td->elements;
+	asn_SET_OF_specifics_t *specs=(asn_SET_OF_specifics_t *)td->specifics;
+	asn_TYPE_member_t *element = td->elements;
 	A_SET_OF(void) *list;
 	const char *mname = specs->as_XMLValueList
 		? 0 : ((*element->name) ? element->name : element->type->name);
@@ -498,9 +497,9 @@
 }
 
 int
-SET_OF_print(asn1_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
 		asn_app_consume_bytes_f *cb, void *app_key) {
-	asn1_TYPE_member_t *element = td->elements;
+	asn_TYPE_member_t *element = td->elements;
 	const A_SET_OF(void) *list;
 	int ret;
 	int i;
@@ -531,9 +530,9 @@
 }
 
 void
-SET_OF_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
+SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
 	if(td && ptr) {
-		asn1_TYPE_member_t *element = td->elements;
+		asn_TYPE_member_t *element = td->elements;
 		A_SET_OF(void) *list;
 		int i;
 
@@ -558,9 +557,9 @@
 }
 
 int
-SET_OF_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
+SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
 		asn_app_consume_bytes_f *app_errlog, void *app_key) {
-	asn1_TYPE_member_t *element = td->elements;
+	asn_TYPE_member_t *element = td->elements;
 	asn_constr_check_f *constr;
 	const A_SET_OF(void) *list;
 	int i;
diff --git a/skeletons/constr_SET_OF.h b/skeletons/constr_SET_OF.h
index b013dd6..72de815 100644
--- a/skeletons/constr_SET_OF.h
+++ b/skeletons/constr_SET_OF.h
@@ -7,16 +7,16 @@
 
 #include <asn_application.h>
 
-typedef struct asn1_SET_OF_specifics_s {
+typedef struct asn_SET_OF_specifics_s {
 	/*
 	 * Target structure description.
 	 */
 	int struct_size;	/* Size of the target structure. */
-	int ctx_offset;		/* Offset of the ber_dec_ctx_t member */
+	int ctx_offset;		/* Offset of the asn_struct_ctx_t member */
 
 	/* XER-specific stuff */
 	int as_XMLValueList;	/* The member type must be encoded like this */
-} asn1_SET_OF_specifics_t;
+} asn_SET_OF_specifics_t;
 
 /*
  * A set specialized functions dealing with the SET OF type.
diff --git a/skeletons/constr_TYPE.c b/skeletons/constr_TYPE.c
index c0e966a..4bc88d4 100644
--- a/skeletons/constr_TYPE.c
+++ b/skeletons/constr_TYPE.c
@@ -17,7 +17,7 @@
  * Return the outmost tag of the type.
  */
 ber_tlv_tag_t
-asn1_TYPE_outmost_tag(asn1_TYPE_descriptor_t *type_descriptor,
+asn_TYPE_outmost_tag(asn_TYPE_descriptor_t *type_descriptor,
 		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) {
 
 	if(tag_mode)
@@ -33,7 +33,7 @@
  * Print the target language's structure in human readable form.
  */
 int
-asn_fprint(FILE *stream, asn1_TYPE_descriptor_t *td, const void *struct_ptr) {
+asn_fprint(FILE *stream, asn_TYPE_descriptor_t *td, const void *struct_ptr) {
 	if(!stream) stream = stdout;
 	if(!td || !struct_ptr) {
 		errno = EINVAL;
diff --git a/skeletons/constraints.c b/skeletons/constraints.c
index 9b60545..e384352 100644
--- a/skeletons/constraints.c
+++ b/skeletons/constraints.c
@@ -2,7 +2,7 @@
 #include <constraints.h>
 
 int
-asn_generic_no_constraint(asn1_TYPE_descriptor_t *type_descriptor,
+asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor,
 	const void *struct_ptr, asn_app_consume_bytes_f *cb, void *key) {
 
 	(void)type_descriptor;	/* Unused argument */
@@ -15,7 +15,7 @@
 }
 
 int
-asn_generic_unknown_constraint(asn1_TYPE_descriptor_t *type_descriptor,
+asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor,
 	const void *struct_ptr, asn_app_consume_bytes_f *cb, void *key) {
 
 	(void)type_descriptor;	/* Unused argument */
@@ -54,7 +54,7 @@
 }
 
 int
-asn_check_constraints(asn1_TYPE_descriptor_t *type_descriptor,
+asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor,
 	const void *struct_ptr, char *errbuf, size_t *errlen) {
 
 	if(errlen) {
diff --git a/skeletons/constraints.h b/skeletons/constraints.h
index fe693ae..07eb836 100644
--- a/skeletons/constraints.h
+++ b/skeletons/constraints.h
@@ -7,7 +7,7 @@
 
 #include <asn_types.h>	/* System-dependent types */
 
-struct asn1_TYPE_descriptor_s;		/* Forward declaration */
+struct asn_TYPE_descriptor_s;		/* Forward declaration */
 
 /*
  * Validate the structure according to the ASN.1 constraints.
@@ -18,7 +18,7 @@
  * to encode an error message (properly 0-terminated).
  */
 int
-asn_check_constraints(struct asn1_TYPE_descriptor_s *type_descriptor,
+asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor,
 	const void *struct_ptr,	/* Target language's structure */
 	char *errbuf,		/* Returned error description */
 	size_t *errlen		/* Length of the error description */
@@ -29,7 +29,7 @@
  * associated with every type descriptor.
  */
 typedef int (asn_constr_check_f)(
-	struct asn1_TYPE_descriptor_s *type_descriptor,
+	struct asn_TYPE_descriptor_s *type_descriptor,
 	const void *struct_ptr,
 	asn_app_consume_bytes_f *optional_app_errlog,	/* Log the error */
 	void *optional_app_key		/* Opaque key passed to app_errlog */
diff --git a/skeletons/der_encoder.c b/skeletons/der_encoder.c
index 9ac0afb..3523cb1 100644
--- a/skeletons/der_encoder.c
+++ b/skeletons/der_encoder.c
@@ -13,7 +13,7 @@
  * The DER encoder of any type.
  */
 asn_enc_rval_t
-der_encode(asn1_TYPE_descriptor_t *type_descriptor, void *struct_ptr,
+der_encode(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr,
 	asn_app_consume_bytes_f *consume_bytes, void *app_key) {
 
 	ASN_DEBUG("DER encoder invoked for %s",
@@ -32,7 +32,7 @@
  * Write out leading TL[v] sequence according to the type definition.
  */
 ssize_t
-der_write_tags(asn1_TYPE_descriptor_t *sd,
+der_write_tags(asn_TYPE_descriptor_t *sd,
 		size_t struct_length,
 		int tag_mode, int last_tag_form,
 		ber_tlv_tag_t tag,	/* EXPLICIT or IMPLICIT tag */
diff --git a/skeletons/der_encoder.h b/skeletons/der_encoder.h
index 5a29613..62aafa7 100644
--- a/skeletons/der_encoder.h
+++ b/skeletons/der_encoder.h
@@ -7,12 +7,12 @@
 
 #include <asn_application.h>
 
-struct asn1_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
 
 /*
  * The DER encoder of any type. May be invoked by the application.
  */
-asn_enc_rval_t der_encode(struct asn1_TYPE_descriptor_s *type_descriptor,
+asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor,
 		void *struct_ptr,	/* Structure to be encoded */
 		asn_app_consume_bytes_f *consume_bytes_cb,
 		void *app_key		/* Arbitrary callback argument */
@@ -22,7 +22,7 @@
  * Type of the generic DER encoder.
  */
 typedef asn_enc_rval_t (der_type_encoder_f)(
-		struct asn1_TYPE_descriptor_s *type_descriptor,
+		struct asn_TYPE_descriptor_s *type_descriptor,
 		void *struct_ptr,	/* Structure to be encoded */
 		int tag_mode,		/* {-1,0,1}: IMPLICIT, no, EXPLICIT */
 		ber_tlv_tag_t tag,
@@ -39,7 +39,7 @@
  * Write out leading TL[v] sequence according to the type definition.
  */
 ssize_t der_write_tags(
-		struct asn1_TYPE_descriptor_s *type_descriptor,
+		struct asn_TYPE_descriptor_s *type_descriptor,
 		size_t struct_length,
 		int tag_mode,		/* {-1,0,1}: IMPLICIT, no, EXPLICIT */
 		int last_tag_form,	/* {0,!0}: prim, constructed */
diff --git a/skeletons/tests/check-GeneralizedTime.c b/skeletons/tests/check-GeneralizedTime.c
index 40008f0..6c35a1c 100644
--- a/skeletons/tests/check-GeneralizedTime.c
+++ b/skeletons/tests/check-GeneralizedTime.c
@@ -98,7 +98,7 @@
  */
 
 asn_enc_rval_t
-OCTET_STRING_encode_der(asn1_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
 
 	(void)td;
@@ -112,7 +112,7 @@
 }
 
 asn_enc_rval_t
-OCTET_STRING_encode_xer_ascii(asn1_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) {
+OCTET_STRING_encode_xer_ascii(asn_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
 
 	(void)td;
diff --git a/skeletons/tests/check-INTEGER.c b/skeletons/tests/check-INTEGER.c
index 03efc05..85e9b11 100644
--- a/skeletons/tests/check-INTEGER.c
+++ b/skeletons/tests/check-INTEGER.c
@@ -38,14 +38,14 @@
 	}
 	printf("]: ");
 
-	ret = asn1_INTEGER2long(&val, &rlong);
+	ret = asn_INTEGER2long(&val, &rlong);
 	printf(" (%ld, %d) vs (%ld, %d)\n",
 		rlong, ret, check_long, check_ret);
 	assert(ret == check_ret);
 	assert(rlong == check_long);
 
 	shared_scratch_start = scratch;
-	ret = INTEGER_print(&asn1_DEF_INTEGER, &val, 0, _print2buf, scratch);
+	ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch);
 	assert(shared_scratch_start < scratch + sizeof(scratch));
 	assert(ret == 0);
 	ret = snprintf(verify, sizeof(verify), "%ld", check_long);
diff --git a/skeletons/tests/check-OIDs.c b/skeletons/tests/check-OIDs.c
index e435c01..0cd4d14 100644
--- a/skeletons/tests/check-OIDs.c
+++ b/skeletons/tests/check-OIDs.c
@@ -31,7 +31,7 @@
 	printf("}\n");
 
 	oid = NULL;
-	rval = ber_decode(&asn1_DEF_OBJECT_IDENTIFIER, (void *)&oid, buf, len);
+	rval = ber_decode(0, &asn_DEF_OBJECT_IDENTIFIER, (void *)&oid, buf, len);
 	assert(rval.code == RC_OK);
 
 	assert(oid->size == (ssize_t)len - 2);
@@ -40,7 +40,7 @@
 	 * Print the contents for visual debugging.
 	 */
 	printf("OBJECT_IDENTIFIER_print() => ");
-	OBJECT_IDENTIFIER_print(&asn1_DEF_OBJECT_IDENTIFIER, oid, 0, _print, 0);
+	OBJECT_IDENTIFIER_print(&asn_DEF_OBJECT_IDENTIFIER, oid, 0, _print, 0);
 	printf("\n");
 
 	memset(arcs, 'A', sizeof(arcs));
@@ -78,7 +78,7 @@
 	printf("}\n");
 
 	oid = NULL;
-	rval = ber_decode(&asn1_DEF_RELATIVE_OID, (void *)&oid, buf, len);
+	rval = ber_decode(0, &asn_DEF_RELATIVE_OID, (void *)&oid, buf, len);
 	assert(rval.code == RC_OK);
 
 	assert(oid->size == (ssize_t)len - 2);
@@ -87,7 +87,7 @@
 	 * Print the contents for visual debugging.
 	 */
 	printf("RELATIVE_OID_print() => ");
-	RELATIVE_OID_print(&asn1_DEF_RELATIVE_OID, oid, 0, _print, 0);
+	RELATIVE_OID_print(&asn_DEF_RELATIVE_OID, oid, 0, _print, 0);
 	printf("\n");
 
 	memset(arcs, 'A', sizeof(arcs));
diff --git a/skeletons/tests/check-REAL.c b/skeletons/tests/check-REAL.c
index 89ab326..33f6918 100644
--- a/skeletons/tests/check-REAL.c
+++ b/skeletons/tests/check-REAL.c
@@ -69,7 +69,7 @@
 		printf("%02x", *p);
 	printf("]\n");
 
-	ret = asn1_double2REAL(rn, orig_dbl);
+	ret = asn_double2REAL(rn, orig_dbl);
 	assert(ret == 0);
 
 	printf("converted into [");
@@ -77,7 +77,7 @@
 		printf("%02x", *p);
 	printf("]: %d\n", rn->size);
 
-	ret = asn1_REAL2double(rn, &val);
+	ret = asn_REAL2double(rn, &val);
 	assert(ret == 0);
 
 	printf("and back to double: [");
@@ -114,7 +114,7 @@
 	rn.buf = 0;
 	rn.size = 0;
 
-	ret = asn1_double2REAL(&rn, verify);
+	ret = asn_double2REAL(&rn, verify);
 	assert(ret == 0);
 
 	printf("canonical DER: [");
@@ -130,7 +130,7 @@
 		printf("%02x", *p);
 	printf("]\n");
 
-	ret = asn1_REAL2double(&rn, &val);
+	ret = asn_REAL2double(&rn, &val);
 	assert(ret == 0);
 
 	printf("%.12f vs %.12f\n", verify, val);
diff --git a/skeletons/tests/check-UTCTime.c b/skeletons/tests/check-UTCTime.c
index b8ad57b..d626359 100644
--- a/skeletons/tests/check-UTCTime.c
+++ b/skeletons/tests/check-UTCTime.c
@@ -65,7 +65,7 @@
  */
 
 asn_enc_rval_t
-OCTET_STRING_encode_der(asn1_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
 
 	(void)td;
@@ -79,7 +79,7 @@
 }
 
 asn_enc_rval_t
-OCTET_STRING_encode_xer_ascii(asn1_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) {
+OCTET_STRING_encode_xer_ascii(asn_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t erval;
 
 	(void)td;
diff --git a/skeletons/xer_encoder.c b/skeletons/xer_encoder.c
index 876980e..3c97a8f 100644
--- a/skeletons/xer_encoder.c
+++ b/skeletons/xer_encoder.c
@@ -11,7 +11,7 @@
  * The XER encoder of any type. May be invoked by the application.
  */
 asn_enc_rval_t
-xer_encode(asn1_TYPE_descriptor_t *td, void *sptr,
+xer_encode(asn_TYPE_descriptor_t *td, void *sptr,
 	enum xer_encoder_flags_e xer_flags,
 		asn_app_consume_bytes_f *cb, void *app_key) {
 	asn_enc_rval_t er, tmper;
@@ -56,7 +56,7 @@
 }
 
 int
-xer_fprint(FILE *stream, asn1_TYPE_descriptor_t *td, void *sptr) {
+xer_fprint(FILE *stream, asn_TYPE_descriptor_t *td, void *sptr) {
 	asn_enc_rval_t er;
 
 	if(!stream) stream = stdout;
diff --git a/skeletons/xer_encoder.h b/skeletons/xer_encoder.h
index 8a619ca..5f9bbf2 100644
--- a/skeletons/xer_encoder.h
+++ b/skeletons/xer_encoder.h
@@ -7,7 +7,7 @@
 
 #include <asn_application.h>
 
-struct asn1_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
 
 /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */
 enum xer_encoder_flags_e {
@@ -19,7 +19,7 @@
 /*
  * The XER encoder of any type. May be invoked by the application.
  */
-asn_enc_rval_t xer_encode(struct asn1_TYPE_descriptor_s *type_descriptor,
+asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor,
 		void *struct_ptr,	/* Structure to be encoded */
 		enum xer_encoder_flags_e xer_flags,
 		asn_app_consume_bytes_f *consume_bytes_cb,
@@ -34,13 +34,13 @@
  * 	-1: Problem printing the structure.
  * WARNING: No sensible errno value is returned.
  */
-int xer_fprint(FILE *stream, struct asn1_TYPE_descriptor_s *td, void *sptr);
+int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr);
 
 /*
  * Type of the generic XER encoder.
  */
 typedef asn_enc_rval_t (xer_type_encoder_f)(
-		struct asn1_TYPE_descriptor_s *type_descriptor,
+		struct asn_TYPE_descriptor_s *type_descriptor,
 		void *struct_ptr,	/* Structure to be encoded */
 		int ilevel,		/* Level of indentation */
 		enum xer_encoder_flags_e xer_flags,