Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
f4069d22
Commit
f4069d22
authored
Feb 15, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print double parametrization
parent
8a7af0e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
libasn1print/asn1print.c
libasn1print/asn1print.c
+26
-12
libasn1print/asn1print.h
libasn1print/asn1print.h
+1
-0
No files found.
libasn1print/asn1print.c
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
)
{
...
...
libasn1print/asn1print.h
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 */
};
};
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment