checking reserved keywords and double identifiers
diff --git a/libasn1compiler/asn1c_misc.h b/libasn1compiler/asn1c_misc.h
index 325892a..c653fa8 100644
--- a/libasn1compiler/asn1c_misc.h
+++ b/libasn1compiler/asn1c_misc.h
@@ -6,17 +6,23 @@
* The function will concatenate the names and replace unsafe characters
* with safe ones.
*/
-char *asn1c_make_identifier(int unsafe_only_spaces, char *arg1, ...);
+enum ami_flags_e {
+ AMI_MASK_ONLY_SPACES = 1, /* Mask only spaces, everything else's safe */
+ AMI_CHECK_RESERVED = 2, /* Check against reserved keywords */
+};
+char *asn1c_make_identifier(enum ami_flags_e, char *arg1, ...);
/*
* Return the type name of the specified expression.
*/
enum tnfmt {
- TNF_UNMODIFIED, /* Return unmodified type name */
- TNF_INCLUDE, /* Format for #include <> */
- TNF_CTYPE, /* Format as normal C-ish type (append "_t") */
- TNF_SAFE, /* Replace unsafe characters with _ */
- TNF_RSAFE, /* Recursion-safe C type format */
+ TNF_NORCHECK = 0x00,
+ TNF_CHECK = 0x01,
+ TNF_UNMODIFIED = 0x10, /* Return unmodified type name */
+ TNF_INCLUDE = 0x20, /* Format for #include <> */
+ TNF_CTYPE = 0x30, /* Format as normal C-ish type (append "_t") */
+ TNF_SAFE = 0x40, /* Replace unsafe characters with _ */
+ TNF_RSAFE = 0x50, /* Recursion-safe C type format */
};
char *asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format);