blob: e88e432299973e1ce5a4a9c3a467e83005ba186d [file] [log] [blame]
vlmfa67ddc2004-06-03 03:38:44 +00001/*
2 * Miscellaneous functions necessary for several other modules.
3 */
4#ifndef _ASN1FIX_MISC_H_
5#define _ASN1FIX_MISC_H_
6
7/*
8 * Return a pointer to the locally held string with human-readable
9 * definition of the value.
10 */
11char const *asn1f_printable_value(asn1p_value_t *);
12
13/*
14 * Return a pointer to the locally held string with human-readable
15 * definition of the reference.
16 */
17char const *asn1f_printable_reference(asn1p_ref_t *);
18
19/*
20 * Recursively invoke a given function over the given expr and all its
21 * children.
22 */
23int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg));
24
25/*
26 * Check that every child of a given expr has unique name or does not have any.
27 * If opt_compare == NULL, the default comparison of the argument's
28 * names (identifiers) will be performed.
29 */
30int asn1f_check_unique_expr(arg_t *arg,
31 int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b));
32
33/*
34 * Check that every preceeding child of the given expr is not
35 * having the name of the given one.
36 * If opt_compare == NULL, the default comparison of the argument's
37 * names (identifiers) will be performed.
38 */
39int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child,
40 int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b));
41
42/*
43 * Return number of children.
44 */
45int asn1f_count_children(asn1p_expr_t *parent);
46
47#endif /* _ASN1FIX_MISC_H_ */