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
55fdd998
Commit
55fdd998
authored
Jun 29, 2007
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple version of open type decoder completed
parent
375f0e98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
skeletons/per_opentype.c
skeletons/per_opentype.c
+22
-3
No files found.
skeletons/per_opentype.c
View file @
55fdd998
...
...
@@ -18,6 +18,8 @@ static int uper_ugot_refill(asn_per_data_t *pd);
static
int
per_skip_bits
(
asn_per_data_t
*
pd
,
int
skip_nbits
);
static
asn_dec_rval_t
uper_sot_suck
(
asn_codec_ctx_t
*
,
asn_TYPE_descriptor_t
*
td
,
asn_per_constraints_t
*
constraints
,
void
**
sptr
,
asn_per_data_t
*
pd
);
int
asn_debug_indent
;
/*
* Encode an "open type field".
* #10.1, #10.2
...
...
@@ -61,10 +63,11 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
size_t
bufLen
=
0
;
size_t
bufSize
=
0
;
asn_per_data_t
spd
;
size_t
padding
;
_ASN_STACK_OVERFLOW_CHECK
(
ctx
);
ASN_DEBUG
(
"Getting open type %s from %s"
,
td
->
name
,
ASN_DEBUG
(
"Getting open type %s from %s
...
"
,
td
->
name
,
per_data_string
(
pd
));
do
{
...
...
@@ -90,14 +93,30 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
bufLen
+=
chunk_bytes
;
}
while
(
repeat
);
ASN_DEBUG
(
"Getting open type %s encoded in %d bytes"
,
td
->
name
,
bufLen
);
memset
(
&
spd
,
0
,
sizeof
(
spd
));
spd
.
buffer
=
buf
;
spd
.
nbits
=
bufLen
<<
3
;
asn_debug_indent
+=
4
;
rv
=
td
->
uper_decoder
(
ctx
,
td
,
constraints
,
sptr
,
&
spd
);
asn_debug_indent
-=
4
;
FREEMEM
(
buf
);
/* Check padding validity */
padding
=
spd
.
nbits
-
spd
.
nboff
;
if
(
padding
>=
8
)
{
ASN_DEBUG
(
"Too large padding %d in open type"
,
padding
);
_ASN_DECODE_FAILED
;
}
else
if
(
per_get_few_bits
(
&
spd
,
padding
))
{
/* Can't be "no more data", then it's non-zero padding */
ASN_DEBUG
(
"Non-zero padding"
);
_ASN_DECODE_FAILED
;
}
return
rv
;
}
...
...
@@ -121,9 +140,9 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
pd
->
nbits
=
pd
->
nboff
;
/* 0 good bits at this point, will refill */
pd
->
moved
=
0
;
/* This now counts the open type size in bits */
/*asn_debug_indent += 4;*/
asn_debug_indent
+=
4
;
rv
=
td
->
uper_decoder
(
ctx
,
td
,
constraints
,
sptr
,
pd
);
/*asn_debug_indent -= 4;*/
asn_debug_indent
-=
4
;
#define UPDRESTOREPD do { \
/* buffer and nboff are valid, preserve them. */
\
...
...
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