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
72a0f5a1
Commit
72a0f5a1
authored
Jul 24, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-findirect-choice
parent
d4eb17db
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
34 deletions
+95
-34
asn1c/asn1c.1
asn1c/asn1c.1
+9
-2
asn1c/asn1c.c
asn1c/asn1c.c
+3
-0
doc/asn1c-usage.html
doc/asn1c-usage.html
+13
-0
doc/asn1c-usage.lyx
doc/asn1c-usage.lyx
+61
-32
doc/asn1c-usage.pdf
doc/asn1c-usage.pdf
+0
-0
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+5
-0
libasn1compiler/asn1compiler.h
libasn1compiler/asn1compiler.h
+4
-0
No files found.
asn1c/asn1c.1
View file @
72a0f5a1
...
...
@@ -23,7 +23,7 @@ and other encoding standards.
.TP
\fILanguage Options\fR
.br
\fB\-fall-defs-global \-fbless-SIZE \-fcompound-names
\fB\-fall-defs-global \-fbless-SIZE \-fcompound-names
\-findirect-choice
.BI "\-fknown-extern-type="<name>
\fB\-fnative-types \-fno-constraints \-fno-include-deps \-funnamed-unions \-ftypes88\fR
.TP
...
...
@@ -90,9 +90,16 @@ by using complex names for target language structures. (Name collisions
may occur if the ASN.1 module reuses the same identifiers in multiple
contexts).
.TP
.B \-findirect-choice
When generating code for a CHOICE type, compile the CHOICE members as indirect
pointers instead of declaring them inline. Consider using this option
together with
.B \-fno-include-deps
to prevent circular references.
.TP
.BI "\-fknown-extern-type="<name>
Pretend the specified type is known. The compiler will assume the target
language source files for the given type
are
provided manually.
language source files for the given type
have been
provided manually.
.TP
.B \-fnative-types
Use the native machine's data types (int, double) whenever possible,
...
...
asn1c/asn1c.c
View file @
72a0f5a1
...
...
@@ -77,6 +77,8 @@ main(int ac, char **av) {
asn1_fixer_flags
|=
A1F_EXTENDED_SizeConstraint
;
}
else
if
(
strcmp
(
optarg
,
"compound-names"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_COMPOUND_NAMES
;
}
else
if
(
strcmp
(
optarg
,
"indirect-choice"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_INDIRECT_CHOICE
;
}
else
if
(
strncmp
(
optarg
,
"known-extern-type="
,
18
)
==
0
)
{
char
*
known_type
=
optarg
+
18
;
ret
=
asn1f_make_known_external_type
(
known_type
);
...
...
@@ -313,6 +315,7 @@ usage(const char *av0) {
" -fall-defs-global Don't make the asn1_DEF_'s of structure members
\"
static
\"\n
"
" -fbless-SIZE Allow SIZE() constraint for INTEGER etc (non-std.)
\n
"
" -fcompound-names Disambiguate C's struct NAME's inside top-level types
\n
"
" -findirect-choice Compile members of CHOICE as indirect pointers
\n
"
" -fknown-extern-type=<name> Pretend the specified type is known
\n
"
" -fnative-types Use
\"
long
\"
instead of INTEGER_t whenever possible, etc.
\n
"
" -fno-constraints Do not generate constraint checking code
\n
"
...
...
doc/asn1c-usage.html
View file @
72a0f5a1
...
...
@@ -400,6 +400,19 @@ produce the meaningful code.</FONT></TD></TR>
name clashes in case the module reuses the same identifiers in multiple
contexts.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><FONT
SIZE=
"-1"
>
-findirect-choice
</FONT></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<FONT
SIZE=
"-1"
>
When generating code for a CHOICE type, compile
the CHOICE members as indirect pointers instead of
declaring them inline. Consider using this option
together with
<B>
-fno-include-deps
</B>
to prevent circular references.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><FONT
SIZE=
"-1"
>
-fknown-extern-type=
<I>
<
name
>
</I></FONT></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<FONT
SIZE=
"-1"
>
Pretend the specified type is known. The compiler will
assume the target language source files for the given
type have been provided manually.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><FONT
SIZE=
"-1"
>
-fnative-types
</FONT></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<FONT
SIZE=
"-1"
>
Use the native machine's data types (int, double) whenever
possible, instead of the compound INTEGER_t, ENUMERATED_t and REAL_t
...
...
doc/asn1c-usage.lyx
View file @
72a0f5a1
...
...
@@ -71,7 +71,7 @@ status Open
\backslash
lhead{This document describes
\backslash
href{http://lionet.info/asn1c}{asn1c-0.9.1
1
}}
href{http://lionet.info/asn1c}{asn1c-0.9.1
7
}}
\layout Standard
\backslash
...
...
@@ -169,7 +169,7 @@ END
The compiler would read this ASN.1 definition and produce the following C
type
\begin_inset Foot
collapsed
tru
e
collapsed
fals
e
\layout Standard
...
...
@@ -182,8 +182,8 @@ collapsed true
int
\emph default
types instead of infinite width INTEGER_t structures.
See
Table
\begin_inset LatexCommand \vref{
cap:asn1c-cmdopt
s}
See
Section
\begin_inset LatexCommand \vref{
sec:Command-line-option
s}
\end_inset
...
...
@@ -240,7 +240,7 @@ ell
\emph default
command may be used to compile the ASN.1 module
\begin_inset Foot
collapsed
tru
e
collapsed
fals
e
\layout Standard
...
...
@@ -249,8 +249,8 @@ This is probably
not
\series default
what you want to try out right now -- read through the rest of this chapter
and check the
Table
\begin_inset LatexCommand \vref{
cap:asn1c-cmdopt
s}
and check the
Section
\begin_inset LatexCommand \vref{
sec:Command-line-option
s}
\end_inset
...
...
@@ -438,28 +438,20 @@ int main()
routine.
\layout Section
Command line options
\layout Standard
The Table
\begin_inset LatexCommand \vref{cap:asn1c-cmdopts}
\begin_inset LatexCommand \label{sec:Command-line-options}
\end_inset
summarizes various options affecting the compiler's behavior.
Command line options
\layout Standard
\begin_inset Float table
placement h
wide false
collapsed false
The following table summarizes the asn1c command line options.
\layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2
4
" columns="2">
<lyxtabular version="3" rows="2
6
" columns="2">
<features islongtable="true">
<column alignment="left" valignment="top" leftline="true" width="0">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="3in">
...
...
@@ -716,7 +708,7 @@ Enable lexer debugging during the ASN.1 parsing stage.
\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<row topline="true" bottomline="true"
newpage="true"
>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
...
...
@@ -844,6 +836,54 @@ Use complex names for C structures.
\layout Standard
-findirect-choice
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\layout Standard
When generating code for a CHOICE type, compile the CHOICE members as indirect
pointers instead of declaring them inline.
Consider using this option together with
\series bold
-fno-include-deps
\series default
to prevent circular references.
\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\layout Standard
-fknown-extern-type=
\emph on
<name>
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\layout Standard
Pretend the specified type is known.
The compiler will assume the target language source files for the given
type have been provided manually.
\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\layout Standard
\size small
-fnative-types
...
...
@@ -953,7 +993,7 @@ Pretend to support only ASN.1:1988 embedded types.
\end_inset
</cell>
</row>
<row topline="true"
newpage="true"
>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
...
...
@@ -1027,17 +1067,6 @@ Generate "-- #line" comments in -E output.
\end_inset
\layout Caption
\begin_inset LatexCommand \label{cap:asn1c-cmdopts}
\end_inset
The list of asn1c command line options
\end_inset
\layout Chapter
Using the ASN.1 Compiler
...
...
doc/asn1c-usage.pdf
View file @
72a0f5a1
No preview for this file type
libasn1compiler/asn1c_C.c
View file @
72a0f5a1
...
...
@@ -1865,6 +1865,11 @@ expr_better_indirect(arg_t *arg, asn1p_expr_t *expr) {
if
(
expr
->
expr_type
!=
A1TC_REFERENCE
)
return
0
;
/* -findirect-choice compiles members of CHOICE as indirect pointers */
if
((
arg
->
flags
&
A1C_INDIRECT_CHOICE
)
&&
arg
->
expr
->
expr_type
==
ASN_CONSTR_CHOICE
)
return
1
;
/* Rewind to the topmost parent expression */
if
((
top_parent
=
expr
->
parent_expr
))
{
while
(
top_parent
->
parent_expr
)
...
...
libasn1compiler/asn1compiler.h
View file @
72a0f5a1
...
...
@@ -47,6 +47,10 @@ enum asn1c_flags {
* Do not generate courtesy #includes for external dependencies.
*/
A1C_NO_INCLUDE_DEPS
=
0x0200
,
/*
* Compile members of CHOICE as indirect pointers.
*/
A1C_INDIRECT_CHOICE
=
0x0400
,
};
/*
...
...
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