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
866cff1a
Commit
866cff1a
authored
Mar 05, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for regen target
parent
b9b8b959
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
11 deletions
+22
-11
asn1c/asn1c.c
asn1c/asn1c.c
+2
-1
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+13
-6
libasn1compiler/asn1c_save.h
libasn1compiler/asn1c_save.h
+2
-1
libasn1compiler/asn1compiler.c
libasn1compiler/asn1compiler.c
+3
-2
libasn1compiler/asn1compiler.h
libasn1compiler/asn1compiler.h
+2
-1
No files found.
asn1c/asn1c.c
View file @
866cff1a
...
@@ -277,7 +277,8 @@ main(int ac, char **av) {
...
@@ -277,7 +277,8 @@ main(int ac, char **av) {
* Compile the ASN.1 tree into a set of source files
* Compile the ASN.1 tree into a set of source files
* of another language.
* of another language.
*/
*/
if
(
asn1_compile
(
asn
,
skeletons_dir
,
asn1_compiler_flags
))
{
if
(
asn1_compile
(
asn
,
skeletons_dir
,
asn1_compiler_flags
,
ac
+
optind
,
av
-
optind
))
{
exit
(
EX_SOFTWARE
);
exit
(
EX_SOFTWARE
);
}
}
...
...
libasn1compiler/asn1c_save.c
View file @
866cff1a
...
@@ -13,10 +13,12 @@ static int asn1c_copy_over(arg_t *arg, char *path);
...
@@ -13,10 +13,12 @@ static int asn1c_copy_over(arg_t *arg, char *path);
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
);
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
);
int
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
)
{
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
,
int
argc
,
char
**
argv
)
{
asn1c_fdeps_t
*
deps
=
0
;
asn1c_fdeps_t
*
deps
=
0
;
FILE
*
mkf
;
asn1c_fdeps_t
*
dlist
;
asn1c_fdeps_t
*
dlist
;
FILE
*
mkf
;
int
i
;
deps
=
asn1c_read_file_dependencies
(
arg
,
datadir
);
deps
=
asn1c_read_file_dependencies
(
arg
,
datadir
);
if
(
!
deps
&&
datadir
)
{
if
(
!
deps
&&
datadir
)
{
...
@@ -78,7 +80,6 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) {
...
@@ -78,7 +80,6 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) {
char
buf
[
8129
];
char
buf
[
8129
];
char
*
dir_end
;
char
*
dir_end
;
size_t
dlen
=
strlen
(
datadir
);
size_t
dlen
=
strlen
(
datadir
);
int
i
;
assert
(
dlen
<
(
sizeof
(
buf
)
/
2
-
2
));
assert
(
dlen
<
(
sizeof
(
buf
)
/
2
-
2
));
memcpy
(
buf
,
datadir
,
dlen
);
memcpy
(
buf
,
datadir
,
dlen
);
...
@@ -126,8 +127,14 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) {
...
@@ -126,8 +127,14 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir) {
"
\n
clean:"
"
\n
clean:"
"
\n\t
rm -f $(TARGET)"
"
\n\t
rm -f $(TARGET)"
"
\n\t
rm -f $(OBJS)
\n
"
"
\n\t
rm -f $(OBJS)
\n
"
"
\n
"
"
\n
regen: regenerate-from-asn1-source
\n
"
"
\n
regenerate-from-asn1-source:
\n\t
"
);
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
fprintf
(
mkf
,
"%s%s"
,
i
?
" "
:
""
,
argv
[
i
]);
fprintf
(
mkf
,
"
\n\n
"
);
fclose
(
mkf
);
fclose
(
mkf
);
fprintf
(
stderr
,
"Generated Makefile.am.sample
\n
"
);
fprintf
(
stderr
,
"Generated Makefile.am.sample
\n
"
);
...
@@ -225,7 +232,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
...
@@ -225,7 +232,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
fprintf
(
fp_h
,
"#include <asn_application.h>
\n
"
);
fprintf
(
fp_h
,
"#include <asn_application.h>
\n
"
);
#define SAVE_STREAM(fp, idx, msg, actdep) do { \
#define SAVE_STREAM(fp, idx, msg, actdep) do { \
if(TQ_FIRST(&(cs->destination[idx].chunks)) && msg) \
if(TQ_FIRST(&(cs->destination[idx].chunks)) &&
*
msg) \
fprintf(fp, "\n
/* %s */
\n", msg); \
fprintf(fp, "\n
/* %s */
\n", msg); \
TQ_FOR(ot, &(cs->destination[idx].chunks), next) { \
TQ_FOR(ot, &(cs->destination[idx].chunks), next) { \
if(actdep) asn1c_activate_dependency(deps, 0, ot->buf); \
if(actdep) asn1c_activate_dependency(deps, 0, ot->buf); \
...
@@ -248,7 +255,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
...
@@ -248,7 +255,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
fprintf
(
fp_c
,
"#include <asn_internal.h>
\n\n
"
);
fprintf
(
fp_c
,
"#include <asn_internal.h>
\n\n
"
);
fprintf
(
fp_c
,
"#include <%s.h>
\n\n
"
,
expr
->
Identifier
);
/* Myself */
fprintf
(
fp_c
,
"#include <%s.h>
\n\n
"
,
expr
->
Identifier
);
/* Myself */
if
(
arg
->
flags
&
A1C_NO_INCLUDE_DEPS
)
if
(
arg
->
flags
&
A1C_NO_INCLUDE_DEPS
)
SAVE_STREAM
(
fp_c
,
OT_POST_INCLUDE
,
0
,
1
);
SAVE_STREAM
(
fp_c
,
OT_POST_INCLUDE
,
""
,
1
);
TQ_FOR
(
ot
,
&
(
cs
->
destination
[
OT_CTABLES
].
chunks
),
next
)
TQ_FOR
(
ot
,
&
(
cs
->
destination
[
OT_CTABLES
].
chunks
),
next
)
fwrite
(
ot
->
buf
,
ot
->
len
,
1
,
fp_c
);
fwrite
(
ot
->
buf
,
ot
->
len
,
1
,
fp_c
);
TQ_FOR
(
ot
,
&
(
cs
->
destination
[
OT_CODE
].
chunks
),
next
)
TQ_FOR
(
ot
,
&
(
cs
->
destination
[
OT_CODE
].
chunks
),
next
)
...
...
libasn1compiler/asn1c_save.h
View file @
866cff1a
#ifndef _ASN1C_SAVE_H_
#ifndef _ASN1C_SAVE_H_
#define _ASN1C_SAVE_H_
#define _ASN1C_SAVE_H_
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
);
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
,
int
argc
,
char
**
argv
);
#endif
/* _ASN1C_SAVE_H_ */
#endif
/* _ASN1C_SAVE_H_ */
libasn1compiler/asn1compiler.c
View file @
866cff1a
...
@@ -8,7 +8,8 @@ static int asn1c_compile_expr(arg_t *arg);
...
@@ -8,7 +8,8 @@ static int asn1c_compile_expr(arg_t *arg);
static
int
asn1c_attach_streams
(
asn1p_expr_t
*
expr
);
static
int
asn1c_attach_streams
(
asn1p_expr_t
*
expr
);
int
int
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
flags
)
{
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
flags
,
int
argc
,
char
**
argv
)
{
arg_t
arg_s
;
arg_t
arg_s
;
arg_t
*
arg
=
&
arg_s
;
arg_t
*
arg
=
&
arg_s
;
int
ret
;
int
ret
;
...
@@ -56,7 +57,7 @@ asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags) {
...
@@ -56,7 +57,7 @@ asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags) {
/*
/*
* Save or print out the compiled result.
* Save or print out the compiled result.
*/
*/
if
(
asn1c_save_compiled_output
(
arg
,
datadir
))
if
(
asn1c_save_compiled_output
(
arg
,
datadir
,
argc
,
argv
))
return
-
1
;
return
-
1
;
return
0
;
return
0
;
...
...
libasn1compiler/asn1compiler.h
View file @
866cff1a
...
@@ -52,6 +52,7 @@ enum asn1c_flags {
...
@@ -52,6 +52,7 @@ enum asn1c_flags {
/*
/*
* Compile the ASN.1 specification.
* Compile the ASN.1 specification.
*/
*/
int
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
);
int
asn1_compile
(
asn1p_t
*
asn
,
const
char
*
datadir
,
enum
asn1c_flags
,
int
argc
,
char
**
argv
);
#endif
/* ASN1_COMPILER_H */
#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