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
dd32b592
Commit
dd32b592
authored
Sep 06, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-fall-defs-global
parent
fd71d1e5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
17 deletions
+56
-17
asn1c/asn1c.1
asn1c/asn1c.1
+9
-1
asn1c/asn1c.c
asn1c/asn1c.c
+11
-13
doc/asn1c-usage.lyx
doc/asn1c-usage.lyx
+25
-2
doc/asn1c-usage.pdf
doc/asn1c-usage.pdf
+0
-0
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+7
-1
libasn1compiler/asn1compiler.h
libasn1compiler/asn1compiler.h
+4
-0
No files found.
asn1c/asn1c.1
View file @
dd32b592
...
...
@@ -27,7 +27,7 @@ and other encoding standards.
.TP
\fILanguage Options\fR
.br
\fB\-fbless-SIZE \-fnative-integers \-funnamed-unions \-ftypes88\fR
\fB\-f
all-defs-global \-f
bless-SIZE \-fnative-integers \-funnamed-unions \-ftypes88\fR
.TP
\fIOutput Options\fR
.br
...
...
@@ -74,6 +74,14 @@ Enable ASN.1 syntax tree fixer debugging during the fixing stage.
Enable debugging during the actual compile time.
.SH LANGUAGE OPTIONS
.TP
.B \-fall-defs-global
Normally the compiler hides the definitions (asn1_DEF_xxx) of the inner
structure elements (members of SEQUENCE, SET and other types). This option
makes all such definitions global.
Enabling this option may pollute the namespace by making lots of asn1_DEF_xxx
structures globally visible, but will allow you to manipulate
(encode and decode) the individual members of any complex ASN.1 structure.
.TP
.B \-fbless-SIZE
Allow SIZE() constraint for INTEGER, ENUMERATED, and other types for which this
constraint is normally prohibited by the standard. This is a violation of
...
...
asn1c/asn1c.c
View file @
dd32b592
...
...
@@ -54,20 +54,20 @@ main(int ac, char **av) {
print_arg__fix_n_print
=
1
;
break
;
case
'f'
:
if
(
strcmp
(
optarg
,
"types88"
)
==
0
)
{
asn1_parser_flags
|=
A1P_TYPES_RESTRICT_TO_1988
;
}
else
if
(
strcmp
(
optarg
,
"constr90"
)
==
0
)
{
asn1_parser_flags
|=
A1P_CONSTRUCTS_RESTRICT_TO_1990
;
}
else
if
(
strcmp
(
optarg
,
"native-integers"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_USE_NATIVE_INTEGERS
;
}
else
if
(
strcmp
(
optarg
,
"unnamed-unions"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_UNNAMED_UNIONS
;
if
(
strcmp
(
optarg
,
"all-defs-global"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_ALL_DEFS_GLOBAL
;
}
else
if
(
strcmp
(
optarg
,
"bless-SIZE"
)
==
0
)
{
asn1_fixer_flags
|=
A1F_EXTENDED_SizeConstraint
;
}
else
if
(
strncmp
(
optarg
,
"known-extern-type="
,
18
)
==
0
)
{
char
*
known_type
=
optarg
+
18
;
ret
=
asn1f_make_known_external_type
(
known_type
);
assert
(
ret
==
0
||
errno
==
EEXIST
);
}
else
if
(
strcmp
(
optarg
,
"bless-SIZE"
)
==
0
)
{
asn1_fixer_flags
|=
A1F_EXTENDED_SizeConstraint
;
}
else
if
(
strcmp
(
optarg
,
"native-integers"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_USE_NATIVE_INTEGERS
;
}
else
if
(
strcmp
(
optarg
,
"unnamed-unions"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_UNNAMED_UNIONS
;
}
else
if
(
strcmp
(
optarg
,
"types88"
)
==
0
)
{
asn1_parser_flags
|=
A1P_TYPES_RESTRICT_TO_1988
;
}
else
{
fprintf
(
stderr
,
"-f%s: Invalid argument
\n
"
,
optarg
);
exit
(
EX_USAGE
);
...
...
@@ -286,10 +286,8 @@ usage(char *av0) {
" -Wdebug-compiler --//-- compiler
\n
"
"
\n
"
" -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
"
/*
" -fconstr90 Use only ASN.1:1990 constructs (not available)\n"
*/
" -fknown-extern-type=<name> Pretend this type is known
\n
"
" -fnative-integers Use int instead of INTEGER_t whenever possible
\n
"
" -funnamed-unions Enable unnamed unions in structures
\n
"
...
...
doc/asn1c-usage.lyx
View file @
dd32b592
...
...
@@ -1309,13 +1309,13 @@ The Table
\begin_inset Float table
wide false
collapsed
tru
e
collapsed
fals
e
\layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2
0
" columns="2">
<lyxtabular version="3" rows="2
1
" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="3in">
...
...
@@ -1602,6 +1602,29 @@ Description
\layout Standard
-fall-defs-global
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\layout Standard
Normally the compiler hides the definitions (asn1_DEF_xxx) of the inner
structure elements (members of SEQUENCE, SET and other types).
This option makes all such definitions global.
Enabling this option may pollute the namespace by making lots of asn1_DEF_xxx
structures globally visible, but will allow you to manipulate (encode and
decode) the individual members of any complex ASN.1 structure.
\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\layout Standard
-fbless-SIZE
\end_inset
</cell>
...
...
doc/asn1c-usage.pdf
View file @
dd32b592
No preview for this file type
libasn1compiler/asn1c_C.c
View file @
dd32b592
...
...
@@ -45,6 +45,7 @@ static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int tag
#define C99_MODE (!(arg->flags & A1C_NO_C99))
#define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS)
#define HIDE_INNER_DEFS (arg->embed && !(arg->flags & A1C_ALL_DEFS_GLOBAL))
#define PCTX_DEF INDENTED( \
OUT("\n"); \
...
...
@@ -867,7 +868,10 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
REDIR
(
OT_FUNC_DECLS
);
p
=
MKID
(
expr
->
Identifier
);
OUT
(
"extern asn1_TYPE_descriptor_t asn1_DEF_%s;
\n
"
,
p
);
if
(
HIDE_INNER_DEFS
)
OUT
(
"/* "
);
OUT
(
"extern asn1_TYPE_descriptor_t asn1_DEF_%s;"
,
p
);
if
(
HIDE_INNER_DEFS
)
OUT
(
" // (Use -fall-defs-global to expose) */"
);
OUT
(
"
\n
"
);
OUT
(
"asn_constr_check_f %s_constraint;
\n
"
,
p
);
OUT
(
"ber_type_decoder_f %s_decode_ber;
\n
"
,
p
);
OUT
(
"der_type_encoder_f %s_encode_der;
\n
"
,
p
);
...
...
@@ -1297,6 +1301,8 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int tags_impl_skip
char
*
p
;
p
=
MKID
(
expr
->
Identifier
);
if
(
HIDE_INNER_DEFS
)
OUT
(
"static /* Use -fall-defs-global to expose */
\n
"
);
OUT
(
"asn1_TYPE_descriptor_t asn1_DEF_%s = {
\n
"
,
p
);
INDENTED
(
OUT
(
"
\"
%s
\"
,
\n
"
,
expr
->
_anonymous_type
?
""
:
expr
->
Identifier
);
...
...
libasn1compiler/asn1compiler.h
View file @
dd32b592
...
...
@@ -31,6 +31,10 @@ enum asn1c_flags {
* Enable use of unnamed unions (non-portable feature).
*/
A1C_UNNAMED_UNIONS
=
0x0020
,
/*
* Don't make the asn1_DEF_'s of structure members "static".
*/
A1C_ALL_DEFS_GLOBAL
=
0x0040
,
};
/*
...
...
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