vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Miscellaneous functions necessary for several other modules. |
| 3 | */ |
| 4 | #ifndef _ASN1FIX_MISC_H_ |
| 5 | #define _ASN1FIX_MISC_H_ |
| 6 | |
| 7 | /* |
vlm | fa67ddc | 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 | /* |
| 14 | * Check that every child of a given expr has unique name or does not have any. |
| 15 | * If opt_compare == NULL, the default comparison of the argument's |
| 16 | * names (identifiers) will be performed. |
| 17 | */ |
| 18 | int asn1f_check_unique_expr(arg_t *arg, |
| 19 | int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); |
| 20 | |
| 21 | /* |
| 22 | * Check that every preceeding child of the given expr is not |
| 23 | * having the name of the given one. |
| 24 | * If opt_compare == NULL, the default comparison of the argument's |
| 25 | * names (identifiers) will be performed. |
| 26 | */ |
| 27 | int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, |
| 28 | int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); |
| 29 | |
| 30 | /* |
| 31 | * Return number of children. |
| 32 | */ |
| 33 | int asn1f_count_children(asn1p_expr_t *parent); |
| 34 | |
vlm | d9cd3f9 | 2004-06-28 21:21:24 +0000 | [diff] [blame] | 35 | /* |
| 36 | * Check if type is explicitly known. |
| 37 | */ |
| 38 | int asn1f_check_known_external_type(const char *); |
| 39 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 40 | #endif /* _ASN1FIX_MISC_H_ */ |