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
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
oai
asn1c
Commits
e8e87f14
Commit
e8e87f14
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
explain practical constraints too
parent
e422e68b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libasn1print/asn1print.c
+18
-7
18 additions, 7 deletions
libasn1print/asn1print.c
with
18 additions
and
7 deletions
libasn1print/asn1print.c
+
18
−
7
View file @
e8e87f14
...
...
@@ -366,14 +366,21 @@ asn1print_crange_value(asn1cnst_edge_t *edge, int as_char) {
}
static
int
asn1print_constraint_explain_type
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
,
enum
asn1p_constraint_type_e
type
)
{
asn1print_constraint_explain_type
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
,
enum
asn1p_constraint_type_e
type
,
int
strict_PER_visible
)
{
asn1cnst_range_t
*
range
;
int
as_char
=
(
type
==
ACT_CT_FROM
);
int
i
;
range
=
asn1constraint_compute_PER_range
(
expr_type
,
ct
,
type
,
0
,
0
);
range
=
asn1constraint_compute_PER_range
(
expr_type
,
ct
,
type
,
0
,
0
,
strict_PER_visible
);
if
(
!
range
)
return
-
1
;
if
(
range
->
incompatible
||
(
strict_PER_visible
&&
range
->
not_PER_visible
))
{
asn1constraint_range_free
(
range
);
return
0
;
}
switch
(
type
)
{
case
ACT_CT_FROM
:
printf
(
"(FROM("
);
break
;
case
ACT_CT_SIZE
:
printf
(
"(SIZE("
);
break
;
...
...
@@ -410,13 +417,13 @@ asn1print_constraint_explain_type(asn1p_expr_type_e expr_type, asn1p_constraint_
static
int
asn1print_constraint_explain
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
)
{
asn1p_constraint_t
*
ct
,
int
s_PV
)
{
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_EL_RANGE
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_EL_RANGE
,
s_PV
);
printf
(
" "
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_SIZE
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_SIZE
,
s_PV
);
printf
(
" "
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_FROM
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_FROM
,
s_PV
);
return
0
;
}
...
...
@@ -564,10 +571,14 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
top_parent
=
asn1f_find_terminal_type_ex
(
asn
,
mod
,
tc
);
if
(
top_parent
)
{
printf
(
"
\n
-- Practical constraints (%s): "
,
top_parent
->
Identifier
);
asn1print_constraint_explain
(
top_parent
->
expr_type
,
tc
->
combined_constraints
,
0
);
printf
(
"
\n
-- PER-visible constraints (%s): "
,
top_parent
->
Identifier
);
asn1print_constraint_explain
(
top_parent
->
expr_type
,
tc
->
combined_constraints
);
tc
->
combined_constraints
,
1
);
}
printf
(
"
\n
"
);
}
...
...
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