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
cf573ec1
Commit
cf573ec1
authored
7 years ago
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
constness
parent
ec4b7af9
vlm_master
velichkov_s1ap_plus_option_group
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
17 deletions
+42
-17
doc/docsrc/asn_dec_rval.inc
doc/docsrc/asn_dec_rval.inc
+23
-0
skeletons/constr_TYPE.c
skeletons/constr_TYPE.c
+14
-11
skeletons/constr_TYPE.h
skeletons/constr_TYPE.h
+5
-6
No files found.
doc/docsrc/asn_dec_rval.inc
0 → 100644
View file @
cf573ec1
The
return
value
is
returned
in
a
compound
structure
:
\begin
{
codesample
}
typedef
struct
{
enum
{
RC_OK
,
/* Decoded successfully */
RC_WMORE
,
/* More data expected, call again */
RC_FAIL
/* Failure to decode data */
}
code
;
/* Result code */
size_t
consumed
;
/* Number of bytes consumed */
}
asn_dec_rval_t
;
\end
{
codesample
}
The
\code
{
.
code
}
member
specifies
the
decoding
outcome
.
\begin
{
description
}[
labelindent
=
\parindent
]
\item
[
RC\_OK
]
Decoded
successfully
and
completely
\item
[
RC\_WMORE
]
More
data
expected
,
call
again
\item
[
RC\_FAIL
]
Failed
for
good
\end
{
description
}
The
\code
{
.
consumed
}
member
specifies
the
amount
of
\code
{
buffer
}
data
that
was
used
during
parsing
,
irrespectively
of
the
\code
{
.
code
}
.
This diff is collapsed.
Click to expand it.
skeletons/constr_TYPE.c
View file @
cf573ec1
...
@@ -33,22 +33,25 @@ asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
...
@@ -33,22 +33,25 @@ asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
* Print the target language's structure in human readable form.
* Print the target language's structure in human readable form.
*/
*/
int
int
asn_fprint
(
FILE
*
stream
,
asn_TYPE_descriptor_t
*
td
,
const
void
*
struct_ptr
)
{
asn_fprint
(
FILE
*
stream
,
const
asn_TYPE_descriptor_t
*
td
,
if
(
!
stream
)
stream
=
stdout
;
const
void
*
struct_ptr
)
{
if
(
!
td
||
!
struct_ptr
)
{
if
(
!
stream
)
stream
=
stdout
;
errno
=
EINVAL
;
if
(
!
td
||
!
struct_ptr
)
{
return
-
1
;
errno
=
EINVAL
;
return
-
1
;
}
}
/* Invoke type-specific printer */
/* Invoke type-specific printer */
if
(
td
->
op
->
print_struct
(
td
,
struct_ptr
,
1
,
_print2fp
,
stream
))
if
(
td
->
op
->
print_struct
(
td
,
struct_ptr
,
1
,
_print2fp
,
stream
))
{
return
-
1
;
return
-
1
;
}
/* Terminate the output */
/* Terminate the output */
if
(
_print2fp
(
"
\n
"
,
1
,
stream
))
if
(
_print2fp
(
"
\n
"
,
1
,
stream
))
{
return
-
1
;
return
-
1
;
}
return
fflush
(
stream
);
return
fflush
(
stream
);
}
}
/* Dump the data into the specified stdio stream */
/* Dump the data into the specified stdio stream */
...
...
This diff is collapsed.
Click to expand it.
skeletons/constr_TYPE.h
View file @
cf573ec1
...
@@ -242,17 +242,16 @@ typedef struct asn_TYPE_tag2member_s {
...
@@ -242,17 +242,16 @@ typedef struct asn_TYPE_tag2member_s {
}
asn_TYPE_tag2member_t
;
}
asn_TYPE_tag2member_t
;
/*
/*
* This function is a wrapper around (td)->print_struct, which prints out
* This function prints out the contents of the target language's structure
* the contents of the target language's structure (struct_ptr) into the
* (struct_ptr) into the file pointer (stream) in human readable form.
* file pointer (stream) in human readable form.
* RETURN VALUES:
* RETURN VALUES:
* 0: The structure is printed.
* 0: The structure is printed.
* -1: Problem dumping the structure.
* -1: Problem dumping the structure.
* (See also xer_fprint() in xer_encoder.h)
* (See also xer_fprint() in xer_encoder.h)
*/
*/
int
asn_fprint
(
FILE
*
stream
,
/* Destination stream descriptor */
int
asn_fprint
(
FILE
*
stream
,
/* Destination stream descriptor */
asn_TYPE_descriptor_t
*
td
,
/* ASN.1 type descriptor */
const
asn_TYPE_descriptor_t
*
td
,
/* ASN.1 type descriptor */
const
void
*
struct_ptr
);
/* Structure to be printed */
const
void
*
struct_ptr
);
/* Structure to be printed */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
This diff is collapsed.
Click to expand it.
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