blob: 0114d4938abfc0dda8ebca47c5db285afcb554cf [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*
2 * Miscellaneous functions necessary for several other modules.
3 */
Lev Walkinc6cac8e2016-03-14 02:57:07 -07004#ifndef ASN1FIX_MISC_H
5#define ASN1FIX_MISC_H
Lev Walkinf15320b2004-06-03 03:38:44 +00006
7/*
Lev Walkinf15320b2004-06-03 03:38:44 +00008 * Recursively invoke a given function over the given expr and all its
9 * children.
10 */
11int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg));
12
13/*
Lev Walkinfbfc7bc2006-08-28 02:45:44 +000014 * Check that every child of a given expr has unique identifier.
Lev Walkinf15320b2004-06-03 03:38:44 +000015 */
Lev Walkinfbfc7bc2006-08-28 02:45:44 +000016int asn1f_check_unique_expr(arg_t *arg);
Lev Walkinf15320b2004-06-03 03:38:44 +000017
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 */
24int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child,
Lev Walkinfbfc7bc2006-08-28 02:45:44 +000025 int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b),
26 const char *opt_property_name);
Lev Walkinf15320b2004-06-03 03:38:44 +000027
28/*
29 * Return number of children.
30 */
31int asn1f_count_children(asn1p_expr_t *parent);
32
Lev Walkin97bdee22004-06-28 21:21:24 +000033/*
34 * Check if type is explicitly known.
35 */
36int asn1f_check_known_external_type(const char *);
37
Lev Walkinc6cac8e2016-03-14 02:57:07 -070038#endif /* ASN1FIX_MISC_H */