blob: 8e656b533702e7455c8fc4ae4db6d00bdbc4e365 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001#ifndef ASN1_COMPILER_H
2#define ASN1_COMPILER_H
3
4#include <asn1parser.h>
5
6enum 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 Walkin2a744a72013-03-27 01:56:23 -070023 * Use wide types by default (INTEGER_t etc) instead of native/long.
Lev Walkinf15320b2004-06-03 03:38:44 +000024 */
Lev Walkin2a744a72013-03-27 01:56:23 -070025 A1C_USE_WIDE_TYPES = 0x0008,
Lev Walkinf15320b2004-06-03 03:38:44 +000026 /*
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 Walkindd32b592004-09-06 08:07:29 +000034 /*
35 * Don't make the asn1_DEF_'s of structure members "static".
36 */
37 A1C_ALL_DEFS_GLOBAL = 0x0040,
Lev Walkin8de2ab22004-09-26 13:11:31 +000038 /*
39 * Do not generate constraint checking code.
40 */
41 A1C_NO_CONSTRAINTS = 0x0080,
Lev Walkin801fabc2005-01-28 12:18:50 +000042 /*
43 * Generate type_id_PR_member things identifiers of id_PR_member.
44 */
Lev Walkin4604d032005-03-04 08:52:50 +000045 A1C_COMPOUND_NAMES = 0x0100,
Lev Walkinb9b8b952005-03-05 00:33:27 +000046 /*
47 * Do not generate courtesy #includes for external dependencies.
48 */
49 A1C_NO_INCLUDE_DEPS = 0x0200,
Lev Walkin72a0f5a2005-07-24 08:28:39 +000050 /*
51 * Compile members of CHOICE as indirect pointers.
52 */
53 A1C_INDIRECT_CHOICE = 0x0400,
Lev Walkina895afb2005-10-06 10:09:34 +000054 /*
Lev Walkin2655eb32013-03-25 19:09:04 -070055 * -flink-skeletons
56 * Symlink support files rather than copy them.
Lev Walkina895afb2005-10-06 10:09:34 +000057 */
Lev Walkin2655eb32013-03-25 19:09:04 -070058 A1C_LINK_SKELETONS = 0x0800,
Lev Walkinba68c912017-07-06 07:52:39 -070059
Lev Walkin59b176e2005-11-26 11:25:14 +000060 /*
Lev Walkin66adab42006-09-23 02:52:12 +000061 * -pdu={all|auto|Type}
Lev Walkin59b176e2005-11-26 11:25:14 +000062 * Generate PDU table
63 */
Lev Walkin4062b012013-10-11 14:29:38 -070064 A1C_PDU_ALL = 0x2000,
Lev Walkin66adab42006-09-23 02:52:12 +000065 A1C_PDU_AUTO = 0x4000,
Lev Walkin34944f22010-10-07 08:25:37 +000066 A1C_PDU_TYPE = 0x8000,
67 /*
68 * -fincludes-quoted
69 * Avoid generating #include <foo>, generate "foo" instead.
70 */
Lev Walkin4062b012013-10-11 14:29:38 -070071 A1C_INCLUDES_QUOTED = 0x10000,
72 /*
73 * -fline-refs
74 * Include ASN.1 module's line numbers in comments.
75 */
Lev Walkinba68c912017-07-06 07:52:39 -070076 A1C_LINE_REFS = 0x20000,
77 /*
78 * -gen-OER
79 * Generate Octet Encoding Rules support code
80 */
81 A1C_GEN_OER = 0x40000,
82 /*
83 * -gen-PER
84 * Generate Packed Encoding Rules support code
85 */
86 A1C_GEN_PER = 0x80000,
Lev Walkinf15320b2004-06-03 03:38:44 +000087};
88
89/*
90 * Compile the ASN.1 specification.
91 */
Lev Walkin866cff12005-03-05 00:50:53 +000092int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags,
Lev Walkin8253ea92006-03-17 01:47:57 +000093 int argc, int optc, char **argv);
Lev Walkinf15320b2004-06-03 03:38:44 +000094
Lev Walkin66adab42006-09-23 02:52:12 +000095void asn1c__add_pdu_type(const char *typename);
96
Lev Walkinf15320b2004-06-03 03:38:44 +000097#endif /* ASN1_COMPILER_H */