prefixing of generated types using a ASN1C_PREFIX environment variable
When generating code for multiple ASN.1 syntaxes that have clashing
names, we need to add a prefix in order to prevent clashes in the global
C symbol namespace. Using the ASN1C_PREFIX environment variable and
this patch serves as a work-around to that. All non-basic type names
as well as references to that type and source code + header file names
will be pre-fixed accordingly.
diff --git a/libasn1compiler/asn1c_misc.h b/libasn1compiler/asn1c_misc.h
index ee88cb1..4489ae1 100644
--- a/libasn1compiler/asn1c_misc.h
+++ b/libasn1compiler/asn1c_misc.h
@@ -10,6 +10,7 @@
AMI_MASK_ONLY_SPACES = 1, /* Mask only spaces, everything else's safe */
AMI_CHECK_RESERVED = 2, /* Check against reserved keywords */
AMI_NODELIMITER = 4, /* Do not put delimiter, just concatenate */
+ AMI_USE_PREFIX = 8, /* Use Prefix when generating identifier */
};
char *asn1c_make_identifier(enum ami_flags_e, asn1p_expr_t *expr, ...);