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
33f63f83
Commit
33f63f83
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
calling conventions refactored
parent
d897416e
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
libasn1fix/asn1fix_retrieve.c
+21
-15
21 additions, 15 deletions
libasn1fix/asn1fix_retrieve.c
with
21 additions
and
15 deletions
libasn1fix/asn1fix_retrieve.c
+
21
−
15
View file @
33f63f83
#include
"asn1fix_internal.h"
#include
"asn1fix_internal.h"
static
asn1p_expr_t
*
asn1f_find_terminal_thing
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
type_or_value
);
enum
ftt_what
{
FTT_TYPE
,
/* Find the type of the given expression */
FTT_VALUE
,
/* Find the value of the given expression */
};
static
asn1p_expr_t
*
asn1f_find_terminal_thing
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
enum
ftt_what
);
static
int
asn1f_compatible_with_exports
(
arg_t
*
arg
,
asn1p_module_t
*
mod
,
const
char
*
name
);
static
int
asn1f_compatible_with_exports
(
arg_t
*
arg
,
asn1p_module_t
*
mod
,
const
char
*
name
);
...
@@ -290,37 +295,38 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
...
@@ -290,37 +295,38 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
asn1p_expr_t
*
asn1p_expr_t
*
asn1f_find_terminal_type
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
asn1f_find_terminal_type
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
return
asn1f_find_terminal_thing
(
arg
,
expr
,
0
);
return
asn1f_find_terminal_thing
(
arg
,
expr
,
FTT_TYPE
);
}
}
asn1p_expr_t
*
asn1p_expr_t
*
asn1f_find_terminal_value
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
asn1f_find_terminal_value
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
return
asn1f_find_terminal_thing
(
arg
,
expr
,
1
);
return
asn1f_find_terminal_thing
(
arg
,
expr
,
FTT_VALUE
);
}
}
static
asn1p_expr_t
*
static
asn1p_expr_t
*
asn1f_find_terminal_thing
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
type_or_value
)
{
asn1f_find_terminal_thing
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
enum
ftt_what
what
)
{
asn1p_ref_t
*
ref
;
asn1p_ref_t
*
ref
;
asn1p_expr_t
*
tc
;
asn1p_expr_t
*
tc
;
if
(
type_or_value
)
{
switch
(
what
)
{
/* VALUE */
case
FTT_TYPE
:
/* Expression may be a terminal type itself */
if
(
expr
->
expr_type
!=
A1TC_REFERENCE
)
return
expr
;
ref
=
expr
->
reference
;
break
;
case
FTT_VALUE
:
assert
(
expr
->
meta_type
==
AMT_VALUE
);
assert
(
expr
->
meta_type
==
AMT_VALUE
);
assert
(
expr
->
value
);
assert
(
expr
->
value
);
/* Expression may be a terminal type itself */
/* Expression may be a terminal type itself */
if
(
expr
->
value
->
type
!=
ATV_REFERENCED
)
if
(
expr
->
value
->
type
!=
ATV_REFERENCED
)
return
expr
;
return
expr
;
ref
=
expr
->
value
->
value
.
reference
;
ref
=
expr
->
value
->
value
.
reference
;
}
else
{
break
;
/* TYPE */
/* Expression may be a terminal type itself */
if
(
expr
->
expr_type
!=
A1TC_REFERENCE
)
return
expr
;
ref
=
expr
->
reference
;
}
}
DEBUG
(
"%s(%s->%s) for line %d"
,
DEBUG
(
"%s(%s->%s) for line %d"
,
type_or_value
?
"VALUE"
:
"TYPE"
,
(
what
==
FTT_VALUE
)
?
"VALUE"
:
"TYPE"
,
expr
->
Identifier
,
asn1f_printable_reference
(
ref
),
expr
->
Identifier
,
asn1f_printable_reference
(
ref
),
expr
->
_lineno
);
expr
->
_lineno
);
...
@@ -329,7 +335,7 @@ asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, int type_or_value) {
...
@@ -329,7 +335,7 @@ asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, int type_or_value) {
/*
/*
* Lookup inside the type itself (ENUMERATED, INTEGER, etc).
* Lookup inside the type itself (ENUMERATED, INTEGER, etc).
*/
*/
if
(
type_or_value
)
{
if
(
what
==
FTT_VALUE
)
{
asn1p_expr_t
*
val_type_tc
;
asn1p_expr_t
*
val_type_tc
;
val_type_tc
=
asn1f_find_terminal_type
(
arg
,
expr
);
val_type_tc
=
asn1f_find_terminal_type
(
arg
,
expr
);
if
(
val_type_tc
if
(
val_type_tc
...
@@ -365,7 +371,7 @@ asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, int type_or_value) {
...
@@ -365,7 +371,7 @@ asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, int type_or_value) {
tc
->
_mark
|=
TM_RECURSION
;
tc
->
_mark
|=
TM_RECURSION
;
WITH_MODULE
(
tc
->
module
,
WITH_MODULE
(
tc
->
module
,
expr
=
asn1f_find_terminal_thing
(
arg
,
tc
,
type_or_value
));
expr
=
asn1f_find_terminal_thing
(
arg
,
tc
,
what
));
tc
->
_mark
&=
~
TM_RECURSION
;
tc
->
_mark
&=
~
TM_RECURSION
;
return
expr
;
return
expr
;
...
...
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