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
f1b4a5a1
Commit
f1b4a5a1
authored
Oct 01, 2021
by
Senthil Prabakaran
Committed by
Mouse
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for OPEN_TYPE
parent
c26794e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
skeletons/OPEN_TYPE.h
skeletons/OPEN_TYPE.h
+8
-0
skeletons/OPEN_TYPE_jer.c
skeletons/OPEN_TYPE_jer.c
+46
-0
No files found.
skeletons/OPEN_TYPE.h
View file @
f1b4a5a1
...
...
@@ -58,6 +58,14 @@ asn_dec_rval_t OPEN_TYPE_xer_get(
#define OPEN_TYPE_encode_xer CHOICE_encode_xer
#endif
/* !defined(ASN_DISABLE_XER_SUPPORT) */
if
!
defined
(
ASN_DISABLE_JER_SUPPORT
)
#define OPEN_TYPE_decode_jper NULL
asn_enc_rval_t
OPEN_TYPE_encode_jer
(
const
asn_TYPE_descriptor_t
*
type_descriptor
,
const
asn_per_constraints_t
*
constraints
,
const
void
*
struct_ptr
,
asn_per_outp_t
*
per_output
);
#endif
/* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
asn_dec_rval_t
OPEN_TYPE_oer_get
(
const
asn_codec_ctx_t
*
opt_codec_ctx
,
...
...
skeletons/OPEN_TYPE_jer.c
0 → 100644
View file @
f1b4a5a1
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <OPEN_TYPE.h>
#include <constr_CHOICE.h>
asn_enc_rval_t
OPEN_TYPE_encode_jer
(
const
asn_TYPE_descriptor_t
*
td
,
const
asn_per_constraints_t
*
constraints
,
const
void
*
sptr
,
asn_per_outp_t
*
po
)
{
const
void
*
memb_ptr
;
/* Pointer to the member */
asn_TYPE_member_t
*
elm
;
/* CHOICE's element */
asn_enc_rval_t
er
=
{
0
,
0
,
0
};
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
=
*
(
const
void
*
const
*
)((
const
char
*
)
sptr
+
elm
->
memb_offset
);
if
(
!
memb_ptr
)
ASN__ENCODE_FAILED
;
}
else
{
memb_ptr
=
(
const
char
*
)
sptr
+
elm
->
memb_offset
;
}
if
(
jer_open_type_put
(
elm
->
type
,
NULL
,
memb_ptr
,
po
)
<
0
)
{
ASN__ENCODE_FAILED
;
}
er
.
encoded
=
0
;
ASN__ENCODED_OK
(
er
);
}
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