add const
diff --git a/skeletons/ANY.c b/skeletons/ANY.c
index 8a7457e..1e670ba 100644
--- a/skeletons/ANY.c
+++ b/skeletons/ANY.c
@@ -184,7 +184,7 @@
 #ifndef ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-ANY_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                 const asn_per_constraints_t *constraints, void **sptr,
                 asn_per_data_t *pd) {
     asn_OCTET_STRING_specifics_t *specs =
diff --git a/skeletons/BIT_STRING_oer.c b/skeletons/BIT_STRING_oer.c
index 9886646..a470e09 100644
--- a/skeletons/BIT_STRING_oer.c
+++ b/skeletons/BIT_STRING_oer.c
@@ -10,7 +10,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-BIT_STRING_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                       const asn_oer_constraints_t *constraints, void **sptr,
                       const void *ptr, size_t size) {
     BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
diff --git a/skeletons/BMPString.c b/skeletons/BMPString.c
index 649882e..80a3f8b 100644
--- a/skeletons/BMPString.c
+++ b/skeletons/BMPString.c
@@ -128,7 +128,7 @@
 }
 
 asn_dec_rval_t
-BMPString_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+BMPString_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 		const char *opt_mname, const void *buf_ptr, size_t size) {
 	asn_dec_rval_t rc;
diff --git a/skeletons/BOOLEAN.c b/skeletons/BOOLEAN.c
index 7b941e7..7161698 100644
--- a/skeletons/BOOLEAN.c
+++ b/skeletons/BOOLEAN.c
@@ -55,7 +55,7 @@
  * Decode BOOLEAN type.
  */
 asn_dec_rval_t
-BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+BOOLEAN_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
 		asn_TYPE_descriptor_t *td,
 		void **bool_value, const void *buf_ptr, size_t size,
 		int tag_mode) {
@@ -184,7 +184,7 @@
 
 
 asn_dec_rval_t
-BOOLEAN_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
@@ -262,7 +262,7 @@
 }
 
 asn_dec_rval_t
-BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+BOOLEAN_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                     const asn_per_constraints_t *constraints, void **sptr,
                     asn_per_data_t *pd) {
     asn_dec_rval_t rv;
diff --git a/skeletons/ENUMERATED.c b/skeletons/ENUMERATED.c
index 4ec97c2..ffc61e3 100644
--- a/skeletons/ENUMERATED.c
+++ b/skeletons/ENUMERATED.c
@@ -54,7 +54,7 @@
 };
 
 asn_dec_rval_t
-ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
+ENUMERATED_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
                        asn_TYPE_descriptor_t *td,
                        const asn_per_constraints_t *constraints, void **sptr,
                        asn_per_data_t *pd) {
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index 682e257..4dfb1f8 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -541,7 +541,7 @@
 }
 
 asn_dec_rval_t
-INTEGER_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
@@ -572,7 +572,7 @@
 #ifndef	ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                     const asn_per_constraints_t *constraints, void **sptr,
                     asn_per_data_t *pd) {
     const asn_INTEGER_specifics_t *specs =
diff --git a/skeletons/INTEGER_oer.c b/skeletons/INTEGER_oer.c
index 5b40c43..240da87 100644
--- a/skeletons/INTEGER_oer.c
+++ b/skeletons/INTEGER_oer.c
@@ -10,7 +10,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-INTEGER_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                    const asn_oer_constraints_t *constraints, void **sptr,
                    const void *ptr, size_t size) {
     const asn_INTEGER_specifics_t *specs =
diff --git a/skeletons/NULL.c b/skeletons/NULL.c
index c49328b..1354ea4 100644
--- a/skeletons/NULL.c
+++ b/skeletons/NULL.c
@@ -102,7 +102,7 @@
 }
 
 asn_dec_rval_t
-NULL_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
@@ -136,7 +136,7 @@
 #ifndef ASN_DISABLE_OER_SUPPORT
 
 asn_dec_rval_t
-NULL_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                   const asn_oer_constraints_t *constraints, void **struct_ptr,
                   const void *ptr, size_t size) {
     asn_dec_rval_t rv = {RC_OK, 0};
@@ -171,7 +171,7 @@
 #ifndef ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-NULL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+NULL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                  const asn_per_constraints_t *constraints, void **sptr,
                  asn_per_data_t *pd) {
     asn_dec_rval_t rv;
diff --git a/skeletons/NativeEnumerated.c b/skeletons/NativeEnumerated.c
index 3087c18..098c44e 100644
--- a/skeletons/NativeEnumerated.c
+++ b/skeletons/NativeEnumerated.c
@@ -89,7 +89,7 @@
 }
 
 asn_dec_rval_t
-NativeEnumerated_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
+NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, const asn_per_constraints_t *constraints,
 	void **sptr, asn_per_data_t *pd) {
     const asn_INTEGER_specifics_t *specs =
diff --git a/skeletons/NativeEnumerated_oer.c b/skeletons/NativeEnumerated_oer.c
index d40c781..b1f67c2 100644
--- a/skeletons/NativeEnumerated_oer.c
+++ b/skeletons/NativeEnumerated_oer.c
@@ -10,7 +10,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-NativeEnumerated_decode_oer(asn_codec_ctx_t *opt_codec_ctx,
+NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
                             asn_TYPE_descriptor_t *td,
                             const asn_oer_constraints_t *constraints,
                             void **nint_ptr, const void *ptr, size_t size) {
diff --git a/skeletons/NativeInteger.c b/skeletons/NativeInteger.c
index 234306c..286233e 100644
--- a/skeletons/NativeInteger.c
+++ b/skeletons/NativeInteger.c
@@ -62,7 +62,7 @@
  * Decode INTEGER type.
  */
 asn_dec_rval_t
-NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td,
 	void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) {
     const asn_INTEGER_specifics_t *specs =
@@ -185,7 +185,7 @@
  * Decode the chunk of XML text encoding INTEGER.
  */
 asn_dec_rval_t
-NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
     const asn_INTEGER_specifics_t *specs =
@@ -254,7 +254,7 @@
 #ifndef  ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
+NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
                           asn_TYPE_descriptor_t *td,
                           const asn_per_constraints_t *constraints, void **sptr,
                           asn_per_data_t *pd) {
diff --git a/skeletons/NativeInteger_oer.c b/skeletons/NativeInteger_oer.c
index 25794e2..f13f782 100644
--- a/skeletons/NativeInteger_oer.c
+++ b/skeletons/NativeInteger_oer.c
@@ -10,7 +10,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx,
+NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
                          asn_TYPE_descriptor_t *td,
                          const asn_oer_constraints_t *constraints,
                          void **nint_ptr, const void *ptr, size_t size) {
diff --git a/skeletons/NativeReal.c b/skeletons/NativeReal.c
index 2a556e8..89cd005 100644
--- a/skeletons/NativeReal.c
+++ b/skeletons/NativeReal.c
@@ -64,7 +64,7 @@
  * Decode REAL type.
  */
 asn_dec_rval_t
-NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+NativeReal_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td,
 	void **dbl_ptr, const void *buf_ptr, size_t size, int tag_mode) {
 	double *Dbl = (double *)*dbl_ptr;
@@ -212,7 +212,7 @@
  * Decode REAL type using PER.
  */
 asn_dec_rval_t
-NativeReal_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
+NativeReal_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
                        asn_TYPE_descriptor_t *td,
                        const asn_per_constraints_t *constraints, void **dbl_ptr,
                        asn_per_data_t *pd) {
@@ -285,7 +285,7 @@
  * Decode the chunk of XML text encoding REAL.
  */
 asn_dec_rval_t
-NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+NativeReal_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 	asn_dec_rval_t rval;
diff --git a/skeletons/OBJECT_IDENTIFIER.c b/skeletons/OBJECT_IDENTIFIER.c
index ccb6b98..ffca36e 100644
--- a/skeletons/OBJECT_IDENTIFIER.c
+++ b/skeletons/OBJECT_IDENTIFIER.c
@@ -327,7 +327,7 @@
 }
 
 asn_dec_rval_t
-OBJECT_IDENTIFIER_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+OBJECT_IDENTIFIER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c
index 75b9448..844c6f2 100644
--- a/skeletons/OCTET_STRING.c
+++ b/skeletons/OCTET_STRING.c
@@ -182,7 +182,7 @@
  * Decode OCTET STRING type.
  */
 asn_dec_rval_t
-OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td,
 	void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
 	asn_OCTET_STRING_specifics_t *specs = td->specifics
@@ -1115,7 +1115,7 @@
  * Decode OCTET STRING from the XML element's body.
  */
 static asn_dec_rval_t
-OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING__decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 	const char *opt_mname, const void *buf_ptr, size_t size,
 	int (*opt_unexpected_tag_decoder)
@@ -1175,7 +1175,7 @@
  * Decode OCTET STRING from the hexadecimal data.
  */
 asn_dec_rval_t
-OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 		const char *opt_mname, const void *buf_ptr, size_t size) {
 	return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
@@ -1186,7 +1186,7 @@
  * Decode OCTET STRING from the binary (0/1) data.
  */
 asn_dec_rval_t
-OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 		const char *opt_mname, const void *buf_ptr, size_t size) {
 	return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
@@ -1197,7 +1197,7 @@
  * Decode OCTET STRING from the string (ASCII/UTF-8) data.
  */
 asn_dec_rval_t
-OCTET_STRING_decode_xer_utf8(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 		const char *opt_mname, const void *buf_ptr, size_t size) {
 	return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
@@ -1338,7 +1338,7 @@
 #ifndef  ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
                          asn_TYPE_descriptor_t *td,
                          const asn_per_constraints_t *constraints, void **sptr,
                          asn_per_data_t *pd) {
diff --git a/skeletons/OCTET_STRING_oer.c b/skeletons/OCTET_STRING_oer.c
index 9e6c2aa..4ea705a 100644
--- a/skeletons/OCTET_STRING_oer.c
+++ b/skeletons/OCTET_STRING_oer.c
@@ -10,7 +10,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-OCTET_STRING_decode_oer(asn_codec_ctx_t *opt_codec_ctx,
+OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
                         asn_TYPE_descriptor_t *td,
                         const asn_oer_constraints_t *constraints, void **sptr,
                         const void *ptr, size_t size) {
diff --git a/skeletons/OPEN_TYPE.c b/skeletons/OPEN_TYPE.c
index 05b2d80..9417d9a 100644
--- a/skeletons/OPEN_TYPE.c
+++ b/skeletons/OPEN_TYPE.c
@@ -36,7 +36,7 @@
     } while(0)
 
 asn_dec_rval_t
-OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                   void *sptr, asn_TYPE_member_t *elm, const void *ptr,
                   size_t size) {
     size_t consumed_myself = 0;
@@ -120,7 +120,7 @@
 }
 
 asn_dec_rval_t
-OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                   void *sptr, asn_TYPE_member_t *elm, const void *ptr,
                   size_t size) {
     size_t consumed_myself = 0;
@@ -283,7 +283,7 @@
 #ifndef  ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx,
+OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
                    asn_TYPE_descriptor_t *td, void *sptr,
                    asn_TYPE_member_t *elm, asn_per_data_t *pd) {
     asn_type_selector_result_t selected;
diff --git a/skeletons/OPEN_TYPE.h b/skeletons/OPEN_TYPE.h
index 22583b8..617fb6a 100644
--- a/skeletons/OPEN_TYPE.h
+++ b/skeletons/OPEN_TYPE.h
@@ -27,25 +27,25 @@
  * Decode an Open Type which is potentially constraiend
  * by the other members of the parent structure.
  */
-asn_dec_rval_t OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx,
+asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
                                  asn_TYPE_descriptor_t *parent_type,
                                  void *parent_structure,
                                  asn_TYPE_member_t *element, const void *ptr,
                                  size_t size);
 
-asn_dec_rval_t OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx,
+asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
                                  asn_TYPE_descriptor_t *parent_type,
                                  void *parent_structure,
                                  asn_TYPE_member_t *element, const void *ptr,
                                  size_t size);
 
-asn_dec_rval_t OPEN_TYPE_oer_get(asn_codec_ctx_t *opt_codec_ctx,
+asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
                                   asn_TYPE_descriptor_t *parent_type,
                                   void *parent_structure,
                                   asn_TYPE_member_t *element,
                                   const void *ptr, size_t size);
 
-asn_dec_rval_t OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx,
+asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
                                   asn_TYPE_descriptor_t *parent_type,
                                   void *parent_structure,
                                   asn_TYPE_member_t *element,
diff --git a/skeletons/OPEN_TYPE_oer.c b/skeletons/OPEN_TYPE_oer.c
index 51704cd..4823f9d 100644
--- a/skeletons/OPEN_TYPE_oer.c
+++ b/skeletons/OPEN_TYPE_oer.c
@@ -8,7 +8,7 @@
 #include <errno.h>
 
 asn_dec_rval_t
-OPEN_TYPE_oer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                   void *sptr, asn_TYPE_member_t *elm, const void *ptr,
                   size_t size) {
     asn_type_selector_result_t selected;
diff --git a/skeletons/REAL.c b/skeletons/REAL.c
index f036dcd..0bdeb82 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -429,7 +429,7 @@
 }
 
 asn_dec_rval_t
-REAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+REAL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
@@ -805,7 +805,7 @@
 #ifndef ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-REAL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+REAL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                  const asn_per_constraints_t *constraints, void **sptr,
                  asn_per_data_t *pd) {
     (void)constraints;	/* No PER visible constraints */
diff --git a/skeletons/RELATIVE-OID.c b/skeletons/RELATIVE-OID.c
index 008847a..82850f1 100644
--- a/skeletons/RELATIVE-OID.c
+++ b/skeletons/RELATIVE-OID.c
@@ -150,7 +150,7 @@
 }
 
 asn_dec_rval_t
-RELATIVE_OID_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+RELATIVE_OID_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 
diff --git a/skeletons/UniversalString.c b/skeletons/UniversalString.c
index 88d54c6..453c6a8 100644
--- a/skeletons/UniversalString.c
+++ b/skeletons/UniversalString.c
@@ -146,7 +146,7 @@
 }
 
 asn_dec_rval_t
-UniversalString_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
+UniversalString_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td, void **sptr,
 		const char *opt_mname, const void *buf_ptr, size_t size) {
 	asn_dec_rval_t rc;
diff --git a/skeletons/asn_application.c b/skeletons/asn_application.c
index d7a2bcb..46f1aa8 100644
--- a/skeletons/asn_application.c
+++ b/skeletons/asn_application.c
@@ -7,7 +7,7 @@
 #include <errno.h>
 
 static asn_enc_rval_t asn_encode_internal(
-    const asn_codec_ctx_t *opt_codec_parameters,
+    const asn_codec_ctx_t *opt_codec_ctx,
     enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
     void *sptr, asn_app_consume_bytes_f *callback, void *callback_key);
 
@@ -85,7 +85,7 @@
 }
 
 asn_enc_rval_t
-asn_encode(const asn_codec_ctx_t *opt_codec_parameters,
+asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
            enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
            void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
     struct callback_failure_catch_key cb_key;
@@ -100,7 +100,7 @@
     cb_key.callback_key = callback_key;
     cb_key.callback_failed = 0;
 
-    er = asn_encode_internal(opt_codec_parameters, syntax, td, sptr,
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
                              callback_failure_catch_cb, &cb_key);
     if(cb_key.callback_failed) {
         assert(er.encoded == -1);
@@ -112,7 +112,7 @@
 }
 
 asn_enc_rval_t
-asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters,
+asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx,
                      enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
                      void *sptr, void *buffer, size_t buffer_size) {
     struct overrun_encoder_key buf_key;
@@ -127,7 +127,7 @@
     buf_key.buffer_size = buffer_size;
     buf_key.computed_size = 0;
 
-    er = asn_encode_internal(opt_codec_parameters, syntax, td, sptr,
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
                              overrun_encoder_cb, &buf_key);
 
     assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
@@ -136,14 +136,14 @@
 }
 
 static asn_enc_rval_t
-asn_encode_internal(const asn_codec_ctx_t *opt_codec_parameters,
+asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
                     enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
                     void *sptr, asn_app_consume_bytes_f *callback,
                     void *callback_key) {
     asn_enc_rval_t er;
     enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
 
-    (void)opt_codec_parameters; /* Parameters are not checked on encode yet. */
+    (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
 
     if(!td || !sptr) {
         errno = EINVAL;
@@ -294,13 +294,10 @@
 }
 
 asn_dec_rval_t
-asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
+asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
            enum asn_transfer_syntax syntax, struct asn_TYPE_descriptor_s *td,
            void **sptr, const void *buffer, size_t size) {
 
-    (void)opt_codec_parameters;
-    asn_codec_ctx_t *opt_ctx = 0;
-
     if(!td || !sptr || (size && !buffer)) {
         ASN__DECODE_FAILED;
     }
@@ -314,7 +311,7 @@
 
     case ATS_DER:
     case ATS_BER:
-        return ber_decode(opt_ctx, td, sptr, buffer, size);
+        return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
 
     case ATS_BASIC_OER:
     case ATS_CANONICAL_OER:
@@ -322,7 +319,7 @@
         errno = ENOENT;
         ASN__DECODE_FAILED;
 #else
-        return oer_decode(opt_ctx, td, sptr, buffer, size);
+        return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
 #endif
 
     case ATS_UNALIGNED_BASIC_PER:
@@ -331,12 +328,12 @@
         errno = ENOENT;
         ASN__DECODE_FAILED;
 #else
-        return uper_decode_complete(opt_ctx, td, sptr, buffer, size);
+        return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
 #endif
 
     case ATS_BASIC_XER:
     case ATS_CANONICAL_XER:
-        return xer_decode(opt_ctx, td, sptr, buffer, size);
+        return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
     }
 }
 
diff --git a/skeletons/asn_codecs_prim.c b/skeletons/asn_codecs_prim.c
index 2737ea8..f15a18d 100644
--- a/skeletons/asn_codecs_prim.c
+++ b/skeletons/asn_codecs_prim.c
@@ -10,7 +10,7 @@
  * Decode an always-primitive type.
  */
 asn_dec_rval_t
-ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
+ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td,
 	void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
 	ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
@@ -248,7 +248,7 @@
 
 
 asn_dec_rval_t
-xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
+xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *td,
 	void **sptr,
 	size_t struct_size,
diff --git a/skeletons/asn_codecs_prim.h b/skeletons/asn_codecs_prim.h
index 7b75029..917c892 100644
--- a/skeletons/asn_codecs_prim.h
+++ b/skeletons/asn_codecs_prim.h
@@ -38,7 +38,7 @@
  * Specific function to decode simple primitive types.
  * Also see xer_decode_general() in xer_decoder.h
  */
-asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
+asn_dec_rval_t xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *type_descriptor,
 	void **struct_ptr, size_t struct_size,
 	const char *opt_mname,
diff --git a/skeletons/asn_internal.h b/skeletons/asn_internal.h
index ebf44f9..3479736 100644
--- a/skeletons/asn_internal.h
+++ b/skeletons/asn_internal.h
@@ -108,11 +108,11 @@
  */
 #define	ASN__DEFAULT_STACK_MAX	(30000)
 static int GCC_NOTUSED
-ASN__STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) {
+ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
 	if(ctx && ctx->max_stack_size) {
 
 		/* ctx MUST be allocated on the stack */
-		ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx);
+		ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx);
 		if(usedstack > 0) usedstack = -usedstack; /* grows up! */
 
 		/* double negative required to avoid int wrap-around */
diff --git a/skeletons/ber_decoder.c b/skeletons/ber_decoder.c
index 919dea6..fffd1a1 100644
--- a/skeletons/ber_decoder.c
+++ b/skeletons/ber_decoder.c
@@ -27,7 +27,7 @@
  * The BER decoder of any type.
  */
 asn_dec_rval_t
-ber_decode(asn_codec_ctx_t *opt_codec_ctx,
+ber_decode(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *type_descriptor,
 	void **struct_ptr, const void *ptr, size_t size) {
 	asn_codec_ctx_t s_codec_ctx;
@@ -62,7 +62,7 @@
  * Check the set of <TL<TL<TL...>>> tags matches the definition.
  */
 asn_dec_rval_t
-ber_check_tags(asn_codec_ctx_t *opt_codec_ctx,
+ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx,
 		asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx,
 		const void *ptr, size_t size, int tag_mode, int last_tag_form,
 		ber_tlv_len_t *last_length, int *opt_tlv_form) {
diff --git a/skeletons/ber_decoder.h b/skeletons/ber_decoder.h
index 2049428..e9907bd 100644
--- a/skeletons/ber_decoder.h
+++ b/skeletons/ber_decoder.h
@@ -22,7 +22,7 @@
  * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
  * which is compliant with ber_decode().
  */
-asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx,
+asn_dec_rval_t ber_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
 	struct asn_TYPE_descriptor_s *type_descriptor,
 	void **struct_ptr,	/* Pointer to a target structure's pointer */
 	const void *buffer,	/* Data to be decoded */
@@ -33,7 +33,7 @@
  * Type of generic function which decodes the byte stream into the structure.
  */
 typedef asn_dec_rval_t (ber_type_decoder_f)(
-		struct asn_codec_ctx_s *opt_codec_ctx,
+		const struct asn_codec_ctx_s *opt_codec_ctx,
 		struct asn_TYPE_descriptor_s *type_descriptor,
 		void **struct_ptr, const void *buf_ptr, size_t size,
 		int tag_mode);
@@ -50,7 +50,7 @@
  * head->last_tag_form is non-zero.
  */
 asn_dec_rval_t ber_check_tags(
-		struct asn_codec_ctx_s *opt_codec_ctx,	/* codec options */
+		const struct asn_codec_ctx_s *opt_codec_ctx,	/* codec options */
 		struct asn_TYPE_descriptor_s *type_descriptor,
 		asn_struct_ctx_t *opt_ctx,	/* saved decoding context */
 		const void *ptr, size_t size,
diff --git a/skeletons/ber_tlv_length.c b/skeletons/ber_tlv_length.c
index 4c2f1e5..47459aa 100644
--- a/skeletons/ber_tlv_length.c
+++ b/skeletons/ber_tlv_length.c
@@ -75,7 +75,7 @@
 }
 
 ssize_t
-ber_skip_length(asn_codec_ctx_t *opt_codec_ctx,
+ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx,
 		int _is_constructed, const void *ptr, size_t size) {
 	ber_tlv_len_t vlen;	/* Length of V in TLV */
 	ssize_t tl;		/* Length of L in TLV */
diff --git a/skeletons/ber_tlv_length.h b/skeletons/ber_tlv_length.h
index 3496802..f7f95e5 100644
--- a/skeletons/ber_tlv_length.h
+++ b/skeletons/ber_tlv_length.h
@@ -32,7 +32,7 @@
  * 	Standard {-1,0,>0} convention.
  */
 ssize_t ber_skip_length(
-	struct asn_codec_ctx_s *opt_codec_ctx,	/* optional context */
+	const struct asn_codec_ctx_s *opt_codec_ctx,	/* optional context */
 	int _is_constructed, const void *bufptr, size_t size);
 
 /*
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 3d0cbbe..ed5cebe 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -103,7 +103,7 @@
  * The decoder of the CHOICE type.
  */
 asn_dec_rval_t
-CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
@@ -549,7 +549,7 @@
  * Decode the XER (XML) data.
  */
 asn_dec_rval_t
-CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 	/*
@@ -830,7 +830,7 @@
 }
 
 asn_dec_rval_t
-CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                    const asn_per_constraints_t *constraints, void **sptr,
                    asn_per_data_t *pd) {
     asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
diff --git a/skeletons/constr_CHOICE_oer.c b/skeletons/constr_CHOICE_oer.c
index 6cd7a0a..4319fde 100644
--- a/skeletons/constr_CHOICE_oer.c
+++ b/skeletons/constr_CHOICE_oer.c
@@ -125,7 +125,7 @@
 }
 
 asn_dec_rval_t
-CHOICE_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                   const asn_oer_constraints_t *constraints, void **struct_ptr,
                   const void *ptr, size_t size) {
     /*
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index a810f3d..9fe88f7 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -110,7 +110,7 @@
  * The decoder of the SEQUENCE type.
  */
 asn_dec_rval_t
-SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
@@ -626,7 +626,7 @@
  * Decode the XER (XML) data.
  */
 asn_dec_rval_t
-SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const char *opt_mname,
 		const void *ptr, size_t size) {
 	/*
@@ -1079,7 +1079,7 @@
 #ifndef ASN_DISABLE_PER_SUPPORT
 
 asn_dec_rval_t
-SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                      const asn_per_constraints_t *constraints, void **sptr,
                      asn_per_data_t *pd) {
 	asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
diff --git a/skeletons/constr_SEQUENCE_oer.c b/skeletons/constr_SEQUENCE_oer.c
index 657d356..eb5d6d4 100644
--- a/skeletons/constr_SEQUENCE_oer.c
+++ b/skeletons/constr_SEQUENCE_oer.c
@@ -76,7 +76,7 @@
 }
 
 asn_dec_rval_t
-SEQUENCE_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                     const asn_oer_constraints_t *constraints, void **struct_ptr,
                     const void *ptr, size_t size) {
     asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c
index a0bacb5..deff98f 100644
--- a/skeletons/constr_SET.c
+++ b/skeletons/constr_SET.c
@@ -94,7 +94,7 @@
  * The decoder of the SET type.
  */
 asn_dec_rval_t
-SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
@@ -605,7 +605,7 @@
  * Decode the XER (XML) data.
  */
 asn_dec_rval_t
-SET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 	/*
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index c24a956..3ff8189 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -66,7 +66,7 @@
  * The decoder of the SET OF type.
  */
 asn_dec_rval_t
-SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
 	/*
 	 * Bring closer parts of structure description.
@@ -466,7 +466,7 @@
  * Decode the XER (XML) data.
  */
 asn_dec_rval_t
-SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 	void **struct_ptr, const char *opt_mname,
 		const void *buf_ptr, size_t size) {
 	/*
@@ -873,7 +873,7 @@
 }
 
 asn_dec_rval_t
-SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                    const asn_per_constraints_t *constraints, void **sptr,
                    asn_per_data_t *pd) {
 	asn_dec_rval_t rv;
diff --git a/skeletons/constr_SET_OF_oer.c b/skeletons/constr_SET_OF_oer.c
index 5246a74..8cbf81f 100644
--- a/skeletons/constr_SET_OF_oer.c
+++ b/skeletons/constr_SET_OF_oer.c
@@ -107,7 +107,7 @@
 }
 
 asn_dec_rval_t
-SET_OF_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
                     const asn_oer_constraints_t *constraints, void **struct_ptr,
                     const void *ptr, size_t size) {
     asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
diff --git a/skeletons/oer_decoder.c b/skeletons/oer_decoder.c
index 2e6d279..52f56de 100644
--- a/skeletons/oer_decoder.c
+++ b/skeletons/oer_decoder.c
@@ -8,7 +8,7 @@
  * The OER decoder of any type.
  */
 asn_dec_rval_t
-oer_decode(asn_codec_ctx_t *opt_codec_ctx,
+oer_decode(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_TYPE_descriptor_t *type_descriptor,
 	void **struct_ptr, const void *ptr, size_t size) {
 	asn_codec_ctx_t s_codec_ctx;
@@ -56,7 +56,7 @@
  *      >0:     Number of bytes used from bufptr.
  */
 ssize_t
-oer_open_type_get(asn_codec_ctx_t *opt_codec_ctx,
+oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
                   struct asn_TYPE_descriptor_s *td,
                   asn_oer_constraints_t *constraints, void **struct_ptr,
                   const void *bufptr, size_t size) {
diff --git a/skeletons/oer_decoder.h b/skeletons/oer_decoder.h
index 1577d4e..db6005f 100644
--- a/skeletons/oer_decoder.h
+++ b/skeletons/oer_decoder.h
@@ -20,7 +20,7 @@
  * This function may be invoked directly by the application.
  * Parses CANONICAL-OER and BASIC-OER.
  */
-asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx,
+asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
 	struct asn_TYPE_descriptor_s *type_descriptor,
 	void **struct_ptr,	/* Pointer to a target structure's pointer */
 	const void *buffer,	/* Data to be decoded */
@@ -31,7 +31,7 @@
  * Type of generic function which decodes the byte stream into the structure.
  */
 typedef asn_dec_rval_t(oer_type_decoder_f)(
-    struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_codec_ctx_s *opt_codec_ctx,
     struct asn_TYPE_descriptor_s *type_descriptor,
     const asn_oer_constraints_t *constraints,
     void **struct_ptr,
@@ -54,7 +54,7 @@
  *      -1:     Fatal error deciphering length.
  *      >0:     Number of bytes used from bufptr.
  */
-ssize_t oer_open_type_get(asn_codec_ctx_t *opt_codec_ctx,
+ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
                           struct asn_TYPE_descriptor_s *td,
                           asn_oer_constraints_t *constraints, void **struct_ptr,
                           const void *bufptr, size_t size);
diff --git a/skeletons/per_decoder.c b/skeletons/per_decoder.c
index a31fe8e..6fe71dc 100644
--- a/skeletons/per_decoder.c
+++ b/skeletons/per_decoder.c
@@ -8,7 +8,7 @@
  * multiple of 8 bytes.
  */
 asn_dec_rval_t
-uper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) {
+uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) {
 	asn_dec_rval_t rval;
 
 	rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
@@ -37,7 +37,7 @@
 }
 
 asn_dec_rval_t
-uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
+uper_decode(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
 	asn_codec_ctx_t s_codec_ctx;
 	asn_dec_rval_t rval;
 	asn_per_data_t pd;
diff --git a/skeletons/per_decoder.h b/skeletons/per_decoder.h
index 0a50705..e97dd78 100644
--- a/skeletons/per_decoder.h
+++ b/skeletons/per_decoder.h
@@ -18,36 +18,37 @@
  * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1.
  * On success, this call always returns (.consumed >= 1), as per #11.1.3.
  */
-asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx,
-	struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
-	void **struct_ptr,	/* Pointer to a target structure's pointer */
-	const void *buffer,	/* Data to be decoded */
-	size_t size		/* Size of data buffer */
-	);
+asn_dec_rval_t uper_decode_complete(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+    );
 
 /*
  * Unaligned PER decoder of any ASN.1 type. May be invoked by the application.
  * WARNING: This call returns the number of BITS read from the stream. Beware.
  */
-asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx,
-	struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
-	void **struct_ptr,	/* Pointer to a target structure's pointer */
-	const void *buffer,	/* Data to be decoded */
-	size_t size,		/* Size of data buffer */
-	int skip_bits,		/* Number of unused leading bits, 0..7 */
-	int unused_bits		/* Number of unused tailing bits, 0..7 */
-	);
+asn_dec_rval_t uper_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size,        /* Size of data buffer */
+    int skip_bits,      /* Number of unused leading bits, 0..7 */
+    int unused_bits     /* Number of unused tailing bits, 0..7 */
+    );
 
 
 /*
  * Type of the type-specific PER decoder function.
  */
-typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
-		struct asn_TYPE_descriptor_s *type_descriptor,
-		const asn_per_constraints_t *constraints,
-		void **struct_ptr,
-		asn_per_data_t *per_data
-	);
+typedef asn_dec_rval_t(per_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, void **struct_ptr,
+    asn_per_data_t *per_data);
 
 #ifdef __cplusplus
 }
diff --git a/skeletons/per_opentype.c b/skeletons/per_opentype.c
index 8d6f9f1..ce45c0d 100644
--- a/skeletons/per_opentype.c
+++ b/skeletons/per_opentype.c
@@ -16,7 +16,7 @@
 
 static int uper_ugot_refill(asn_per_data_t *pd);
 static int per_skip_bits(asn_per_data_t *pd, int skip_nbits);
-static asn_dec_rval_t uper_sot_suck(asn_codec_ctx_t *,
+static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *,
                                     asn_TYPE_descriptor_t *td,
                                     const asn_per_constraints_t *constraints,
                                     void **sptr, asn_per_data_t *pd);
@@ -57,7 +57,7 @@
 }
 
 static asn_dec_rval_t
-uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
+uper_open_type_get_simple(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
 	const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
 	asn_dec_rval_t rv;
 	ssize_t chunk_bytes;
@@ -135,7 +135,7 @@
 }
 
 static asn_dec_rval_t GCC_NOTUSED
-uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
+uper_open_type_get_complex(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
 	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
 	uper_ugot_key arg;
 	asn_dec_rval_t rv;
@@ -245,14 +245,14 @@
 
 
 asn_dec_rval_t
-uper_open_type_get(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
+uper_open_type_get(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
                    const asn_per_constraints_t *constraints, void **sptr,
                    asn_per_data_t *pd) {
     return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
 }
 
 int
-uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
 	asn_TYPE_descriptor_t s_td;
     asn_TYPE_operation_t s_op;
 	asn_dec_rval_t rv;
@@ -273,7 +273,7 @@
  */
 
 static asn_dec_rval_t
-uper_sot_suck(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
+uper_sot_suck(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
 	const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
 	asn_dec_rval_t rv;
 
diff --git a/skeletons/per_opentype.h b/skeletons/per_opentype.h
index 8866239..4e3f5fe 100644
--- a/skeletons/per_opentype.h
+++ b/skeletons/per_opentype.h
@@ -9,9 +9,13 @@
 extern "C" {
 #endif
 
-asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd);
+asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
 
-int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd);
+int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx,
+                        asn_per_data_t *pd);
 
 /*
  * X.691 (2015/08), #11.2
diff --git a/skeletons/xer_decoder.c b/skeletons/xer_decoder.c
index 383e3d2..3ac6b6b 100644
--- a/skeletons/xer_decoder.c
+++ b/skeletons/xer_decoder.c
@@ -11,7 +11,7 @@
  * Decode the XER encoding of a given type.
  */
 asn_dec_rval_t
-xer_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+xer_decode(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **struct_ptr, const void *buffer, size_t size) {
 	asn_codec_ctx_t s_codec_ctx;
 
@@ -201,7 +201,7 @@
  * Generalized function for decoding the primitive values.
  */
 asn_dec_rval_t
-xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
+xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
 	asn_struct_ctx_t *ctx,	/* Type decoder context */
 	void *struct_key,
 	const char *xml_tag,	/* Expected XML tag */
diff --git a/skeletons/xer_decoder.h b/skeletons/xer_decoder.h
index 7a43816..f865102 100644
--- a/skeletons/xer_decoder.h
+++ b/skeletons/xer_decoder.h
@@ -17,7 +17,7 @@
  * The XER decoder of any ASN.1 type. May be invoked by the application.
  * Decodes CANONICAL-XER and BASIC-XER.
  */
-asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx,
+asn_dec_rval_t xer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
 	struct asn_TYPE_descriptor_s *type_descriptor,
 	void **struct_ptr,	/* Pointer to a target structure's pointer */
 	const void *buffer,	/* Data to be decoded */
@@ -27,12 +27,11 @@
 /*
  * Type of the type-specific XER decoder function.
  */
-typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
-		struct asn_TYPE_descriptor_s *type_descriptor,
-		void **struct_ptr,
-		const char *opt_mname,	/* Member name */
-		const void *buf_ptr, size_t size
-	);
+typedef asn_dec_rval_t(xer_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const char *opt_mname, /* Member name */
+    const void *buf_ptr, size_t size);
 
 /*******************************
  * INTERNALLY USEFUL FUNCTIONS *
@@ -44,17 +43,16 @@
  * and others. This function should not be used by applications, as its API
  * is subject to changes.
  */
-asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
-	asn_struct_ctx_t *ctx,	/* Type decoder context */
-	void *struct_key,	/* Treated as opaque pointer */
-	const char *xml_tag,	/* Expected XML tag name */
-	const void *buf_ptr, size_t size,
-	int (*opt_unexpected_tag_decoder)
-		(void *struct_key, const void *chunk_buf, size_t chunk_size),
-	ssize_t (*body_receiver)
-		(void *struct_key, const void *chunk_buf, size_t chunk_size,
-			int have_more)
-	);
+asn_dec_rval_t xer_decode_general(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    asn_struct_ctx_t *ctx, /* Type decoder context */
+    void *struct_key,      /* Treated as opaque pointer */
+    const char *xml_tag,   /* Expected XML tag name */
+    const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
+                             size_t chunk_size, int have_more));
 
 
 /*