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
d839785d
Commit
d839785d
authored
Oct 05, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add OER ENUMERATED in -fwide-types mode
parent
945958e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
18 deletions
+70
-18
skeletons/ENUMERATED.c
skeletons/ENUMERATED.c
+68
-18
skeletons/ENUMERATED.h
skeletons/ENUMERATED.h
+2
-0
No files found.
skeletons/ENUMERATED.c
View file @
d839785d
...
...
@@ -26,8 +26,8 @@ asn_TYPE_operation_t asn_OP_ENUMERATED = {
0
,
0
,
#else
0
,
0
,
ENUMERATED_decode_oer
,
ENUMERATED_encode_oer
,
#endif
/* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0
,
...
...
@@ -52,27 +52,75 @@ asn_TYPE_descriptor_t asn_DEF_ENUMERATED = {
0
/* No specifics */
};
#ifndef ASN_DISABLE_OER_SUPPORT
asn_dec_rval_t
ENUMERATED_decode_oer
(
const
asn_codec_ctx_t
*
opt_codec_ctx
,
asn_TYPE_descriptor_t
*
td
,
const
asn_oer_constraints_t
*
constraints
,
void
**
sptr
,
const
void
*
ptr
,
size_t
size
)
{
asn_dec_rval_t
rval
;
ENUMERATED_t
*
st
=
(
ENUMERATED_t
*
)
*
sptr
;
long
value
;
void
*
vptr
=
&
value
;
if
(
!
st
)
{
st
=
(
ENUMERATED_t
*
)(
*
sptr
=
CALLOC
(
1
,
sizeof
(
*
st
)));
if
(
!
st
)
ASN__DECODE_FAILED
;
}
rval
=
NativeEnumerated_decode_oer
(
opt_codec_ctx
,
td
,
constraints
,
(
void
**
)
&
vptr
,
ptr
,
size
);
if
(
rval
.
code
==
RC_OK
)
{
if
(
asn_long2INTEGER
(
st
,
value
))
{
rval
.
code
=
RC_FAIL
;
}
}
return
rval
;
}
asn_enc_rval_t
ENUMERATED_encode_oer
(
asn_TYPE_descriptor_t
*
td
,
const
asn_oer_constraints_t
*
constraints
,
void
*
sptr
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
ENUMERATED_t
*
st
=
(
ENUMERATED_t
*
)
sptr
;
long
value
;
if
(
asn_INTEGER2long
(
st
,
&
value
))
{
ASN__ENCODE_FAILED
;
}
return
NativeEnumerated_encode_oer
(
td
,
constraints
,
&
value
,
cb
,
app_key
);
}
#endif
/* ASN_DISABLE_OER_SUPPORT */
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
ENUMERATED_decode_uper
(
const
asn_codec_ctx_t
*
opt_codec_ctx
,
asn_TYPE_descriptor_t
*
td
,
const
asn_per_constraints_t
*
constraints
,
void
**
sptr
,
asn_per_data_t
*
pd
)
{
asn_dec_rval_t
rval
;
ENUMERATED_t
*
st
=
(
ENUMERATED_t
*
)
*
sptr
;
long
value
;
void
*
vptr
=
&
value
;
ENUMERATED_t
*
st
=
(
ENUMERATED_t
*
)
*
sptr
;
long
value
;
void
*
vptr
=
&
value
;
if
(
!
st
)
{
st
=
(
ENUMERATED_t
*
)(
*
sptr
=
CALLOC
(
1
,
sizeof
(
*
st
)));
if
(
!
st
)
ASN__DECODE_FAILED
;
if
(
!
st
)
{
st
=
(
ENUMERATED_t
*
)(
*
sptr
=
CALLOC
(
1
,
sizeof
(
*
st
)));
if
(
!
st
)
ASN__DECODE_FAILED
;
}
rval
=
NativeEnumerated_decode_uper
(
opt_codec_ctx
,
td
,
constraints
,
(
void
**
)
&
vptr
,
pd
);
if
(
rval
.
code
==
RC_OK
)
if
(
asn_long2INTEGER
(
st
,
value
))
rval
.
code
=
RC_FAIL
;
return
rval
;
rval
=
NativeEnumerated_decode_uper
(
opt_codec_ctx
,
td
,
constraints
,
(
void
**
)
&
vptr
,
pd
);
if
(
rval
.
code
==
RC_OK
)
{
if
(
asn_long2INTEGER
(
st
,
value
))
{
rval
.
code
=
RC_FAIL
;
}
}
return
rval
;
}
asn_enc_rval_t
...
...
@@ -80,11 +128,13 @@ ENUMERATED_encode_uper(asn_TYPE_descriptor_t *td,
const
asn_per_constraints_t
*
constraints
,
void
*
sptr
,
asn_per_outp_t
*
po
)
{
ENUMERATED_t
*
st
=
(
ENUMERATED_t
*
)
sptr
;
long
value
;
long
value
;
if
(
asn_INTEGER2long
(
st
,
&
value
))
ASN__ENCODE_FAILED
;
if
(
asn_INTEGER2long
(
st
,
&
value
))
{
ASN__ENCODE_FAILED
;
}
return
NativeEnumerated_encode_uper
(
td
,
constraints
,
&
value
,
po
);
return
NativeEnumerated_encode_uper
(
td
,
constraints
,
&
value
,
po
);
}
#endif
/* ASN_DISABLE_PER_SUPPORT */
skeletons/ENUMERATED.h
View file @
d839785d
...
...
@@ -16,6 +16,8 @@ typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */
extern
asn_TYPE_descriptor_t
asn_DEF_ENUMERATED
;
extern
asn_TYPE_operation_t
asn_OP_ENUMERATED
;
oer_type_decoder_f
ENUMERATED_decode_oer
;
oer_type_encoder_f
ENUMERATED_encode_oer
;
per_type_decoder_f
ENUMERATED_decode_uper
;
per_type_encoder_f
ENUMERATED_encode_uper
;
...
...
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