aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/constr_CHOICE.c
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2005-11-08 03:06:16 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2005-11-08 03:06:16 +0000
commit6d44a544c597ecdd3dc068565f128037688795ec (patch)
tree34eb1b922345a3f43418887adcfb1c1d9efca351 /skeletons/constr_CHOICE.c
parentfbc0bbb19235338c9c6c0aaf337cb92b2b277aa4 (diff)
SET OF/SEQUENCE OF interaction with named and unnamed CHOICE
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@993 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'skeletons/constr_CHOICE.c')
-rw-r--r--skeletons/constr_CHOICE.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index b3af333a..f832812a 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -572,7 +572,8 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Restore parsing context.
*/
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
+ if(ctx->phase == 0 && !*xml_tag)
+ ctx->phase = 1; /* Skip the outer tag checking phase */
/*
* Phases of XER/XML processing:
@@ -625,6 +626,12 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Fall through */
}
+ /* No need to wait for closing tag; special mode. */
+ if(ctx->phase == 3 && !*xml_tag) {
+ ctx->phase = 5; /* Phase out */
+ RETURN(RC_OK);
+ }
+
/*
* Get the next part of the XML stream.
*/
@@ -644,6 +651,12 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+ ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d",
+ ch_size>0?((uint8_t *)buf_ptr)[0]:'?',
+ ch_size>1?((uint8_t *)buf_ptr)[1]:'?',
+ ch_size>2?((uint8_t *)buf_ptr)[2]:'?',
+ ch_size>3?((uint8_t *)buf_ptr)[3]:'?',
+ xml_tag, tcv);
/* Skip the extensions section */
if(ctx->phase == 4) {
@@ -739,7 +752,8 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
break;
}
- ASN_DEBUG("Unexpected XML tag in CHOICE");
+ ASN_DEBUG("Unexpected XML tag in CHOICE (ph=%d, tag=%s)",
+ ctx->phase, xml_tag);
break;
}