Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Miscellaneous functions necessary for several other modules. |
| 3 | */ |
Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 4 | #ifndef ASN1FIX_MISC_H |
| 5 | #define ASN1FIX_MISC_H |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 6 | |
| 7 | /* |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | * Recursively invoke a given function over the given expr and all its |
| 9 | * children. |
| 10 | */ |
| 11 | int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg)); |
| 12 | |
| 13 | /* |
Lev Walkin | fbfc7bc | 2006-08-28 02:45:44 +0000 | [diff] [blame] | 14 | * Check that every child of a given expr has unique identifier. |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 15 | */ |
Lev Walkin | fbfc7bc | 2006-08-28 02:45:44 +0000 | [diff] [blame] | 16 | int asn1f_check_unique_expr(arg_t *arg); |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 17 | |
| 18 | /* |
| 19 | * Check that every preceeding child of the given expr is not |
| 20 | * having the name of the given one. |
| 21 | * If opt_compare == NULL, the default comparison of the argument's |
| 22 | * names (identifiers) will be performed. |
| 23 | */ |
| 24 | int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, |
Lev Walkin | fbfc7bc | 2006-08-28 02:45:44 +0000 | [diff] [blame] | 25 | int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b), |
| 26 | const char *opt_property_name); |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 27 | |
| 28 | /* |
| 29 | * Return number of children. |
| 30 | */ |
| 31 | int asn1f_count_children(asn1p_expr_t *parent); |
| 32 | |
Lev Walkin | 97bdee2 | 2004-06-28 21:21:24 +0000 | [diff] [blame] | 33 | /* |
| 34 | * Check if type is explicitly known. |
| 35 | */ |
| 36 | int asn1f_check_known_external_type(const char *); |
| 37 | |
Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 38 | #endif /* ASN1FIX_MISC_H */ |