cbindgen.toml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. # The language to output bindings in
  2. #
  3. # possible values: "C", "C++"
  4. #
  5. # default: "C++"
  6. language = "C"
  7. # Options for wrapping the contents of the header:
  8. # An optional string of text to output at the beginning of the generated file
  9. # default: doesn't emit anything
  10. header = """/* Copyright (C) 2019 Open Information Security Foundation
  11. *
  12. * You can copy, redistribute or modify this Program under the terms of
  13. * the GNU General Public License version 2 as published by the Free
  14. * Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * version 2 along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  24. * 02110-1301, USA.
  25. */"""
  26. # An optional name to use as an include guard
  27. # default: doesn't emit an include guard
  28. include_guard = "__RUST_BINDINGS_GEN_H_"
  29. # An optional string of text to output between major sections of the generated
  30. # file as a warning against manual editing
  31. #
  32. # default: doesn't emit anything
  33. autogen_warning = "/* DO NOT EDIT This file is autogenerated by cbindgen. Don't modify this manually. */"
  34. # Whether to include a comment with the version of cbindgen used to generate the file
  35. # default: false
  36. include_version = true
  37. # A list of headers to #include (with quotes)
  38. # default: []
  39. includes = []
  40. # The desired length of a line to use when formatting lines
  41. # default: 100
  42. line_length = 80
  43. # The amount of spaces to indent by
  44. # default: 2
  45. tab_width = 4
  46. # How the generated documentation should be commented.
  47. #
  48. # possible values:
  49. # * "c": /* like this */
  50. # * "c99": // like this
  51. # * "c++": /// like this
  52. # * "doxy": like C, but with leading *'s on each line
  53. # * "auto": "c++" if that's the language, "doxy" otherwise
  54. #
  55. # default: "auto"
  56. documentation_style = "doxy"
  57. [export]
  58. # A list of additional items to always include in the generated bindings if they're
  59. # found but otherwise don't appear to be used by the public API.
  60. #
  61. # default: []
  62. include = [
  63. "StreamSlice",
  64. "AppLayerStateData",
  65. "AppLayerGetTxIterTuple",
  66. "RdpState",
  67. "SIPState",
  68. "ModbusState",
  69. "CMark",
  70. "QuicState",
  71. "QuicTransaction"
  72. ]
  73. # A list of items to not include in the generated bindings
  74. # default: []
  75. exclude = [
  76. "AppLayerDecoderEvents",
  77. "AppLayerParserState",
  78. "CLuaState",
  79. "DetectEngineState",
  80. "Flow",
  81. "StreamingBufferConfig",
  82. "HttpRangeContainerBlock",
  83. "FileContainer",
  84. "JsonT",
  85. "IKEState",
  86. "IKETransaction",
  87. "KRB5State",
  88. "KRB5Transaction",
  89. "NTPState",
  90. "NTPTransaction",
  91. "SNMPState",
  92. "SNMPTransaction",
  93. "SuricataContext",
  94. "SuricataFileContext",
  95. "TFTPState",
  96. "TFTPTransaction",
  97. "free",
  98. "IPPROTO_TCP",
  99. "IPPROTO_UDP",
  100. "SRepCatGetByShortname",
  101. ]
  102. # Types of items that we'll generate. If empty, then all types of item are emitted.
  103. #
  104. # possible items: (TODO: explain these in detail)
  105. # * "constants":
  106. # * "globals":
  107. # * "enums":
  108. # * "structs":
  109. # * "unions":
  110. # * "typedefs":
  111. # * "opaque":
  112. # * "functions":
  113. #
  114. # default: []
  115. item_types = ["enums","structs","opaque","functions","constants"]
  116. # Whether applying rules in export.rename prevents export.prefix from applying.
  117. #
  118. # e.g. given this toml:
  119. #
  120. # [export]
  121. # prefix = "capi_"
  122. [export.rename]
  123. "DNSTransaction" = "RSDNSTransaction"
  124. "JsonT" = "json_t"
  125. "CLuaState" = "lua_State"
  126. #
  127. # You get the following results:
  128. #
  129. # renaming_overrides_prefixing = true:
  130. # "MyType" => "my_cool_type"
  131. #
  132. # renaming_overrides_prefixing = false:
  133. # "MyType => capi_my_cool_type"
  134. #
  135. # default: false
  136. renaming_overrides_prefixing = "true"
  137. [parse]
  138. # A black list of crate names that are not allowed to be parsed.
  139. # default: []
  140. exclude = ["libc"]
  141. [parse.expand]
  142. # A list of feature names that should be used when running `cargo expand`. This
  143. # combines with `default_features` like in your `Cargo.toml`. Note that the features
  144. # listed here are features for the current crate being built, *not* the crates
  145. # being expanded. The crate's `Cargo.toml` must take care of enabling the
  146. # appropriate features in its dependencies
  147. #
  148. # default: []
  149. features = ["cbindgen"]