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
c19e515f
Commit
c19e515f
authored
Feb 02, 2024
by
v0-e
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy: Add asn_copy() interface
parent
71b96b59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
skeletons/constr_TYPE.c
skeletons/constr_TYPE.c
+20
-0
skeletons/constr_TYPE.h
skeletons/constr_TYPE.h
+11
-0
No files found.
skeletons/constr_TYPE.c
View file @
c19e515f
...
...
@@ -54,6 +54,26 @@ asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td,
return
fflush
(
stream
);
}
/*
* Copy a structuture.
*/
int
asn_copy
(
const
asn_TYPE_descriptor_t
*
td
,
void
**
struct_dst
,
const
void
*
struct_src
)
{
if
(
!
td
||
!
struct_dst
||
!
struct_src
)
{
errno
=
EINVAL
;
return
-
1
;
}
if
(
!
td
->
op
)
{
errno
=
ENOSYS
;
return
-
1
;
}
return
td
->
op
->
copy_struct
(
td
,
struct_dst
,
struct_src
);
}
/* Dump the data into the specified stdio stream */
static
int
_print2fp
(
const
void
*
buffer
,
size_t
size
,
void
*
app_key
)
{
...
...
skeletons/constr_TYPE.h
View file @
c19e515f
...
...
@@ -302,6 +302,17 @@ int asn_fprint(FILE *stream, /* Destination stream descriptor */
const
asn_TYPE_descriptor_t
*
td
,
/* ASN.1 type descriptor */
const
void
*
struct_ptr
);
/* Structure to be printed */
/*
* Copies a source structure (struct_src) into destination structure
* (struct_dst). Allocates memory for the destination structure, if necessary.
* RETURN VALUES:
* 0: Copy OK.
* -1: Problem copying the structure.
*/
int
asn_copy
(
const
asn_TYPE_descriptor_t
*
td
,
/* ASN.1 type descriptor */
void
**
struct_dst
,
/* Structure to be populated */
const
void
*
struct_src
);
/* Structure to be copied */
#ifdef __cplusplus
}
#endif
...
...
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