aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1print
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-08-25 02:27:47 +0000
committerLev Walkin <vlm@lionet.info>2004-08-25 02:27:47 +0000
commitc74ea225465b3397fea6775ebad9bf07daafd7e5 (patch)
tree579c9de05b5197f633dce25e0b466be182514c16 /libasn1print
parentd35c8b56c092bb4c8396c0ef4a58a8a54dfd7dd0 (diff)
better ValueSet printing
Diffstat (limited to 'libasn1print')
-rw-r--r--libasn1print/asn1print.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c
index c90e9665..a07a894c 100644
--- a/libasn1print/asn1print.c
+++ b/libasn1print/asn1print.c
@@ -442,6 +442,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
if(tc->meta_type != AMT_VALUE
+ && tc->meta_type != AMT_VALUESET
&& tc->expr_type != A1TC_EXTENSIBLE) {
if(level) {
if(tc->Identifier)
@@ -503,14 +504,27 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
asn1print_ref(tc->reference, flags);
}
+ if(tc->meta_type == AMT_VALUESET)
+ printf(" ::=");
+
/*
* Display the descendants (children) of the current type.
*/
- if(TQ_FIRST(&(tc->members))) {
+ if(TQ_FIRST(&(tc->members))
+ || (tc->expr_type & ASN_CONSTR_MASK)
+ || tc->meta_type == AMT_VALUESET
+ || tc->meta_type == AMT_OBJECT
+ || tc->meta_type == AMT_OBJECTSET
+ ) {
asn1p_expr_t *se; /* SubExpression */
int put_braces = !SEQ_OF; /* Don't need 'em, if SET OF... */
- if(put_braces) printf(" {\n");
+ if(put_braces) {
+ printf(" {");
+ if(TQ_FIRST(&tc->members))
+ printf("\n");
+ else printf(" }");
+ }
TQ_FOR(se, &(tc->members), next) {
/*
@@ -528,7 +542,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
}
- if(put_braces) {
+ if(put_braces && TQ_FIRST(&tc->members)) {
printf("\n");
INDENT("}");
}