diff options
Diffstat (limited to 'libasn1fix/asn1fix_misc.h')
-rw-r--r-- | libasn1fix/asn1fix_misc.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libasn1fix/asn1fix_misc.h b/libasn1fix/asn1fix_misc.h new file mode 100644 index 00000000..e88e4322 --- /dev/null +++ b/libasn1fix/asn1fix_misc.h @@ -0,0 +1,47 @@ +/* + * Miscellaneous functions necessary for several other modules. + */ +#ifndef _ASN1FIX_MISC_H_ +#define _ASN1FIX_MISC_H_ + +/* + * Return a pointer to the locally held string with human-readable + * definition of the value. + */ +char const *asn1f_printable_value(asn1p_value_t *); + +/* + * Return a pointer to the locally held string with human-readable + * definition of the reference. + */ +char const *asn1f_printable_reference(asn1p_ref_t *); + +/* + * Recursively invoke a given function over the given expr and all its + * children. + */ +int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg)); + +/* + * Check that every child of a given expr has unique name or does not have any. + * If opt_compare == NULL, the default comparison of the argument's + * names (identifiers) will be performed. + */ +int asn1f_check_unique_expr(arg_t *arg, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); + +/* + * Check that every preceeding child of the given expr is not + * having the name of the given one. + * If opt_compare == NULL, the default comparison of the argument's + * names (identifiers) will be performed. + */ +int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); + +/* + * Return number of children. + */ +int asn1f_count_children(asn1p_expr_t *parent); + +#endif /* _ASN1FIX_MISC_H_ */ |