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
ab4bb292
Commit
ab4bb292
authored
Aug 18, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-print-constraints
parent
6b955c68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
33 deletions
+49
-33
asn1c/asn1c.c
asn1c/asn1c.c
+49
-33
No files found.
asn1c/asn1c.c
View file @
ab4bb292
...
...
@@ -28,7 +28,7 @@ main(int ac, char **av) {
enum
asn1p_flags
asn1_parser_flags
=
A1P_NOFLAGS
;
enum
asn1f_flags
asn1_fixer_flags
=
A1F_NOFLAGS
;
enum
asn1c_flags
asn1_compiler_flags
=
A1C_NOFLAGS
;
enum
asn1print_flags
_e
asn1_print
_flags
=
APF_NOFLAGS
;
enum
asn1print_flags
asn1_printer
_flags
=
APF_NOFLAGS
;
int
print_arg__print_out
=
0
;
/* Don't compile, just print parsed */
int
print_arg__fix_n_print
=
0
;
/* Fix and print */
int
warnings_as_errors
=
0
;
/* Treat warnings as errors */
...
...
@@ -41,7 +41,7 @@ main(int ac, char **av) {
/*
* Process command-line options.
*/
while
((
ch
=
getopt
(
ac
,
av
,
"EFf:LPRS:t:W:"
))
!=
-
1
)
while
((
ch
=
getopt
(
ac
,
av
,
"EFf:LP
p:
RS:t:W:"
))
!=
-
1
)
switch
(
ch
)
{
case
'E'
:
print_arg__print_out
=
1
;
...
...
@@ -70,11 +70,19 @@ main(int ac, char **av) {
}
break
;
case
'L'
:
asn1_print_flags
|=
APF_LINE_COMMENTS
;
asn1_print
er
_flags
|=
APF_LINE_COMMENTS
;
break
;
case
'P'
:
asn1_compiler_flags
|=
A1C_PRINT_COMPILED
;
break
;
case
'p'
:
if
(
strcmp
(
optarg
,
"rint-constraints"
)
==
0
)
{
asn1_printer_flags
|=
APF_DEBUG_CONSTRAINTS
;
}
else
{
fprintf
(
stderr
,
"-p%s: Invalid argument
\n
"
,
optarg
);
exit
(
EX_USAGE
);
}
break
;
case
'R'
:
asn1_compiler_flags
|=
A1C_OMIT_SUPPORT_CODE
;
break
;
...
...
@@ -115,6 +123,12 @@ main(int ac, char **av) {
fprintf
(
stderr
,
"Error: -F requires -E
\n
"
);
exit
(
EX_USAGE
);
}
if
(
asn1_printer_flags
)
{
fprintf
(
stderr
,
"Error: "
"-L and -print-constraints "
"require -E
\n
"
);
exit
(
EX_USAGE
);
}
}
/*
...
...
@@ -160,7 +174,7 @@ main(int ac, char **av) {
* Dump the parsed ASN.1 tree if -E specified and -F is NOT given.
*/
if
(
print_arg__print_out
&&
!
print_arg__fix_n_print
)
{
if
(
asn1print
(
asn
,
asn1_print_flags
))
if
(
asn1print
(
asn
,
asn1_print
er
_flags
))
exit
(
EX_SOFTWARE
);
return
0
;
}
...
...
@@ -187,7 +201,7 @@ main(int ac, char **av) {
* Dump the parsed ASN.1 tree if -E specified and -F is given.
*/
if
(
print_arg__print_out
&&
print_arg__fix_n_print
)
{
if
(
asn1print
(
asn
,
asn1_print_flags
))
if
(
asn1print
(
asn
,
asn1_print
er
_flags
))
exit
(
EX_SOFTWARE
);
return
0
;
}
...
...
@@ -241,36 +255,38 @@ main(int ac, char **av) {
static
void
usage
(
char
*
av0
)
{
fprintf
(
stderr
,
"ASN.1 Compiler, v"
VERSION
"
\n
"
"Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>
\n
"
"Usage: %s [options] ...
\n
"
"Where [options] are:
\n
"
"
\t
-E
\t
Run only the ASN.1 parser and print out the tree
\n
"
"
\t
-F
\t
During -E operation, also perform tree fixing
\n
"
"
\t
-L
\t
Generate
\"
-- #line
\"
comments in -E output
\n
"
"
\n
"
"
\t
-P
\t
Concatenate and print the compiled text
\n
"
"
\t
-S <dir>
\t
Directory with support (skeleton?) files
\n
"
"
\t
\t
(Default is
\"
%s
\"
)
\n
"
"
\t
-R
\t
Restrict output (tables only, no support code)
\n
"
"
\n
"
"
\t
-t <data>
\t
Decode the given tag[/length] sequence
\n
"
"
\n
"
"
\t
-ftypes88
\t
Use only ASN.1:1988 embedded types
\n
"
"ASN.1 Compiler, v"
VERSION
"
\n
"
"Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>
\n
"
"Usage: %s [options] ...
\n
"
"Where [options] are:
\n
"
"
\t
-E
\t
Run only the ASN.1 parser and print out the tree
\n
"
"
\t
-F
\t
During -E operation, also perform tree fixing
\n
"
"
\t
-L
\t
Generate
\"
-- #line
\"
comments in -E output
\n
"
"
\n
"
"
\t
-P
\t
Concatenate and print the compiled text
\n
"
"
\t
-S <dir>
\t
Directory with support (skeleton?) files
\n
"
"
\t
\t
(Default is
\"
%s
\"
)
\n
"
"
\t
-R
\t
Restrict output (tables only, no support code)
\n
"
"
\n
"
"
\t
-t <data>
\t
Decode the given tag[/length] sequence
\n
"
"
\n
"
"
\t
-ftypes88
\t
Use only ASN.1:1988 embedded types
\n
"
/*
"\t-fconstr90\tUse only ASN.1:1990 constructs (not available)\n"
"\t-fconstr90\tUse only ASN.1:1990 constructs (not available)\n"
*/
"
\t
-fknown-extern-type=<name>
\t
Pretend this type is known
\n
"
"
\t
-fnative-integers
\t
Use int instead of INTEGER_t whenever possible
\n
"
"
\t
-fno-c99
\t
Disable C99 extensions
\n
"
"
\t
-funnamed-unions
\t
Enable unnamed unions in structures
\n
"
"
\n
"
"
\t
-Werror
\t
Treat warnings as errors; abort if any warning
\n
"
"
\t
-Wdebug-lexer
\t
Enable verbose debugging output from lexer
\n
"
"
\t
-Wdebug-fixer
\t
Debug ASN.1 semantics processor
\n
"
"
\t
-Wdebug-compiler
\t
Debug ASN.1 compiler
\n
"
,
a1c_basename
(
av0
),
DATADIR
"
\t
-fknown-extern-type=<name>
\t
Pretend this type is known
\n
"
"
\t
-fnative-integers
\t
Use int instead of INTEGER_t whenever possible
\n
"
"
\t
-fno-c99
\t
Disable C99 extensions
\n
"
"
\t
-funnamed-unions
\t
Enable unnamed unions in structures
\n
"
"
\n
"
"
\t
-print-constraints
\t
Explain subtype constraints (debug)
\n
"
"
\n
"
"
\t
-Werror
\t
Treat warnings as errors; abort if any warning
\n
"
"
\t
-Wdebug-lexer
\t
Enable verbose debugging output from lexer
\n
"
"
\t
-Wdebug-fixer
\t
Debug ASN.1 semantics processor
\n
"
"
\t
-Wdebug-compiler
\t
Debug ASN.1 compiler
\n
"
,
a1c_basename
(
av0
),
DATADIR
);
exit
(
EX_USAGE
);
}
...
...
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