blob: 2901d4079accc9986eb5e9b571eb795d90e7ffdc [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 Walkind1c28aa2017-11-11 18:04:26 -080087 /*
Jon Ringle3016fd52017-11-15 02:06:47 -050088 * Generate converter-example.c and converter-example.mk
Lev Walkind1c28aa2017-11-11 18:04:26 -080089 */
Jon Ringle3aa33c02017-11-14 11:16:03 -050090 A1C_GEN_EXAMPLE = 0x100000,
91 /*
92 * Generate top-level configure.ac and Makefile.am
93 */
94 A1C_GEN_AUTOTOOLS_EXAMPLE = 0x200000,
Lev Walkin840fb8e2017-11-19 23:39:59 -080095 /*
96 * Print the source of generated lines.
97 * -debug-output-origin-lines
98 */
99 A1C_DEBUG_OUTPUT_ORIGIN_LINES = 0x400000,
Lev Walkinf15320b2004-06-03 03:38:44 +0000100};
101
102/*
103 * Compile the ASN.1 specification.
104 */
Jon Ringle6431b1c2017-11-15 01:22:02 -0500105int asn1_compile(asn1p_t *asn, const char *datadir, const char *destdir, enum asn1c_flags,
Lev Walkin8253ea92006-03-17 01:47:57 +0000106 int argc, int optc, char **argv);
Lev Walkinf15320b2004-06-03 03:38:44 +0000107
Lev Walkin4215c512017-11-19 19:01:26 -0800108void asn1c_debug_type_naming(asn1p_t *asn, enum asn1c_flags,
109 char **asn_type_names);
110
Lev Walkin66adab42006-09-23 02:52:12 +0000111void asn1c__add_pdu_type(const char *typename);
112
Lev Walkinf15320b2004-06-03 03:38:44 +0000113#endif /* ASN1_COMPILER_H */