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 | c78cbfb | 2004-09-14 12:47:45 +0000 | [diff] [blame] | 23 | * Use native data types instead of INTEGER_t et al. |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 24 | */ |
Lev Walkin | c78cbfb | 2004-09-14 12:47:45 +0000 | [diff] [blame] | 25 | A1C_USE_NATIVE_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 | /* |
| 55 | * -fskeletons-copy |
| 56 | * Copy support files rather than symlink them. |
| 57 | */ |
| 58 | A1C_SKELETONS_COPY = 0x0800, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 59 | /* |
| 60 | * -gen-PER |
| 61 | * Generate PER support code |
| 62 | */ |
| 63 | A1C_GEN_PER = 0x1000, |
| 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 | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 68 | A1C_PDU_ALL = 0x2000, |
| 69 | A1C_PDU_AUTO = 0x4000, |
| 70 | A1C_PDU_TYPE = 0x8000 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | /* |
| 74 | * Compile the ASN.1 specification. |
| 75 | */ |
Lev Walkin | 866cff1 | 2005-03-05 00:50:53 +0000 | [diff] [blame] | 76 | int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags, |
Lev Walkin | 8253ea9 | 2006-03-17 01:47:57 +0000 | [diff] [blame] | 77 | int argc, int optc, char **argv); |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 78 | |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 79 | void asn1c__add_pdu_type(const char *typename); |
| 80 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 81 | #endif /* ASN1_COMPILER_H */ |