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
f218e785
Commit
f218e785
authored
Sep 12, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CONVERTER is now in dependencies
parent
f5b49399
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
24 deletions
+43
-24
libasn1compiler/asn1c_fdeps.c
libasn1compiler/asn1c_fdeps.c
+13
-15
libasn1compiler/asn1c_fdeps.h
libasn1compiler/asn1c_fdeps.h
+8
-1
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+19
-7
skeletons/file-dependencies
skeletons/file-dependencies
+3
-1
No files found.
libasn1compiler/asn1c_fdeps.c
View file @
f218e785
...
@@ -13,7 +13,7 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
...
@@ -13,7 +13,7 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
return
0
;
return
0
;
if
(
!
cur
)
cur
=
deps
;
if
(
!
cur
)
cur
=
deps
;
if
(
cur
->
us
ed_somewhere
)
if
(
cur
->
us
age
!=
FDEP_NOTUSED
)
return
1
;
/* Already activated */
return
1
;
/* Already activated */
fname
=
data
;
fname
=
data
;
...
@@ -37,7 +37,7 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
...
@@ -37,7 +37,7 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
}
}
if
(
cur
->
filename
&&
strcmp
(
cur
->
filename
,
fname
)
==
0
)
{
if
(
cur
->
filename
&&
strcmp
(
cur
->
filename
,
fname
)
==
0
)
{
cur
->
us
ed_somewhere
=
1
;
cur
->
us
age
=
FDEP_REFERRED
;
/* Activate subdependencies */
/* Activate subdependencies */
for
(
i
=
0
;
i
<
cur
->
el_count
;
i
++
)
{
for
(
i
=
0
;
i
<
cur
->
el_count
;
i
++
)
{
...
@@ -62,16 +62,11 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
...
@@ -62,16 +62,11 @@ asn1c_activate_dependency(asn1c_fdeps_t *deps, asn1c_fdeps_t *cur, const char *d
asn1c_fdeps_t
*
asn1c_fdeps_t
*
asn1c_read_file_dependencies
(
arg_t
*
arg
,
const
char
*
datadir
)
{
asn1c_read_file_dependencies
(
arg_t
*
arg
,
const
char
*
datadir
)
{
char
buf
[
4096
];
asn1c_fdeps_t
*
deps
;
asn1c_fdeps_t
*
deps
;
asn1c_fdeps_t
*
cur
;
asn1c_fdeps_t
*
cur
;
char
buf
[
4096
];
FILE
*
f
;
FILE
*
f
;
enum
{
enum
fdep_usage
special_section
=
FDEP_REFERRED
;
SS_DYNAMIC
,
/* Dynamic list of dependencies */
SS_CODEC_PER
,
/* Use contents only if -gen-PER */
SS_COMMON_FILES
,
/* Section for dependencies */
SS_IGNORE
/* Ignore contents of this section */
}
special_section
=
SS_DYNAMIC
;
(
void
)
arg
;
(
void
)
arg
;
...
@@ -101,22 +96,24 @@ asn1c_read_file_dependencies(arg_t *arg, const char *datadir) {
...
@@ -101,22 +96,24 @@ asn1c_read_file_dependencies(arg_t *arg, const char *datadir) {
* Special "prefix" section.
* Special "prefix" section.
*/
*/
if
(
strchr
(
p
,
':'
))
{
if
(
strchr
(
p
,
':'
))
{
special_section
=
SS
_IGNORE
;
special_section
=
FDEP
_IGNORE
;
if
(
strcmp
(
p
,
"COMMON-FILES:"
)
==
0
)
{
if
(
strcmp
(
p
,
"COMMON-FILES:"
)
==
0
)
{
special_section
=
SS_COMMON_FILES
;
special_section
=
FDEP_COMMON_FILES
;
}
else
if
(
strcmp
(
p
,
"CONVERTER:"
)
==
0
)
{
special_section
=
FDEP_CONVERTER
;
}
else
if
((
arg
->
flags
&
A1C_GEN_PER
)
}
else
if
((
arg
->
flags
&
A1C_GEN_PER
)
&&
strcmp
(
p
,
"CODEC-PER:"
)
==
0
)
{
&&
strcmp
(
p
,
"CODEC-PER:"
)
==
0
)
{
special_section
=
SS
_CODEC_PER
;
special_section
=
FDEP
_CODEC_PER
;
}
}
break
;
break
;
}
}
if
(
special_section
==
SS
_IGNORE
)
if
(
special_section
==
FDEP
_IGNORE
)
continue
;
continue
;
d
=
asn1c_new_dep
(
p
);
d
=
asn1c_new_dep
(
p
);
assert
(
d
);
assert
(
d
);
d
->
us
ed_somewher
e
=
special_section
;
d
->
us
ag
e
=
special_section
;
if
(
asn1c_dep_add
(
cur
,
d
)
==
1
)
if
(
asn1c_dep_add
(
cur
,
d
)
==
1
)
cur
=
d
;
cur
=
d
;
...
@@ -178,8 +175,9 @@ asn1c_deps_makelist(asn1c_fdeps_t *deps) {
...
@@ -178,8 +175,9 @@ asn1c_deps_makelist(asn1c_fdeps_t *deps) {
dlist
=
asn1c_new_dep
(
0
);
dlist
=
asn1c_new_dep
(
0
);
if
(
deps
->
filename
&&
deps
->
us
ed_somewhere
)
{
if
(
deps
->
filename
&&
deps
->
us
age
!=
FDEP_NOTUSED
)
{
d
=
asn1c_new_dep
(
deps
->
filename
);
d
=
asn1c_new_dep
(
deps
->
filename
);
d
->
usage
=
deps
->
usage
;
asn1c_dep_add
(
dlist
,
d
);
asn1c_dep_add
(
dlist
,
d
);
}
}
...
...
libasn1compiler/asn1c_fdeps.h
View file @
f218e785
...
@@ -4,7 +4,14 @@
...
@@ -4,7 +4,14 @@
typedef
struct
asn1c_fdeps_s
{
typedef
struct
asn1c_fdeps_s
{
char
*
filename
;
/* Or 0, if root. */
char
*
filename
;
/* Or 0, if root. */
int
used_somewhere
;
/* Somefile refers to it */
enum
fdep_usage
{
FDEP_IGNORE
=
-
1
,
/* Ignore contents of the section */
FDEP_NOTUSED
=
0
,
FDEP_REFERRED
=
1
,
/* Dynamic list of dependencies */
FDEP_CONVERTER
=
2
,
/* Name of the int main() file */
FDEP_COMMON_FILES
=
3
,
/* Section for mandatory dependencies */
FDEP_CODEC_PER
=
4
,
/* Use contents only if -gen-PER */
}
usage
;
/* Some file refers to it */
struct
asn1c_fdeps_s
**
elements
;
struct
asn1c_fdeps_s
**
elements
;
int
el_size
;
int
el_size
;
...
...
libasn1compiler/asn1c_save.c
View file @
f218e785
...
@@ -90,6 +90,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
...
@@ -90,6 +90,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
*
dir_end
++
=
'/'
;
*
dir_end
++
=
'/'
;
for
(
i
=
0
;
i
<
dlist
->
el_count
;
i
++
)
{
for
(
i
=
0
;
i
<
dlist
->
el_count
;
i
++
)
{
char
*
what_class
;
/* MODULE or CONVERTER */
char
*
what_kind
;
/* HEADERS or SOURCES */
char
*
fname
=
dlist
->
elements
[
i
]
->
filename
;
char
*
fname
=
dlist
->
elements
[
i
]
->
filename
;
char
*
dotH
;
char
*
dotH
;
...
@@ -101,17 +103,26 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
...
@@ -101,17 +103,26 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
fclose
(
mkf
);
fclose
(
mkf
);
return
-
1
;
return
-
1
;
}
}
dotH
=
strrchr
(
fname
,
'h'
);
if
(
dotH
&&
fname
<
dotH
&&
dotH
[
-
1
]
==
'.'
&&
!
dotH
[
1
])
{
/* MODULE data versus CONVERTER data */
fprintf
(
mkf
,
"ASN_MODULE_HEADERS+=%s
\n
"
,
fname
);
switch
(
dlist
->
elements
[
i
]
->
usage
)
{
}
else
{
case
FDEP_CONVERTER
:
what_class
=
"CONVERTER"
;
break
;
fprintf
(
mkf
,
"ASN_MODULE_SOURCES+=%s
\n
"
,
fname
)
;
default:
what_class
=
"MODULE"
;
break
;
}
}
/* HEADERS versus SOURCES */
dotH
=
strrchr
(
fname
,
'h'
);
if
(
dotH
&&
fname
<
dotH
&&
dotH
[
-
1
]
==
'.'
&&
!
dotH
[
1
])
what_kind
=
"HEADERS"
;
else
what_kind
=
"SOURCES"
;
fprintf
(
mkf
,
"ASN_%s_%s+=%s
\n
"
,
what_class
,
what_kind
,
fname
);
}
}
}
}
if
(
arg
->
flags
&
A1C_PDU_AUTO
)
{
if
(
arg
->
flags
&
A1C_PDU_AUTO
)
{
fprintf
(
mkf
,
"ASN_
MODULE
_SOURCES+=pdu_collection.c
\n
"
);
fprintf
(
mkf
,
"ASN_
CONVERTER
_SOURCES+=pdu_collection.c
\n
"
);
if
(
generate_pdu_collection_file
(
arg
))
if
(
generate_pdu_collection_file
(
arg
))
return
-
1
;
return
-
1
;
}
}
...
@@ -125,7 +136,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
...
@@ -125,7 +136,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
"# Remove the lines below to convert it into a pure .am file
\n
"
"# Remove the lines below to convert it into a pure .am file
\n
"
"TARGET = progname
\n
"
"TARGET = progname
\n
"
"CFLAGS += -I.
\n
"
"CFLAGS += -I.
\n
"
"OBJS=${ASN_MODULE_SOURCES:.c=.o} $(TARGET).o
\n
"
"OBJS=${ASN_MODULE_SOURCES:.c=.o}"
" ${ASN_CONVERTER_SOURCES:.c=.o}
\n
"
"
\n
all: $(TARGET)
\n
"
"
\n
all: $(TARGET)
\n
"
"
\n
$(TARGET): ${OBJS}"
"
\n
$(TARGET): ${OBJS}"
"
\n\t
$(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
\n
"
"
\n\t
$(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
\n
"
...
...
skeletons/file-dependencies
View file @
f218e785
...
@@ -61,6 +61,8 @@ xer_encoder.h xer_encoder.c # XER encoding support
...
@@ -61,6 +61,8 @@ xer_encoder.h xer_encoder.c # XER encoding support
per_support.h per_support.c # PER parsing
per_support.h per_support.c # PER parsing
per_decoder.h per_decoder.c # PER decoding support
per_decoder.h per_decoder.c # PER decoding support
per_encoder.h per_encoder.c # PER encoding support
per_encoder.h per_encoder.c # PER encoding support
#converter-sample.c # A sample of transcoder
CONVERTER: # THIS IS A SPECIAL SECTION
converter-sample.c # A default name for sample transcoder
CODEC-PER: # THIS IS A SPECIAL SECTION
CODEC-PER: # THIS IS A SPECIAL SECTION
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