1 #ifndef ASN1_COMPILER_MISC_H
2 #define ASN1_COMPILER_MISC_H
5 * Make the target language identifier out of one or more names.
6 * The function will concatenate the names and replace unsafe characters
10 AMI_MASK_ONLY_SPACES = 1, /* Mask only spaces, everything else's safe */
11 AMI_CHECK_RESERVED = 2, /* Check against reserved keywords */
12 AMI_NODELIMITER = 4, /* Do not put delimiter, just concatenate */
13 AMI_USE_PREFIX = 8, /* Use Prefix when generating identifier */
15 const char *asn1c_make_identifier(enum ami_flags_e, asn1p_expr_t *expr, ...);
18 * Return the type name of the specified expression.
19 * The returned string is a pointer to a statically allocated buffer which is
20 * going to be clobbered by the subsequent invocation of this function.
23 TNF_UNMODIFIED = 0x10, /* Return unmodified type name */
24 TNF_INCLUDE = 0x20, /* Format for #include <> */
25 TNF_CTYPE = 0x30, /* Format as normal C-ish type (append "_t") */
26 TNF_CONSTYPE = 0x40, /* Replace unsafe characters with _ */
27 TNF_SAFE = 0x50, /* Replace unsafe characters with _ */
28 TNF_RSAFE = 0x60, /* Recursion-safe C type format */
30 const char *asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format);
33 * Check whether the specified INTEGER or ENUMERATED type can be represented
34 * using the generic 'long' type.
36 * FL_NOTFIT: No, it cannot be represented using long.
37 * FL_FITS_SIGNED: It can be represented using signed long.
38 * FL_FITS_UNSIGN: It can be represented using unsigned long.
39 * FL_PRESUMED: Probably can't, but -fwide-types is not in effect.
41 enum asn1c_fitslong_e {
47 enum asn1c_fitslong_e asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr);
49 enum asn1c_fitsfloat_e {
54 enum asn1c_fitsfloat_e asn1c_REAL_fits(arg_t *arg, asn1p_expr_t *expr);
55 const char *asn1c_prefix(void);
57 #endif /* ASN1_COMPILER_MISC_H */