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
ef8dd441
Commit
ef8dd441
authored
Sep 18, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print enumeration values for native integer in debug printouts
parent
3eeafe12
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
37 deletions
+48
-37
skeletons/NativeEnumerated.c
skeletons/NativeEnumerated.c
+25
-24
skeletons/NativeInteger.c
skeletons/NativeInteger.c
+23
-13
No files found.
skeletons/NativeEnumerated.c
View file @
ef8dd441
...
@@ -58,8 +58,8 @@ asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
...
@@ -58,8 +58,8 @@ asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
};
};
asn_enc_rval_t
asn_enc_rval_t
NativeEnumerated_encode_xer
(
asn_TYPE_descriptor_t
*
td
,
void
*
sptr
,
NativeEnumerated_encode_xer
(
asn_TYPE_descriptor_t
*
td
,
void
*
sptr
,
int
ilevel
,
int
ilevel
,
enum
xer_encoder_flags_e
flags
,
enum
xer_encoder_flags_e
flags
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
const
asn_INTEGER_specifics_t
*
specs
=
const
asn_INTEGER_specifics_t
*
specs
=
(
const
asn_INTEGER_specifics_t
*
)
td
->
specifics
;
(
const
asn_INTEGER_specifics_t
*
)
td
->
specifics
;
...
@@ -82,7 +82,8 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
...
@@ -82,7 +82,8 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if
(
cb
(
src
,
er
.
encoded
,
app_key
)
<
0
)
ASN__ENCODE_FAILED
;
if
(
cb
(
src
,
er
.
encoded
,
app_key
)
<
0
)
ASN__ENCODE_FAILED
;
ASN__ENCODED_OK
(
er
);
ASN__ENCODED_OK
(
er
);
}
else
{
}
else
{
ASN_DEBUG
(
"ASN.1 forbids dealing with "
ASN_DEBUG
(
"ASN.1 forbids dealing with "
"unknown value of ENUMERATED type"
);
"unknown value of ENUMERATED type"
);
ASN__ENCODE_FAILED
;
ASN__ENCODE_FAILED
;
}
}
...
...
skeletons/NativeInteger.c
View file @
ef8dd441
...
@@ -334,11 +334,21 @@ NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
...
@@ -334,11 +334,21 @@ NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
(
void
)
ilevel
;
/* Unused argument */
(
void
)
ilevel
;
/* Unused argument */
if
(
native
)
{
if
(
native
)
{
long
value
=
*
native
;
ret
=
snprintf
(
scratch
,
sizeof
(
scratch
),
ret
=
snprintf
(
scratch
,
sizeof
(
scratch
),
(
specs
&&
specs
->
field_unsigned
)
(
specs
&&
specs
->
field_unsigned
)
?
"%lu"
:
"%ld"
,
value
);
?
"%lu"
:
"%ld"
,
*
native
);
assert
(
ret
>
0
&&
(
size_t
)
ret
<
sizeof
(
scratch
));
assert
(
ret
>
0
&&
(
size_t
)
ret
<
sizeof
(
scratch
));
return
(
cb
(
scratch
,
ret
,
app_key
)
<
0
)
?
-
1
:
0
;
if
(
cb
(
scratch
,
ret
,
app_key
)
<
0
)
return
-
1
;
if
(
specs
&&
(
value
>=
0
||
!
specs
->
field_unsigned
))
{
const
asn_INTEGER_enum_map_t
*
el
=
INTEGER_map_value2enum
(
specs
,
value
);
if
(
el
)
{
if
(
cb
(
" ("
,
2
,
app_key
)
<
0
)
return
-
1
;
if
(
cb
(
el
->
enum_name
,
el
->
enum_len
,
app_key
)
<
0
)
return
-
1
;
if
(
cb
(
")"
,
1
,
app_key
)
<
0
)
return
-
1
;
}
}
return
0
;
}
else
{
}
else
{
return
(
cb
(
"<absent>"
,
8
,
app_key
)
<
0
)
?
-
1
:
0
;
return
(
cb
(
"<absent>"
,
8
,
app_key
)
<
0
)
?
-
1
:
0
;
}
}
...
...
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