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
7e033b54
Commit
7e033b54
authored
Jul 02, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted definitions to include gcc 4.x into the supported compilers list
parent
2f505029
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
28 deletions
+38
-28
skeletons/NativeInteger.c
skeletons/NativeInteger.c
+7
-1
skeletons/NativeReal.c
skeletons/NativeReal.c
+7
-1
skeletons/asn-decoder-template.c
skeletons/asn-decoder-template.c
+0
-1
skeletons/asn_SET_OF.c
skeletons/asn_SET_OF.c
+3
-5
skeletons/asn_internal.h
skeletons/asn_internal.h
+12
-0
skeletons/constr_SEQUENCE_OF.c
skeletons/constr_SEQUENCE_OF.c
+2
-4
skeletons/constr_SET_OF.c
skeletons/constr_SET_OF.c
+7
-16
No files found.
skeletons/NativeInteger.c
View file @
7e033b54
...
@@ -91,8 +91,14 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -91,8 +91,14 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
*/
*/
{
{
INTEGER_t
tmp
;
INTEGER_t
tmp
;
union
{
const
void
*
constbuf
;
void
*
nonconstbuf
;
}
unconst_buf
;
long
l
;
long
l
;
(
const
uint8_t
*
)
tmp
.
buf
=
(
const
uint8_t
*
)
buf_ptr
;
unconst_buf
.
constbuf
=
buf_ptr
;
tmp
.
buf
=
(
uint8_t
*
)
unconst_buf
.
nonconstbuf
;
tmp
.
size
=
length
;
tmp
.
size
=
length
;
if
(
asn_INTEGER2long
(
&
tmp
,
&
l
))
{
if
(
asn_INTEGER2long
(
&
tmp
,
&
l
))
{
...
...
skeletons/NativeReal.c
View file @
7e033b54
...
@@ -93,8 +93,14 @@ NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -93,8 +93,14 @@ NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
*/
*/
{
{
REAL_t
tmp
;
REAL_t
tmp
;
union
{
const
void
*
constbuf
;
void
*
nonconstbuf
;
}
unconst_buf
;
double
d
;
double
d
;
(
const
uint8_t
*
)
tmp
.
buf
=
(
const
uint8_t
*
)
buf_ptr
;
unconst_buf
.
constbuf
=
buf_ptr
;
tmp
.
buf
=
(
uint8_t
*
)
unconst_buf
.
nonconstbuf
;
tmp
.
size
=
length
;
tmp
.
size
=
length
;
if
(
asn_REAL2double
(
&
tmp
,
&
d
))
{
if
(
asn_REAL2double
(
&
tmp
,
&
d
))
{
...
...
skeletons/asn-decoder-template.c
View file @
7e033b54
...
@@ -28,7 +28,6 @@ static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU,
...
@@ -28,7 +28,6 @@ static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU,
int
opt_debug
;
/* -d */
int
opt_debug
;
/* -d */
static
int
opt_check
;
/* -c */
static
int
opt_check
;
/* -c */
static
int
opt_print
;
/* -p */
static
int
opt_stack
;
/* -s */
static
int
opt_stack
;
/* -s */
static
enum
output_method
{
static
enum
output_method
{
OUT_NONE
,
/* No pretty-printing */
OUT_NONE
,
/* No pretty-printing */
...
...
skeletons/asn_SET_OF.c
View file @
7e033b54
...
@@ -6,14 +6,12 @@
...
@@ -6,14 +6,12 @@
#include <asn_SET_OF.h>
#include <asn_SET_OF.h>
#include <errno.h>
#include <errno.h>
typedef
A_SET_OF
(
void
)
asn_set
;
/*
/*
* Add another element into the set.
* Add another element into the set.
*/
*/
int
int
asn_set_add
(
void
*
asn_set_of_x
,
void
*
ptr
)
{
asn_set_add
(
void
*
asn_set_of_x
,
void
*
ptr
)
{
asn_
set
*
as
=
(
asn_set
*
)
asn_set_of_x
;
asn_
anonymous_set_
*
as
=
_A_SET_FROM_VOID
(
asn_set_of_x
)
;
if
(
as
==
0
||
ptr
==
0
)
{
if
(
as
==
0
||
ptr
==
0
)
{
errno
=
EINVAL
;
/* Invalid arguments */
errno
=
EINVAL
;
/* Invalid arguments */
...
@@ -43,7 +41,7 @@ asn_set_add(void *asn_set_of_x, void *ptr) {
...
@@ -43,7 +41,7 @@ asn_set_add(void *asn_set_of_x, void *ptr) {
void
void
asn_set_del
(
void
*
asn_set_of_x
,
int
number
,
int
_do_free
)
{
asn_set_del
(
void
*
asn_set_of_x
,
int
number
,
int
_do_free
)
{
asn_
set
*
as
=
(
asn_set
*
)
asn_set_of_x
;
asn_
anonymous_set_
*
as
=
_A_SET_FROM_VOID
(
asn_set_of_x
)
;
if
(
as
)
{
if
(
as
)
{
void
*
ptr
;
void
*
ptr
;
...
@@ -71,7 +69,7 @@ asn_set_del(void *asn_set_of_x, int number, int _do_free) {
...
@@ -71,7 +69,7 @@ asn_set_del(void *asn_set_of_x, int number, int _do_free) {
*/
*/
void
void
asn_set_empty
(
void
*
asn_set_of_x
)
{
asn_set_empty
(
void
*
asn_set_of_x
)
{
asn_
set
*
as
=
(
asn_set
*
)
asn_set_of_x
;
asn_
anonymous_set_
*
as
=
_A_SET_FROM_VOID
(
asn_set_of_x
)
;
if
(
as
)
{
if
(
as
)
{
if
(
as
->
array
)
{
if
(
as
->
array
)
{
...
...
skeletons/asn_internal.h
View file @
7e033b54
...
@@ -80,4 +80,16 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; };
...
@@ -80,4 +80,16 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; };
if(cb(" ", 4, app_key) < 0) return -1; \
if(cb(" ", 4, app_key) < 0) return -1; \
} while(0)
} while(0)
/*
* Cope with implicit conversions to/from void.
*/
#include <asn_SET_OF.h>
#include <asn_SEQUENCE_OF.h>
typedef
A_SEQUENCE_OF
(
void
)
asn_anonymous_sequence_
;
typedef
A_SET_OF
(
void
)
asn_anonymous_set_
;
#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr))
#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr))
#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr))
#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr))
#endif
/* _ASN_INTERNAL_H_ */
#endif
/* _ASN_INTERNAL_H_ */
skeletons/constr_SEQUENCE_OF.c
View file @
7e033b54
...
@@ -14,7 +14,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
...
@@ -14,7 +14,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
int
tag_mode
,
ber_tlv_tag_t
tag
,
int
tag_mode
,
ber_tlv_tag_t
tag
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
asn_TYPE_member_t
*
elm
=
td
->
elements
;
asn_TYPE_member_t
*
elm
=
td
->
elements
;
A_SEQUENCE_OF
(
void
)
*
list
;
asn_anonymous_sequence_
*
list
=
_A_SEQUENCE_FROM_VOID
(
ptr
)
;
size_t
computed_size
=
0
;
size_t
computed_size
=
0
;
ssize_t
encoding_size
=
0
;
ssize_t
encoding_size
=
0
;
asn_enc_rval_t
erval
;
asn_enc_rval_t
erval
;
...
@@ -25,7 +25,6 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
...
@@ -25,7 +25,6 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
/*
/*
* Gather the length of the underlying members sequence.
* Gather the length of the underlying members sequence.
*/
*/
(
void
*
)
list
=
ptr
;
for
(
edx
=
0
;
edx
<
list
->
count
;
edx
++
)
{
for
(
edx
=
0
;
edx
<
list
->
count
;
edx
++
)
{
void
*
memb_ptr
=
list
->
array
[
edx
];
void
*
memb_ptr
=
list
->
array
[
edx
];
erval
=
elm
->
type
->
der_encoder
(
elm
->
type
,
memb_ptr
,
erval
=
elm
->
type
->
der_encoder
(
elm
->
type
,
memb_ptr
,
...
@@ -90,7 +89,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -90,7 +89,7 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
asn_enc_rval_t
er
;
asn_enc_rval_t
er
;
asn_SET_OF_specifics_t
*
specs
=
(
asn_SET_OF_specifics_t
*
)
td
->
specifics
;
asn_SET_OF_specifics_t
*
specs
=
(
asn_SET_OF_specifics_t
*
)
td
->
specifics
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
A_SEQUENCE_OF
(
void
)
*
list
;
asn_anonymous_sequence_
*
list
=
_A_SEQUENCE_FROM_VOID
(
sptr
)
;
const
char
*
mname
=
specs
->
as_XMLValueList
const
char
*
mname
=
specs
->
as_XMLValueList
?
0
:
((
*
element
->
name
)
?
0
:
((
*
element
->
name
)
?
element
->
name
:
element
->
type
->
xml_tag
);
?
element
->
name
:
element
->
type
->
xml_tag
);
...
@@ -102,7 +101,6 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -102,7 +101,6 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
er
.
encoded
=
0
;
er
.
encoded
=
0
;
(
void
*
)
list
=
sptr
;
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
asn_enc_rval_t
tmper
;
asn_enc_rval_t
tmper
;
...
...
skeletons/constr_SET_OF.c
View file @
7e033b54
...
@@ -212,8 +212,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -212,8 +212,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
switch
(
rval
.
code
)
{
switch
(
rval
.
code
)
{
case
RC_OK
:
case
RC_OK
:
{
{
A_SET_OF
(
void
)
*
list
;
asn_anonymous_set_
*
list
=
_A_SET_FROM_VOID
(
st
);
(
void
*
)
list
=
(
void
*
)
st
;
if
(
ASN_SET_ADD
(
list
,
ctx
->
ptr
)
!=
0
)
if
(
ASN_SET_ADD
(
list
,
ctx
->
ptr
)
!=
0
)
RETURN
(
RC_FAIL
);
RETURN
(
RC_FAIL
);
else
else
...
@@ -314,7 +313,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
...
@@ -314,7 +313,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
asn_TYPE_member_t
*
elm
=
td
->
elements
;
asn_TYPE_member_t
*
elm
=
td
->
elements
;
asn_TYPE_descriptor_t
*
elm_type
=
elm
->
type
;
asn_TYPE_descriptor_t
*
elm_type
=
elm
->
type
;
der_type_encoder_f
*
der_encoder
=
elm_type
->
der_encoder
;
der_type_encoder_f
*
der_encoder
=
elm_type
->
der_encoder
;
A_SET_OF
(
void
)
*
list
;
asn_anonymous_set_
*
list
=
_A_SET_FROM_VOID
(
ptr
)
;
size_t
computed_size
=
0
;
size_t
computed_size
=
0
;
ssize_t
encoding_size
=
0
;
ssize_t
encoding_size
=
0
;
struct
_el_buffer
*
encoded_els
;
struct
_el_buffer
*
encoded_els
;
...
@@ -328,7 +327,6 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
...
@@ -328,7 +327,6 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
/*
/*
* Gather the length of the underlying members sequence.
* Gather the length of the underlying members sequence.
*/
*/
(
void
*
)
list
=
ptr
;
for
(
edx
=
0
;
edx
<
list
->
count
;
edx
++
)
{
for
(
edx
=
0
;
edx
<
list
->
count
;
edx
++
)
{
void
*
memb_ptr
=
list
->
array
[
edx
];
void
*
memb_ptr
=
list
->
array
[
edx
];
erval
=
der_encoder
(
elm_type
,
memb_ptr
,
0
,
elm
->
tag
,
0
,
0
);
erval
=
der_encoder
(
elm_type
,
memb_ptr
,
0
,
elm
->
tag
,
0
,
0
);
...
@@ -516,8 +514,7 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
...
@@ -516,8 +514,7 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
element
->
type
,
&
ctx
->
ptr
,
elm_tag
,
element
->
type
,
&
ctx
->
ptr
,
elm_tag
,
buf_ptr
,
size
);
buf_ptr
,
size
);
if
(
tmprval
.
code
==
RC_OK
)
{
if
(
tmprval
.
code
==
RC_OK
)
{
A_SET_OF
(
void
)
*
list
;
asn_anonymous_set_
*
list
=
_A_SET_FROM_VOID
(
st
);
(
void
*
)
list
=
(
void
*
)
st
;
if
(
ASN_SET_ADD
(
list
,
ctx
->
ptr
)
!=
0
)
if
(
ASN_SET_ADD
(
list
,
ctx
->
ptr
)
!=
0
)
RETURN
(
RC_FAIL
);
RETURN
(
RC_FAIL
);
ctx
->
ptr
=
0
;
ctx
->
ptr
=
0
;
...
@@ -642,7 +639,7 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -642,7 +639,7 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
asn_enc_rval_t
er
;
asn_enc_rval_t
er
;
asn_SET_OF_specifics_t
*
specs
=
(
asn_SET_OF_specifics_t
*
)
td
->
specifics
;
asn_SET_OF_specifics_t
*
specs
=
(
asn_SET_OF_specifics_t
*
)
td
->
specifics
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
A_SET_OF
(
void
)
*
list
;
asn_anonymous_set_
*
list
=
_A_SET_FROM_VOID
(
sptr
)
;
const
char
*
mname
=
specs
->
as_XMLValueList
const
char
*
mname
=
specs
->
as_XMLValueList
?
0
:
((
*
element
->
name
)
?
0
:
((
*
element
->
name
)
?
element
->
name
:
element
->
type
->
xml_tag
);
?
element
->
name
:
element
->
type
->
xml_tag
);
...
@@ -656,8 +653,6 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -656,8 +653,6 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if
(
!
sptr
)
_ASN_ENCODE_FAILED
;
if
(
!
sptr
)
_ASN_ENCODE_FAILED
;
(
void
*
)
list
=
sptr
;
if
(
xcan
)
{
if
(
xcan
)
{
encs
=
(
xer_tmp_enc_t
*
)
MALLOC
(
list
->
count
*
sizeof
(
encs
[
0
]));
encs
=
(
xer_tmp_enc_t
*
)
MALLOC
(
list
->
count
*
sizeof
(
encs
[
0
]));
if
(
!
encs
)
_ASN_ENCODE_FAILED
;
if
(
!
encs
)
_ASN_ENCODE_FAILED
;
...
@@ -747,7 +742,7 @@ int
...
@@ -747,7 +742,7 @@ int
SET_OF_print
(
asn_TYPE_descriptor_t
*
td
,
const
void
*
sptr
,
int
ilevel
,
SET_OF_print
(
asn_TYPE_descriptor_t
*
td
,
const
void
*
sptr
,
int
ilevel
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
const
A_SET_OF
(
void
)
*
list
;
const
asn_anonymous_set_
*
list
=
_A_CSET_FROM_VOID
(
sptr
)
;
int
ret
;
int
ret
;
int
i
;
int
i
;
...
@@ -758,7 +753,6 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
...
@@ -758,7 +753,6 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
||
cb
(
" ::= {"
,
6
,
app_key
)
<
0
)
||
cb
(
" ::= {"
,
6
,
app_key
)
<
0
)
return
-
1
;
return
-
1
;
(
const
void
*
)
list
=
sptr
;
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
const
void
*
memb_ptr
=
list
->
array
[
i
];
const
void
*
memb_ptr
=
list
->
array
[
i
];
if
(
!
memb_ptr
)
continue
;
if
(
!
memb_ptr
)
continue
;
...
@@ -780,14 +774,13 @@ void
...
@@ -780,14 +774,13 @@ void
SET_OF_free
(
asn_TYPE_descriptor_t
*
td
,
void
*
ptr
,
int
contents_only
)
{
SET_OF_free
(
asn_TYPE_descriptor_t
*
td
,
void
*
ptr
,
int
contents_only
)
{
if
(
td
&&
ptr
)
{
if
(
td
&&
ptr
)
{
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
A_SET_OF
(
void
)
*
list
;
asn_anonymous_set_
*
list
=
_A_SET_FROM_VOID
(
ptr
)
;
int
i
;
int
i
;
/*
/*
* Could not use set_of_empty() because of (*free)
* Could not use set_of_empty() because of (*free)
* incompatibility.
* incompatibility.
*/
*/
(
void
*
)
list
=
ptr
;
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
{
void
*
memb_ptr
=
list
->
array
[
i
];
void
*
memb_ptr
=
list
->
array
[
i
];
if
(
memb_ptr
)
if
(
memb_ptr
)
...
@@ -808,7 +801,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
...
@@ -808,7 +801,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f
*
app_errlog
,
void
*
app_key
)
{
asn_app_consume_bytes_f
*
app_errlog
,
void
*
app_key
)
{
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_TYPE_member_t
*
element
=
td
->
elements
;
asn_constr_check_f
*
constr
;
asn_constr_check_f
*
constr
;
const
A_SET_OF
(
void
)
*
list
;
const
asn_anonymous_set_
*
list
=
_A_CSET_FROM_VOID
(
sptr
)
;
int
i
;
int
i
;
if
(
!
sptr
)
{
if
(
!
sptr
)
{
...
@@ -818,8 +811,6 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
...
@@ -818,8 +811,6 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return
-
1
;
return
-
1
;
}
}
(
const
void
*
)
list
=
sptr
;
constr
=
element
->
memb_constraints
;
constr
=
element
->
memb_constraints
;
if
(
!
constr
)
constr
=
element
->
type
->
check_constraints
;
if
(
!
constr
)
constr
=
element
->
type
->
check_constraints
;
...
...
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