summaryrefslogtreecommitdiffstats
path: root/rust/cbindgen.toml
blob: 15c56e2e7da2b6b376f87c6c5ff61de854c37a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# The language to output bindings in
#
# possible values: "C", "C++"
#
# default: "C++"
language = "C"


# Options for wrapping the contents of the header:

# An optional string of text to output at the beginning of the generated file
# default: doesn't emit anything
header = """/* Copyright (C) 2019 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/"""

# An optional name to use as an include guard
# default: doesn't emit an include guard
include_guard = "__RUST_BINDINGS_GEN_H_"

# An optional string of text to output between major sections of the generated
# file as a warning against manual editing
#
# default: doesn't emit anything
autogen_warning = "/* DO NOT EDIT This file is autogenerated by cbindgen. Don't modify this manually. */"

# Whether to include a comment with the version of cbindgen used to generate the file
# default: false
include_version = true

# A list of headers to #include (with quotes)
# default: []
includes = []

# The desired length of a line to use when formatting lines
# default: 100
line_length = 80

# The amount of spaces to indent by
# default: 2
tab_width = 4

# How the generated documentation should be commented.
#
# possible values:
# * "c": /* like this */
# * "c99": // like this
# * "c++": /// like this
# * "doxy": like C, but with leading *'s on each line
# * "auto": "c++" if that's the language, "doxy" otherwise
#
# default: "auto"
documentation_style = "doxy"


[export]
# A list of additional items to always include in the generated bindings if they're
# found but otherwise don't appear to be used by the public API.
#
# default: []
include = [
    "StreamSlice",
    "AppLayerStateData",
    "AppLayerGetTxIterTuple",
    "RdpState",
    "SIPState",
    "ModbusState",
    "CMark",
    "QuicState",
    "QuicTransaction",
    "FtpEvent",
]

# A list of items to not include in the generated bindings
# default: []
exclude = [
    "AppLayerDecoderEvents",
    "AppLayerParserState",
    "CLuaState",
    "DetectEngineState",
    "Flow",
    "StreamingBufferConfig",
    "HttpRangeContainerBlock",
    "FileContainer",
    "JsonT",
    "IKEState",
    "IKETransaction",
    "KRB5State",
    "KRB5Transaction",
    "NTPState",
    "NTPTransaction",
    "SNMPState",
    "SNMPTransaction",
    "SuricataContext",
    "SuricataFileContext",
    "TFTPState",
    "TFTPTransaction",
    "free",
    "IPPROTO_TCP",
    "IPPROTO_UDP",
    "SRepCatGetByShortname",
]

# Types of items that we'll generate. If empty, then all types of item are emitted.
#
# possible items: (TODO: explain these in detail)
# * "constants":
# * "globals":
# * "enums":
# * "structs":
# * "unions":
# * "typedefs":
# * "opaque":
# * "functions":
#
# default: []
item_types = ["enums","structs","opaque","functions","constants"]

# Whether applying rules in export.rename prevents export.prefix from applying.
#
# e.g. given this toml:
#
# [export]
# prefix = "capi_"
[export.rename]
"DNSTransaction" = "RSDNSTransaction"
"JsonT" = "json_t"
"CLuaState" = "lua_State"

#
# You get the following results:
#
# renaming_overrides_prefixing = true:
# "MyType" => "my_cool_type"
#
# renaming_overrides_prefixing = false:
# "MyType => capi_my_cool_type"
#
# default: false
renaming_overrides_prefixing = "true"

[parse]
# A black list of crate names that are not allowed to be parsed.
# default: []
exclude = ["libc"]

[parse.expand]
# A list of feature names that should be used when running `cargo expand`. This
# combines with `default_features` like in your `Cargo.toml`. Note that the features
# listed here are features for the current crate being built, *not* the crates
# being expanded. The crate's `Cargo.toml` must take care of enabling the
# appropriate features in its dependencies
#
# default: []
features = ["cbindgen"]