Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | #ifndef ASN1_COMPILER_H |
| 2 | #define ASN1_COMPILER_H |
| 3 | |
| 4 | #include <asn1parser.h> |
| 5 | |
| 6 | enum asn1c_flags { |
| 7 | A1C_NOFLAGS, |
| 8 | /* |
| 9 | * Debug the compiler. |
| 10 | */ |
| 11 | A1C_DEBUG = 0x0001, |
| 12 | /* |
| 13 | * Do not split the target output in several files, just print it. |
| 14 | * (Note: the output is not likely to be compilable in this case). |
| 15 | */ |
| 16 | A1C_PRINT_COMPILED = 0x0002, |
| 17 | /* |
| 18 | * Generate only the tables for ASN.1 types, |
| 19 | * do not emit ASN.1 parsing support code. |
| 20 | */ |
| 21 | A1C_OMIT_SUPPORT_CODE = 0x0004, |
| 22 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 23 | * Use wide types by default (INTEGER_t etc) instead of native/long. |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 24 | */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 25 | A1C_USE_WIDE_TYPES = 0x0008, |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 26 | /* |
| 27 | * Do not use C99 extensions. |
| 28 | */ |
| 29 | A1C_NO_C99 = 0x0010, |
| 30 | /* |
| 31 | * Enable use of unnamed unions (non-portable feature). |
| 32 | */ |
| 33 | A1C_UNNAMED_UNIONS = 0x0020, |
Lev Walkin | dd32b59 | 2004-09-06 08:07:29 +0000 | [diff] [blame] | 34 | /* |
| 35 | * Don't make the asn1_DEF_'s of structure members "static". |
| 36 | */ |
| 37 | A1C_ALL_DEFS_GLOBAL = 0x0040, |
Lev Walkin | 8de2ab2 | 2004-09-26 13:11:31 +0000 | [diff] [blame] | 38 | /* |
| 39 | * Do not generate constraint checking code. |
| 40 | */ |
| 41 | A1C_NO_CONSTRAINTS = 0x0080, |
Lev Walkin | 801fabc | 2005-01-28 12:18:50 +0000 | [diff] [blame] | 42 | /* |
| 43 | * Generate type_id_PR_member things identifiers of id_PR_member. |
| 44 | */ |
Lev Walkin | 4604d03 | 2005-03-04 08:52:50 +0000 | [diff] [blame] | 45 | A1C_COMPOUND_NAMES = 0x0100, |
Lev Walkin | b9b8b95 | 2005-03-05 00:33:27 +0000 | [diff] [blame] | 46 | /* |
| 47 | * Do not generate courtesy #includes for external dependencies. |
| 48 | */ |
| 49 | A1C_NO_INCLUDE_DEPS = 0x0200, |
Lev Walkin | 72a0f5a | 2005-07-24 08:28:39 +0000 | [diff] [blame] | 50 | /* |
| 51 | * Compile members of CHOICE as indirect pointers. |
| 52 | */ |
| 53 | A1C_INDIRECT_CHOICE = 0x0400, |
Lev Walkin | a895afb | 2005-10-06 10:09:34 +0000 | [diff] [blame] | 54 | /* |
Lev Walkin | 2655eb3 | 2013-03-25 19:09:04 -0700 | [diff] [blame] | 55 | * -flink-skeletons |
| 56 | * Symlink support files rather than copy them. |
Lev Walkin | a895afb | 2005-10-06 10:09:34 +0000 | [diff] [blame] | 57 | */ |
Lev Walkin | 2655eb3 | 2013-03-25 19:09:04 -0700 | [diff] [blame] | 58 | A1C_LINK_SKELETONS = 0x0800, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 59 | /* |
| 60 | * -gen-PER |
| 61 | * Generate PER support code |
| 62 | */ |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 63 | A1C_GEN_PER = 0x1000, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 64 | /* |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 65 | * -pdu={all|auto|Type} |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 66 | * Generate PDU table |
| 67 | */ |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 68 | A1C_PDU_ALL = 0x2000, |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 69 | A1C_PDU_AUTO = 0x4000, |
Lev Walkin | 34944f2 | 2010-10-07 08:25:37 +0000 | [diff] [blame] | 70 | A1C_PDU_TYPE = 0x8000, |
| 71 | /* |
| 72 | * -fincludes-quoted |
| 73 | * Avoid generating #include <foo>, generate "foo" instead. |
| 74 | */ |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 75 | A1C_INCLUDES_QUOTED = 0x10000, |
| 76 | /* |
| 77 | * -fline-refs |
| 78 | * Include ASN.1 module's line numbers in comments. |
| 79 | */ |
| 80 | A1C_LINE_REFS = 0x20000 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | /* |
| 84 | * Compile the ASN.1 specification. |
| 85 | */ |
Lev Walkin | 866cff1 | 2005-03-05 00:50:53 +0000 | [diff] [blame] | 86 | int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags, |
Lev Walkin | 8253ea9 | 2006-03-17 01:47:57 +0000 | [diff] [blame] | 87 | int argc, int optc, char **argv); |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 88 | |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 89 | void asn1c__add_pdu_type(const char *typename); |
| 90 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 91 | #endif /* ASN1_COMPILER_H */ |