Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qwebaby3
asn1c
Commits
f55a6dde
Commit
f55a6dde
authored
17 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
encoding per sequence
parent
62258e25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
asn1c/tests/check-126.-gen-PER.c
+6
-6
6 additions, 6 deletions
asn1c/tests/check-126.-gen-PER.c
asn1c/tests/data-126/data-126-01.out
+0
-0
0 additions, 0 deletions
asn1c/tests/data-126/data-126-01.out
skeletons/constr_SEQUENCE.c
+10
-4
10 additions, 4 deletions
skeletons/constr_SEQUENCE.c
with
16 additions
and
10 deletions
asn1c/tests/check-126.-gen-PER.c
+
6
−
6
View file @
f55a6dde
...
...
@@ -224,8 +224,12 @@ compare_with_data_out(const char *fname, char *buf, int size) {
fprintf
(
stderr
,
"Comparing PER output with [%s]
\n
"
,
outName
);
f
=
fopen
(
outName
,
"r"
);
if
(
f
)
{
if
(
getenv
(
"REGENERATE"
))
{
f
=
fopen
(
outName
,
"w"
);
fwrite
(
buf
,
1
,
size
,
f
);
fclose
(
f
);
}
else
{
f
=
fopen
(
outName
,
"r"
);
assert
(
f
);
rd
=
fread
(
fbuf
,
1
,
sizeof
(
fbuf
),
f
);
assert
(
rd
);
...
...
@@ -234,10 +238,6 @@ compare_with_data_out(const char *fname, char *buf, int size) {
assert
(
rd
==
size
);
assert
(
memcmp
(
fbuf
,
buf
,
rd
)
==
0
);
fprintf
(
stderr
,
"XER->PER recoding .in->.out match.
\n
"
);
}
else
if
(
getenv
(
"REGENERATE"
))
{
f
=
fopen
(
outName
,
"w"
);
fwrite
(
buf
,
1
,
size
,
f
);
fclose
(
f
);
}
}
...
...
This diff is collapsed.
Click to expand it.
asn1c/tests/data-126/data-126-01.out
0 → 100644
+
0
−
0
View file @
f55a6dde
File added
This diff is collapsed.
Click to expand it.
skeletons/constr_SEQUENCE.c
+
10
−
4
View file @
f55a6dde
...
...
@@ -1170,9 +1170,11 @@ uper_put_open_type(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints
void
*
buf
;
ssize_t
size
;
ASN_DEBUG
(
"Encoding as open type %s"
,
td
->
name
);
size
=
uper_encode_to_new_buffer
(
td
,
constraints
,
sptr
,
&
buf
);
if
(
size
<=
0
)
return
-
1
;
ASN_DEBUG
(
"Putting %s of length %d"
,
td
->
name
,
size
);
while
(
size
)
{
ssize_t
maySave
=
uper_put_length
(
po
,
size
);
if
(
maySave
<
0
)
break
;
...
...
@@ -1194,7 +1196,8 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
asn_per_outp_t
*
po1
,
asn_per_outp_t
*
po2
)
{
asn_SEQUENCE_specifics_t
*
specs
=
(
asn_SEQUENCE_specifics_t
*
)
td
->
specifics
;
int
num
=
0
;
int
exts_present
=
0
;
int
exts_count
=
0
;
int
edx
;
if
(
specs
->
ext_before
<
0
)
...
...
@@ -1207,8 +1210,10 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
void
**
memb_ptr2
;
/* Pointer to that pointer */
int
present
;
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
ASN_DEBUG
(
"%d is not extension"
,
edx
);
continue
;
}
/* Fetch the pointer to this member */
if
(
elm
->
flags
&
ATF_POINTER
)
{
...
...
@@ -1221,7 +1226,8 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
}
ASN_DEBUG
(
"checking ext %d is present => %d"
,
edx
,
present
);
num
+=
present
;
exts_count
++
;
exts_present
+=
present
;
/* Encode as presence marker */
if
(
po1
&&
per_put_few_bits
(
po1
,
present
,
1
))
...
...
@@ -1233,7 +1239,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
}
return
num
;
return
exts_present
?
exts_count
:
0
;
}
asn_enc_rval_t
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment