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
35ace19d
Commit
35ace19d
authored
Aug 26, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uper-encode open type
parent
7bb9d5b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
skeletons/OPEN_TYPE.c
skeletons/OPEN_TYPE.c
+39
-0
skeletons/OPEN_TYPE.h
skeletons/OPEN_TYPE.h
+4
-1
No files found.
skeletons/OPEN_TYPE.c
View file @
35ace19d
...
...
@@ -258,4 +258,43 @@ OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx,
return
rv
;
}
asn_enc_rval_t
OPEN_TYPE_encode_uper
(
asn_TYPE_descriptor_t
*
td
,
const
asn_per_constraints_t
*
constraints
,
void
*
sptr
,
asn_per_outp_t
*
po
)
{
asn_type_selector_result_t
selected
;
void
*
memb_ptr
;
/* Pointer to the member */
asn_TYPE_member_t
*
elm
;
/* CHOICE's element */
asn_enc_rval_t
er
;
unsigned
present
;
(
void
)
constraints
;
present
=
CHOICE_variant_get_presence
(
td
,
sptr
);
if
(
present
==
0
||
present
>
td
->
elements_count
)
{
ASN__ENCODE_FAILED
;
}
else
{
present
--
;
}
ASN_DEBUG
(
"Encoding %s OPEN TYPE element %d"
,
td
->
name
,
present
);
elm
=
&
td
->
elements
[
present
];
if
(
elm
->
flags
&
ATF_POINTER
)
{
/* Member is a pointer to another structure */
memb_ptr
=
*
(
void
**
)((
char
*
)
sptr
+
elm
->
memb_offset
);
if
(
!
memb_ptr
)
ASN__ENCODE_FAILED
;
}
else
{
memb_ptr
=
(
char
*
)
sptr
+
elm
->
memb_offset
;
}
if
(
uper_open_type_put
(
elm
->
type
,
NULL
,
memb_ptr
,
po
)
<
0
)
{
ASN__ENCODE_FAILED
;
}
er
.
encoded
=
0
;
ASN__ENCODED_OK
(
er
);
}
#endif
/* ASN_DISABLE_PER_SUPPORT */
skeletons/OPEN_TYPE.h
View file @
35ace19d
...
...
@@ -20,7 +20,6 @@ extern "C" {
#define OPEN_TYPE_decode_xer NULL
#define OPEN_TYPE_encode_xer CHOICE_encode_xer
#define OPEN_TYPE_decode_uper NULL
#define OPEN_TYPE_encode_uper CHOICE_encode_uper
extern
asn_TYPE_operation_t
asn_OP_OPEN_TYPE
;
...
...
@@ -46,6 +45,10 @@ asn_dec_rval_t OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_member_t
*
element
,
asn_per_data_t
*
pd
);
asn_enc_rval_t
OPEN_TYPE_encode_uper
(
asn_TYPE_descriptor_t
*
type_descriptor
,
const
asn_per_constraints_t
*
constraints
,
void
*
struct_ptr
,
asn_per_outp_t
*
per_output
);
#ifdef __cplusplus
}
...
...
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