From fbaeb8528da6a0755466f6da5b4e463926c94e9b Mon Sep 17 00:00:00 2001 From: Lev Walkin <vlm@lionet.info> Date: Tue, 21 Nov 2006 10:39:52 +0000 Subject: [PATCH] dtd for bit string --- libasn1print/asn1print.c | 4 ++++ tests/125-bitstring-constraint-OK.asn1.-X | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/125-bitstring-constraint-OK.asn1.-X diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c index bf248189..6f67f2c7 100644 --- a/libasn1print/asn1print.c +++ b/libasn1print/asn1print.c @@ -849,6 +849,8 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a if(TQ_FIRST(&expr->members)) { int extensible = 0; + if(expr->expr_type == ASN_BASIC_BIT_STRING) + dont_involve_children = 1; printf(" ("); TQ_FOR(se, &(expr->members), next) { if(se->expr_type == A1TC_EXTENSIBLE) { @@ -870,6 +872,8 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a printf("*"); else if(se->marker.flags) printf("?"); + else if(expr->expr_type == ASN_BASIC_BIT_STRING) + printf("?"); } if(TQ_NEXT(se, next) && TQ_NEXT(se, next)->expr_type != A1TC_EXTENSIBLE) { diff --git a/tests/125-bitstring-constraint-OK.asn1.-X b/tests/125-bitstring-constraint-OK.asn1.-X new file mode 100644 index 00000000..64a21c41 --- /dev/null +++ b/tests/125-bitstring-constraint-OK.asn1.-X @@ -0,0 +1,8 @@ +<!-- XML DTD generated by asn1c-0.9.22 --> + +<!-- ASN.1 module +ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4) + enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 125 } +found in ../tests/125-bitstring-constraint-OK.asn1 --> + +<!ELEMENT T (flag1?, flag2?, flag3?)> -- GitLab