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
8253ea93
Commit
8253ea93
authored
Mar 17, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command line in preamble
parent
20a7bf48
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
30 deletions
+36
-30
asn1c/asn1c.c
asn1c/asn1c.c
+1
-1
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+31
-25
libasn1compiler/asn1c_save.h
libasn1compiler/asn1c_save.h
+1
-1
libasn1compiler/asn1compiler.c
libasn1compiler/asn1compiler.c
+2
-2
libasn1compiler/asn1compiler.h
libasn1compiler/asn1compiler.h
+1
-1
No files found.
asn1c/asn1c.c
View file @
8253ea93
...
...
@@ -317,7 +317,7 @@ main(int ac, char **av) {
* of another language.
*/
if
(
asn1_compile
(
asn
,
skeletons_dir
,
asn1_compiler_flags
,
ac
+
optind
,
av
-
optind
))
{
ac
+
optind
,
optind
-
1
,
av
-
optind
))
{
exit
(
EX_SOFTWARE
);
}
...
...
libasn1compiler/asn1c_save.c
View file @
8253ea93
...
...
@@ -6,16 +6,17 @@
#include "asn1c_save.h"
#include "asn1c_out.h"
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
);
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
int
,
char
**
);
static
int
asn1c_print_streams
(
arg_t
*
arg
);
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
);
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
int
,
char
**
);
static
int
asn1c_copy_over
(
arg_t
*
arg
,
char
*
path
);
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
);
static
int
generate_pdu_collection_file
(
arg_t
*
arg
);
static
int
generate_preamble
(
arg_t
*
,
FILE
*
,
int
argc
,
int
optc
,
char
**
argv
);
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
,
int
argc
,
char
**
argv
)
{
int
argc
,
int
optc
,
char
**
argv
)
{
asn1c_fdeps_t
*
deps
=
0
;
asn1c_fdeps_t
*
dlist
;
asn1p_module_t
*
mod
;
...
...
@@ -32,7 +33,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
TQ_FOR
(
arg
->
expr
,
&
(
mod
->
members
),
next
)
{
if
(
asn1_lang_map
[
arg
->
expr
->
meta_type
]
[
arg
->
expr
->
expr_type
].
type_cb
)
{
if
(
asn1c_dump_streams
(
arg
,
deps
))
if
(
asn1c_dump_streams
(
arg
,
deps
,
argc
,
optc
,
argv
))
return
-
1
;
}
}
...
...
@@ -153,11 +155,11 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
* Dump the streams.
*/
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
)
{
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
argc
,
int
optc
,
char
**
argv
)
{
if
(
arg
->
flags
&
A1C_PRINT_COMPILED
)
{
return
asn1c_print_streams
(
arg
);
}
else
{
return
asn1c_save_streams
(
arg
,
deps
);
return
asn1c_save_streams
(
arg
,
deps
,
argc
,
optc
,
argv
);
}
}
...
...
@@ -185,7 +187,7 @@ asn1c_print_streams(arg_t *arg) {
}
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
)
{
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
argc
,
int
optc
,
char
**
argv
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
compiler_streams_t
*
cs
=
expr
->
data
;
out_chunk_t
*
ot
;
...
...
@@ -210,24 +212,8 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
return
-
1
;
}
fprintf
(
fp_c
,
"/*
\n
"
" * Generated by asn1c-"
VERSION
" (http://lionet.info/asn1c)
\n
"
" * From ASN.1 module
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" */
\n\n
"
,
expr
->
module
->
ModuleName
,
expr
->
module
->
source_file_name
);
fprintf
(
fp_h
,
"/*
\n
"
" * Generated by asn1c-"
VERSION
" (http://lionet.info/asn1c)
\n
"
" * From ASN.1 module
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" */
\n\n
"
,
expr
->
module
->
ModuleName
,
expr
->
module
->
source_file_name
);
generate_preamble
(
arg
,
fp_c
,
argc
,
optc
,
argv
);
generate_preamble
(
arg
,
fp_h
,
argc
,
optc
,
argv
);
header_id
=
asn1c_make_identifier
(
0
,
expr
->
Identifier
,
NULL
);
fprintf
(
fp_h
,
...
...
@@ -316,6 +302,26 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
return
0
;
}
static
int
generate_preamble
(
arg_t
*
arg
,
FILE
*
fp
,
int
argc
,
int
optc
,
char
**
argv
)
{
fprintf
(
fp
,
"/*
\n
"
" * Generated by asn1c-"
VERSION
" (http://lionet.info/asn1c)
\n
"
" * From ASN.1 module
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
,
arg
->
expr
->
module
->
ModuleName
,
arg
->
expr
->
module
->
source_file_name
);
if
(
optc
>
1
)
{
int
i
;
fprintf
(
fp
,
" *
\t
`asn1c "
);
for
(
i
=
1
;
i
<
optc
;
i
++
)
fprintf
(
fp
,
"%s%s"
,
i
>
1
?
" "
:
""
,
argv
[
i
]);
fprintf
(
fp
,
"`
\n
"
);
}
fprintf
(
fp
,
" */
\n\n
"
);
return
0
;
}
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
)
{
char
buf
[
2
][
4096
];
...
...
libasn1compiler/asn1c_save.h
View file @
8253ea93
...
...
@@ -2,6 +2,6 @@
#define _ASN1C_SAVE_H_
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
,
int
argc
,
char
**
argv
);
int
argc
,
int
optc
,
char
**
argv
);
#endif
/* _ASN1C_SAVE_H_ */
libasn1compiler/asn1compiler.c
View file @
8253ea93
...
...
@@ -9,7 +9,7 @@ static int asn1c_attach_streams(asn1p_expr_t *expr);
int
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
flags
,
int
argc
,
char
**
argv
)
{
int
argc
,
int
optc
,
char
**
argv
)
{
arg_t
arg_s
;
arg_t
*
arg
=
&
arg_s
;
asn1p_module_t
*
mod
;
...
...
@@ -58,7 +58,7 @@ asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags,
/*
* Save or print out the compiled result.
*/
if
(
asn1c_save_compiled_output
(
arg
,
datadir
,
argc
,
argv
))
if
(
asn1c_save_compiled_output
(
arg
,
datadir
,
argc
,
optc
,
argv
))
return
-
1
;
return
0
;
...
...
libasn1compiler/asn1compiler.h
View file @
8253ea93
...
...
@@ -72,6 +72,6 @@ enum asn1c_flags {
* Compile the ASN.1 specification.
*/
int
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
,
int
argc
,
char
**
argv
);
int
argc
,
int
optc
,
char
**
argv
);
#endif
/* ASN1_COMPILER_H */
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