src
constr_SEQUENCE_print.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
3
* All rights reserved.
4
* Redistribution and modifications are permitted subject to BSD license.
5
*/
6
#include <
etsi_its_cpm_ts_coding/asn_internal.h
>
7
#include <
etsi_its_cpm_ts_coding/constr_SEQUENCE.h
>
8
9
int
10
SEQUENCE_print
(
const
asn_TYPE_descriptor_t
*td,
const
void
*sptr,
int
ilevel,
11
asn_app_consume_bytes_f
*cb,
void
*app_key) {
12
size_t
edx;
13
int
ret;
14
15
if
(!sptr)
return
(cb(
"<absent>"
, 8, app_key) < 0) ? -1 : 0;
16
17
/* Dump preamble */
18
if
(cb(td->
name
, strlen(td->
name
), app_key) < 0
19
|| cb(
" ::= {"
, 6, app_key) < 0)
20
return
-1;
21
22
for
(edx = 0; edx < td->
elements_count
; edx++) {
23
asn_TYPE_member_t
*elm = &td->
elements
[edx];
24
const
void
*memb_ptr;
25
26
if
(elm->
flags
&
ATF_POINTER
) {
27
memb_ptr = *(
const
void
*
const
*)((
const
char
*)sptr + elm->
memb_offset
);
28
if
(!memb_ptr) {
29
if
(elm->
optional
)
continue
;
30
/* Print <absent> line */
31
/* Fall through */
32
}
33
}
else
{
34
memb_ptr = (
const
void
*)((
const
char
*)sptr + elm->
memb_offset
);
35
}
36
37
/* Indentation */
38
_i_INDENT
(1);
39
40
/* Print the member's name and stuff */
41
if
(cb(elm->
name
, strlen(elm->
name
), app_key) < 0
42
|| cb(
": "
, 2, app_key) < 0)
43
return
-1;
44
45
/* Print the member itself */
46
ret = elm->
type
->
op
->
print_struct
(elm->
type
, memb_ptr, ilevel + 1,
47
cb, app_key);
48
if
(ret)
return
ret;
49
}
50
51
ilevel--;
52
_i_INDENT
(1);
53
54
return
(cb(
"}"
, 1, app_key) < 0) ? -1 : 0;
55
}
asn_TYPE_member_s::memb_offset
unsigned memb_offset
Definition:
constr_TYPE.h:275
asn_TYPE_descriptor_s::elements_count
unsigned elements_count
Definition:
constr_TYPE.h:253
asn_TYPE_descriptor_s::name
const char * name
Definition:
constr_TYPE.h:225
ATF_POINTER
@ ATF_POINTER
Definition:
constr_TYPE.h:268
asn_TYPE_descriptor_s
Definition:
constr_TYPE.h:224
asn_TYPE_member_s::type
asn_TYPE_descriptor_t * type
Definition:
constr_TYPE.h:278
SEQUENCE_print
int SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key)
Definition:
constr_SEQUENCE_print.c:10
asn_TYPE_member_s::name
const char * name
Definition:
constr_TYPE.h:283
asn_TYPE_descriptor_s::op
asn_TYPE_operation_t * op
Definition:
constr_TYPE.h:232
asn_TYPE_operation_s::print_struct
asn_struct_print_f * print_struct
Definition:
constr_TYPE.h:186
asn_app_consume_bytes_f
int() asn_app_consume_bytes_f(const void *buffer, size_t size, void *application_specific_key)
Definition:
asn_application.h:124
asn_internal.h
asn_TYPE_descriptor_s::elements
struct asn_TYPE_member_s * elements
Definition:
constr_TYPE.h:252
constr_SEQUENCE.h
_i_INDENT
#define _i_INDENT(nl)
Definition:
asn_internal.h:127
asn_TYPE_member_s
Definition:
constr_TYPE.h:272
asn_TYPE_member_s::flags
enum asn_TYPE_flags_e flags
Definition:
constr_TYPE.h:273
asn_TYPE_member_s::optional
unsigned optional
Definition:
constr_TYPE.h:274
etsi_its_cpm_ts_coding
Author(s): Jean-Pierre Busch
, Guido Küppers
, Lennart Reiher
autogenerated on Sun May 18 2025 02:22:37