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
a895afba
Commit
a895afba
authored
Oct 06, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-fskeletons-copy
parent
c0e7071c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
18 deletions
+96
-18
ChangeLog
ChangeLog
+2
-1
asn1c/asn1c.1
asn1c/asn1c.1
+4
-1
asn1c/asn1c.c
asn1c/asn1c.c
+3
-0
doc/asn1c-usage.html
doc/asn1c-usage.html
+4
-0
doc/asn1c-usage.lyx
doc/asn1c-usage.lyx
+32
-2
doc/asn1c-usage.pdf
doc/asn1c-usage.pdf
+0
-0
libasn1compiler/asn1c_compat.c
libasn1compiler/asn1c_compat.c
+8
-1
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+38
-13
libasn1compiler/asn1compiler.h
libasn1compiler/asn1compiler.h
+5
-0
No files found.
ChangeLog
View file @
a895afba
0.9.19: 2005-Oct-0
5
0.9.19: 2005-Oct-0
6
* A proper solution to circular references. No kludge flags
should be necessary anymore to produce reference-free code:
...
...
@@ -10,6 +10,7 @@
* New feature for unber(1): -s <skip> bytes.
* Mandatory elements map for SET was not getting generated properly.
(Test case 94) (Severity: high; Security impact: low)
* asn1c: new command line option: -fskeletons-copy.
0.9.18: 2005-Aug-14
...
...
asn1c/asn1c.1
View file @
a895afba
...
...
@@ -25,7 +25,7 @@ and other encoding standards.
.br
\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
\fB\-fnative-types \-fno-constraints \-fno-include-deps \-funnamed-unions \-f
skeletons-copy \-f
types88\fR
.TP
\fIOutput Options\fR
.br
...
...
@@ -115,6 +115,9 @@ Helps prevent namespace collisions.
.B \-funnamed-unions
Enable unnamed unions in the definitions of target language's structures.
.TP
.B \-fskeletons-copy
Copy support files (skeletons) rather than symlink them.
.TP
.B \-ftypes88
Pretend to support only ASN.1:1988 embedded types. Certain reserved words,
such as UniversalString and BMPString, become ordinary type references
...
...
asn1c/asn1c.c
View file @
a895afba
...
...
@@ -93,6 +93,8 @@ main(int ac, char **av) {
asn1_compiler_flags
|=
A1C_NO_INCLUDE_DEPS
;
}
else
if
(
strcmp
(
optarg
,
"unnamed-unions"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_UNNAMED_UNIONS
;
}
else
if
(
strcmp
(
optarg
,
"skeletons-copy"
)
==
0
)
{
asn1_compiler_flags
|=
A1C_SKELETONS_COPY
;
}
else
if
(
strcmp
(
optarg
,
"types88"
)
==
0
)
{
asn1_parser_flags
|=
A1P_TYPES_RESTRICT_TO_1988
;
}
else
{
...
...
@@ -321,6 +323,7 @@ usage(const char *av0) {
" -fno-constraints Do not generate constraint checking code
\n
"
" -fno-include-deps Do not generate courtesy #includes for dependencies
\n
"
" -funnamed-unions Enable unnamed unions in structures
\n
"
" -fskeletons-copy Force copying the support files
\n
"
" -ftypes88 Pretend to support only ASN.1:1988 embedded types
\n
"
"
\n
"
...
...
doc/asn1c-usage.html
View file @
a895afba
...
...
@@ -430,11 +430,15 @@ dependencies.</FONT></TD></TR>
<FONT
SIZE=
"-1"
>
Enable unnamed unions in the definitions of target language's
structures.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><FONT
SIZE=
"-1"
>
-fskeletons-copy
</FONT></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<FONT
SIZE=
"-1"
>
Copy support files rather than symlink them.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><FONT
SIZE=
"-1"
>
-ftypes88
</FONT></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<FONT
SIZE=
"-1"
>
Pretend to support only ASN.1:1988 embedded types. Certain
reserved words, such as UniversalString and BMPString, become ordinary
type references and may be redefined by the specification.
</FONT></TD></TR>
</TBODY><TBODY>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
><B><FONT
SIZE=
"-1"
>
Output Options
</FONT></B></TD><TD
VALIGN=
BASELINE
ALIGN=
LEFT
WIDTH=
"216"
>
<B><FONT
SIZE=
"-1"
>
Description
</FONT></B></TD></TR>
<TR><TD
VALIGN=
BASELINE
ALIGN=
LEFT
NOWRAP
>
...
...
doc/asn1c-usage.lyx
View file @
a895afba
...
...
@@ -71,7 +71,7 @@ status Open
\backslash
lhead{This document describes
\backslash
href{http://lionet.info/asn1c}{asn1c-0.9.1
8
}}
href{http://lionet.info/asn1c}{asn1c-0.9.1
9
}}
\layout Standard
\backslash
...
...
@@ -451,7 +451,7 @@ The following table summarizes the asn1c command line options.
\begin_inset Tabular
<lyxtabular version="3" rows="2
6
" columns="2">
<lyxtabular version="3" rows="2
7
" 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">
...
...
@@ -836,6 +836,8 @@ Use complex names for C structures.
\layout Standard
\size small
-findirect-choice
\end_inset
</cell>
...
...
@@ -844,6 +846,8 @@ Use complex names for C structures.
\layout Standard
\size small
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
...
...
@@ -861,6 +865,8 @@ When generating code for a CHOICE type, compile the CHOICE members as indirect
\layout Standard
\size small
-fknown-extern-type=
\emph on
<name>
...
...
@@ -871,6 +877,8 @@ When generating code for a CHOICE type, compile the CHOICE members as indirect
\layout Standard
\size small
Pretend the specified type is known.
The compiler will assume the target language source files for the given
type have been provided manually.
...
...
@@ -969,6 +977,28 @@ Enable unnamed unions in the definitions of target language's structures.
\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
-fskeletons-copy
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\layout Standard
\size small
Copy support files rather than symlink them.
\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
...
...
doc/asn1c-usage.pdf
View file @
a895afba
No preview for this file type
libasn1compiler/asn1c_compat.c
View file @
a895afba
...
...
@@ -80,12 +80,19 @@ asn1c_open_file(const char *name, const char *ext, char **opt_tmpname) {
if
(
fp
==
NULL
)
{
if
(
created
)
unlink
(
fname
);
close
(
fd
);
return
NULL
;
}
/* Return the temporary file name */
if
(
opt_tmpname
)
{
*
opt_tmpname
=
strdup
(
fname
);
assert
(
*
opt_tmpname
);
if
(
*
opt_tmpname
)
{
/* Successfull */
}
else
{
if
(
created
)
unlink
(
fname
);
fclose
(
fp
);
return
NULL
;
}
}
return
fp
;
...
...
libasn1compiler/asn1c_save.c
View file @
a895afba
...
...
@@ -280,6 +280,8 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
if
(
rename
(
tmpname_c
,
name_buf
))
{
unlink
(
tmpname_c
);
perror
(
tmpname_c
);
free
(
tmpname_c
);
free
(
tmpname_h
);
return
-
1
;
}
}
...
...
@@ -292,6 +294,8 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
if
(
rename
(
tmpname_h
,
name_buf
))
{
unlink
(
tmpname_h
);
perror
(
tmpname_h
);
free
(
tmpname_c
);
free
(
tmpname_h
);
return
-
1
;
}
}
...
...
@@ -308,11 +312,20 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
)
{
char
buf
[
2
][
8192
];
char
buf
[
2
][
4096
];
FILE
*
fp1
,
*
fp2
;
size_t
olen
,
nlen
;
int
retval
=
1
;
/* Files are identical */
#ifndef WIN32
struct
stat
sb
;
if
(
lstat
(
fname1
,
&
sb
)
||
!
S_ISREG
(
sb
.
st_mode
)
||
lstat
(
fname2
,
&
sb
)
||
!
S_ISREG
(
sb
.
st_mode
))
{
return
0
;
/* Files are not identical */
}
#endif
fp1
=
fopen
(
fname1
,
"r"
);
if
(
!
fp1
)
{
return
0
;
}
fp2
=
fopen
(
fname2
,
"r"
);
...
...
@@ -338,7 +351,8 @@ identical_files(const char *fname1, const char *fname2) {
*/
static
int
real_copy
(
const
char
*
src
,
const
char
*
dst
)
{
unsigned
char
buf
[
8192
];
unsigned
char
buf
[
4096
];
char
*
tmpname
;
FILE
*
fpsrc
,
*
fpdst
;
size_t
len
;
int
retval
=
0
;
...
...
@@ -348,36 +362,45 @@ real_copy(const char *src, const char *dst) {
fpsrc
=
fopen
(
src
,
"r"
);
if
(
!
fpsrc
)
{
errno
=
EIO
;
return
-
1
;
}
fpdst
=
asn1c_open_file
(
dst
,
""
,
0
);
fpdst
=
asn1c_open_file
(
dst
,
""
,
&
tmpname
);
if
(
!
fpdst
)
{
fclose
(
fpsrc
);
errno
=
EIO
;
return
-
1
;
}
while
(
!
feof
(
fpsrc
))
{
len
=
fread
(
buf
,
1
,
sizeof
(
buf
),
fpsrc
);
if
(
fwrite
(
buf
,
1
,
len
,
fpdst
)
!=
len
)
{
perror
(
tmpname
);
errno
=
EIO
;
retval
=
-
1
;
break
;
}
}
fclose
(
fpsrc
);
fclose
(
fpdst
);
/* Check if copied correctly, and rename into a permanent name */
if
(
retval
)
{
unlink
(
tmpname
);
}
else
if
(
rename
(
tmpname
,
dst
))
{
unlink
(
tmpname
);
perror
(
tmpname
);
retval
=
-
1
;
}
free
(
tmpname
);
return
retval
;
}
static
int
asn1c_copy_over
(
arg_t
*
arg
,
char
*
path
)
{
char
*
fname
;
(
void
)
arg
;
/* Unused argument */
fname
=
a1c_basename
(
path
);
if
(
!
fname
#ifdef WIN32
||
real_copy
(
path
,
fname
)
int
use_real_copy
=
1
;
#else
||
(
1
?
symlink
(
path
,
fname
)
:
real_copy
(
path
,
fname
))
int
use_real_copy
=
(
arg
->
flags
&
A1C_SKELETONS_COPY
);
#endif
fname
=
a1c_basename
(
path
);
if
(
!
fname
||
(
use_real_copy
?
real_copy
(
path
,
fname
)
:
symlink
(
path
,
fname
))
)
{
if
(
errno
==
EEXIST
)
{
struct
stat
sb1
,
sb2
;
...
...
@@ -402,13 +425,15 @@ asn1c_copy_over(arg_t *arg, char *path) {
/* Ignore this */
return
0
;
}
else
{
fprintf
(
stderr
,
"Symlink %s -> %s failed: %s
\n
"
,
fprintf
(
stderr
,
"%s %s -> %s failed: %s
\n
"
,
use_real_copy
?
"Copy"
:
"Symlink"
,
path
,
fname
,
strerror
(
errno
));
return
-
1
;
}
}
fprintf
(
stderr
,
"Symlinked %s
\t
-> %s
\n
"
,
path
,
fname
);
fprintf
(
stderr
,
"%s %s
\t
-> %s
\n
"
,
use_real_copy
?
"Copied"
:
"Symlinked"
,
path
,
fname
);
return
1
;
}
...
...
libasn1compiler/asn1compiler.h
View file @
a895afba
...
...
@@ -51,6 +51,11 @@ enum asn1c_flags {
* Compile members of CHOICE as indirect pointers.
*/
A1C_INDIRECT_CHOICE
=
0x0400
,
/*
* -fskeletons-copy
* Copy support files rather than symlink them.
*/
A1C_SKELETONS_COPY
=
0x0800
,
};
/*
...
...
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