Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
asn1c
Commits
f4069d22
Commit
f4069d22
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
print double parametrization
parent
8a7af0e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libasn1print/asn1print.c
+26
-12
26 additions, 12 deletions
libasn1print/asn1print.c
libasn1print/asn1print.h
+1
-0
1 addition, 0 deletions
libasn1print/asn1print.h
with
27 additions
and
12 deletions
libasn1print/asn1print.c
+
26
−
12
View file @
f4069d22
...
@@ -10,7 +10,10 @@
...
@@ -10,7 +10,10 @@
#include
"asn1print.h"
#include
"asn1print.h"
#define INDENT(fmt, args...) do { \
#define INDENT(fmt, args...) do { \
int __i = level; while(__i--) printf(" "); \
if(!(flags & APF_NOINDENT)) { \
int __i = level; \
while(__i--) printf(" "); \
} \
printf(fmt, ##args); \
printf(fmt, ##args); \
} while(0)
} while(0)
...
@@ -460,7 +463,7 @@ static int
...
@@ -460,7 +463,7 @@ static int
asn1print_expr
(
asn1p_t
*
asn
,
asn1p_module_t
*
mod
,
asn1p_expr_t
*
tc
,
enum
asn1print_flags
flags
,
int
level
)
{
asn1print_expr
(
asn1p_t
*
asn
,
asn1p_module_t
*
mod
,
asn1p_expr_t
*
tc
,
enum
asn1print_flags
flags
,
int
level
)
{
int
SEQ_OF
=
0
;
int
SEQ_OF
=
0
;
if
(
flags
&
APF_LINE_COMMENTS
)
if
(
flags
&
APF_LINE_COMMENTS
&&
!
(
flags
&
APF_NOINDENT
)
)
INDENT
(
"-- #line %d
\n
"
,
tc
->
_lineno
);
INDENT
(
"-- #line %d
\n
"
,
tc
->
_lineno
);
if
(
tc
->
Identifier
)
if
(
tc
->
Identifier
)
INDENT
(
"%s"
,
tc
->
Identifier
);
INDENT
(
"%s"
,
tc
->
Identifier
);
...
@@ -473,7 +476,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -473,7 +476,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
&&
tc
->
meta_type
!=
AMT_VALUESET
&&
tc
->
meta_type
!=
AMT_VALUESET
&&
tc
->
expr_type
!=
A1TC_EXTENSIBLE
)
{
&&
tc
->
expr_type
!=
A1TC_EXTENSIBLE
)
{
if
(
level
)
{
if
(
level
)
{
if
(
tc
->
Identifier
)
if
(
tc
->
Identifier
&&
!
(
flags
&
APF_NOINDENT
)
)
printf
(
"
\t
"
);
printf
(
"
\t
"
);
}
else
{
}
else
{
printf
(
" ::="
);
printf
(
" ::="
);
...
@@ -496,9 +499,10 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -496,9 +499,10 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
SEQ_OF
=
1
;
/* Equivalent to SET OF for printint purposes */
SEQ_OF
=
1
;
/* Equivalent to SET OF for printint purposes */
printf
(
" COMPONENTS OF"
);
printf
(
" COMPONENTS OF"
);
break
;
break
;
case
A1TC_PARAMETRIZED
:
flags
|=
APF_NOINDENT
;
case
A1TC_REFERENCE
:
case
A1TC_REFERENCE
:
case
A1TC_UNIVERVAL
:
case
A1TC_UNIVERVAL
:
case
A1TC_PARAMETRIZED
:
break
;
break
;
case
A1TC_CLASSDEF
:
case
A1TC_CLASSDEF
:
printf
(
" CLASS"
);
printf
(
" CLASS"
);
...
@@ -528,7 +532,8 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -528,7 +532,8 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
}
if
(
tc
->
reference
)
{
if
(
tc
->
reference
)
{
printf
(
" "
);
if
(
!
(
flags
&
APF_NOINDENT
))
printf
(
" "
);
asn1print_ref
(
tc
->
reference
,
flags
);
asn1print_ref
(
tc
->
reference
,
flags
);
}
}
...
@@ -548,10 +553,17 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -548,10 +553,17 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
int
put_braces
=
!
SEQ_OF
;
/* Don't need 'em, if SET OF... */
int
put_braces
=
!
SEQ_OF
;
/* Don't need 'em, if SET OF... */
if
(
put_braces
)
{
if
(
put_braces
)
{
printf
(
" {"
);
if
(
flags
&
APF_NOINDENT
)
{
if
(
TQ_FIRST
(
&
tc
->
members
))
printf
(
"{"
);
printf
(
"
\n
"
);
if
(
!
TQ_FIRST
(
&
tc
->
members
))
else
printf
(
" }"
);
printf
(
"}"
);
}
else
{
printf
(
" {"
);
if
(
TQ_FIRST
(
&
tc
->
members
))
printf
(
"
\n
"
);
else
printf
(
" }"
);
}
}
}
TQ_FOR
(
se
,
&
(
tc
->
members
),
next
)
{
TQ_FOR
(
se
,
&
(
tc
->
members
),
next
)
{
...
@@ -568,12 +580,14 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -568,12 +580,14 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
}
if
(
TQ_NEXT
(
se
,
next
))
{
if
(
TQ_NEXT
(
se
,
next
))
{
printf
(
","
);
printf
(
","
);
INDENT
(
"
\n
"
);
if
(
!
(
flags
&
APF_NOINDENT
))
INDENT
(
"
\n
"
);
}
}
}
}
if
(
put_braces
&&
TQ_FIRST
(
&
tc
->
members
))
{
if
(
put_braces
&&
TQ_FIRST
(
&
tc
->
members
))
{
printf
(
"
\n
"
);
if
(
!
(
flags
&
APF_NOINDENT
))
printf
(
"
\n
"
);
INDENT
(
"}"
);
INDENT
(
"}"
);
}
}
}
}
...
@@ -605,7 +619,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -605,7 +619,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
}
/*
/*
* The following section exists entirely for debugging
only
.
* The following section exists entirely for debugging.
*/
*/
if
(
flags
&
APF_DEBUG_CONSTRAINTS
if
(
flags
&
APF_DEBUG_CONSTRAINTS
&&
tc
->
expr_type
!=
A1TC_EXTENSIBLE
)
{
&&
tc
->
expr_type
!=
A1TC_EXTENSIBLE
)
{
...
...
This diff is collapsed.
Click to expand it.
libasn1print/asn1print.h
+
1
−
0
View file @
f4069d22
...
@@ -6,6 +6,7 @@ enum asn1print_flags {
...
@@ -6,6 +6,7 @@ enum asn1print_flags {
APF_LINE_COMMENTS
=
0x01
,
/* Include line comments */
APF_LINE_COMMENTS
=
0x01
,
/* Include line comments */
APF_DEBUG_CONSTRAINTS
=
0x02
,
/* Explain constraints */
APF_DEBUG_CONSTRAINTS
=
0x02
,
/* Explain constraints */
APF_PRINT_XML_DTD
=
0x04
,
/* Generate XML DTD */
APF_PRINT_XML_DTD
=
0x04
,
/* Generate XML DTD */
APF_NOINDENT
=
0x08
,
/* Disable indentation */
};
};
/*
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment