mouse07410 / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
101 stars 73 forks source link

Add -fprefix as an option #170

Closed v0-e closed 10 months ago

v0-e commented 10 months ago

Adds an optional argument -fprefix=<PREFIX> to the compiler, allowing the user to specify a prefix to be added to generated types.

This is a rather useful feature in applications which need to use different ASN.1 definitions with identical names. The functionality was already there, though was undocumented. It could be used by setting the environment variable ASN1C_PREFIX.

I've left the environment variable setting still possible, however the new optional argument takes precedence.

velichkov commented 2 months ago

This change is similar to https://github.com/osmocom/asn1c/commit/aa37b8cf4d8b6f454974e070b207d80cb6711af0 but implemented differently. For better interoperability it will be good to add support for ASN1C_PREFIX environment variable.