XER support

diff --git a/tests/50-constraint-OK.asn1.-P b/tests/50-constraint-OK.asn1.-P
index 9eba469..6f4dac1 100644
--- a/tests/50-constraint-OK.asn1.-P
+++ b/tests/50-constraint-OK.asn1.-P
@@ -97,7 +97,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Int2_inherit_TYPE_descriptor(td);
@@ -128,6 +128,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Int2 = {
 	"Int2",
+	"Int2",
 	Int2_free,
 	Int2_print,
 	Int2_constraint,
@@ -230,7 +231,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Int3_inherit_TYPE_descriptor(td);
@@ -261,6 +262,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Int3 = {
 	"Int3",
+	"Int3",
 	Int3_free,
 	Int3_print,
 	Int3_constraint,
@@ -363,7 +365,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Int4_inherit_TYPE_descriptor(td);
@@ -394,6 +396,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Int4 = {
 	"Int4",
+	"Int4",
 	Int4_free,
 	Int4_print,
 	Int4_constraint,
@@ -496,7 +499,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Int5_inherit_TYPE_descriptor(td);
@@ -527,6 +530,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Int5 = {
 	"Int5",
+	"Int5",
 	Int5_free,
 	Int5_print,
 	Int5_constraint,
@@ -629,7 +633,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	ExtensibleExtensions_inherit_TYPE_descriptor(td);
@@ -660,6 +664,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
 	"ExtensibleExtensions",
+	"ExtensibleExtensions",
 	ExtensibleExtensions_free,
 	ExtensibleExtensions_print,
 	ExtensibleExtensions_constraint,
@@ -793,7 +798,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Str2_inherit_TYPE_descriptor(td);
@@ -824,6 +829,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Str2 = {
 	"Str2",
+	"Str2",
 	Str2_free,
 	Str2_print,
 	Str2_constraint,
@@ -949,7 +955,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Str3_inherit_TYPE_descriptor(td);
@@ -980,6 +986,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Str3 = {
 	"Str3",
+	"Str3",
 	Str3_free,
 	Str3_print,
 	Str3_constraint,
@@ -1091,7 +1098,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Str4_inherit_TYPE_descriptor(td);
@@ -1122,6 +1129,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Str4 = {
 	"Str4",
+	"Str4",
 	Str4_free,
 	Str4_print,
 	Str4_constraint,
@@ -1233,7 +1241,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	PER_Visible_inherit_TYPE_descriptor(td);
@@ -1264,6 +1272,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
 	"PER-Visible",
+	"PER-Visible",
 	PER_Visible_free,
 	PER_Visible_print,
 	PER_Visible_constraint,
@@ -1375,7 +1384,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	PER_Visible_2_inherit_TYPE_descriptor(td);
@@ -1406,6 +1415,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
 	"PER-Visible-2",
+	"PER-Visible-2",
 	PER_Visible_2_free,
 	PER_Visible_2_print,
 	PER_Visible_2_constraint,
@@ -1517,7 +1527,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Not_PER_Visible_1_inherit_TYPE_descriptor(td);
@@ -1548,6 +1558,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
 	"Not-PER-Visible-1",
+	"Not-PER-Visible-1",
 	Not_PER_Visible_1_free,
 	Not_PER_Visible_1_print,
 	Not_PER_Visible_1_constraint,
@@ -1659,7 +1670,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Not_PER_Visible_2_inherit_TYPE_descriptor(td);
@@ -1690,6 +1701,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
 	"Not-PER-Visible-2",
+	"Not-PER-Visible-2",
 	Not_PER_Visible_2_free,
 	Not_PER_Visible_2_print,
 	Not_PER_Visible_2_constraint,
@@ -1801,7 +1813,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Not_PER_Visible_3_inherit_TYPE_descriptor(td);
@@ -1832,6 +1844,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
 	"Not-PER-Visible-3",
+	"Not-PER-Visible-3",
 	Not_PER_Visible_3_free,
 	Not_PER_Visible_3_print,
 	Not_PER_Visible_3_constraint,
@@ -1946,7 +1959,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	SIZE_but_not_FROM_inherit_TYPE_descriptor(td);
@@ -1977,6 +1990,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
 	"SIZE-but-not-FROM",
+	"SIZE-but-not-FROM",
 	SIZE_but_not_FROM_free,
 	SIZE_but_not_FROM_print,
 	SIZE_but_not_FROM_constraint,
@@ -2091,7 +2105,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	SIZE_and_FROM_inherit_TYPE_descriptor(td);
@@ -2122,6 +2136,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
 	"SIZE-and-FROM",
+	"SIZE-and-FROM",
 	SIZE_and_FROM_free,
 	SIZE_and_FROM_print,
 	SIZE_and_FROM_constraint,
@@ -2233,7 +2248,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Neither_SIZE_nor_FROM_inherit_TYPE_descriptor(td);
@@ -2264,6 +2279,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
 	"Neither-SIZE-nor-FROM",
+	"Neither-SIZE-nor-FROM",
 	Neither_SIZE_nor_FROM_free,
 	Neither_SIZE_nor_FROM_print,
 	Neither_SIZE_nor_FROM_constraint,
@@ -2369,7 +2385,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Utf8_4_inherit_TYPE_descriptor(td);
@@ -2400,6 +2416,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
 	"Utf8-4",
+	"Utf8-4",
 	Utf8_4_free,
 	Utf8_4_print,
 	Utf8_4_constraint,
@@ -2533,7 +2550,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Utf8_3_inherit_TYPE_descriptor(td);
@@ -2564,6 +2581,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
 	"Utf8-3",
+	"Utf8-3",
 	Utf8_3_free,
 	Utf8_3_print,
 	Utf8_3_constraint,
@@ -2667,7 +2685,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Utf8_2_inherit_TYPE_descriptor(td);
@@ -2698,6 +2716,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
 	"Utf8-2",
+	"Utf8-2",
 	Utf8_2_free,
 	Utf8_2_print,
 	Utf8_2_constraint,
@@ -2862,7 +2881,7 @@
 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
 }
 
-ber_dec_rval_t
+asn_dec_rval_t
 Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
 		void **structure, void *bufptr, size_t size, int tag_mode) {
 	Identifier_inherit_TYPE_descriptor(td);
@@ -2893,6 +2912,7 @@
 };
 asn_TYPE_descriptor_t asn_DEF_Identifier = {
 	"Identifier",
+	"Identifier",
 	Identifier_free,
 	Identifier_print,
 	Identifier_constraint,