cbindgen.toml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. # The language to output bindings in
  2. #
  3. language = "C"
  4. # An optional name to use as an include guard
  5. # default: doesn't emit an include guard
  6. include_guard = "OCEANIC_H2O_SVC_H"
  7. # Whether to add a `#pragma once` guard
  8. # default: doesn't emit a `#pragma once`
  9. pragma_once = true
  10. # An optional string of text to output between major sections of the generated
  11. # file as a warning against manual editing
  12. #
  13. # default: doesn't emit anything
  14. autogen_warning = "// This file is generated by cbindgen; do not edit it manually!"
  15. # Whether to include a comment with the version of cbindgen used to generate the file
  16. # default: false
  17. include_version = true
  18. # A list of sys headers to #include (with angle brackets)
  19. # default: []
  20. sys_includes = ["stdarg.h", "stdbool.h", "stdint.h"]
  21. # Whether cbindgen's default C/C++ standard imports should be suppressed. These
  22. # imports are included by default because our generated headers tend to require
  23. # them (e.g. for uint32_t). Currently, the generated imports are:
  24. #
  25. # * for C: <stdarg.h>, <stdbool.h>, <stdint.h>, <stdlib.h>, <uchar.h>
  26. #
  27. # * for C++: <cstdarg>, <cstdint>, <cstdlib>, <new>, <cassert> (depending on config)
  28. #
  29. # default: false
  30. no_includes = true
  31. # Whether to make a C header C++ compatible.
  32. # These will wrap generated functions into a `extern "C"` block, e.g.
  33. #
  34. # #ifdef __cplusplus
  35. # extern "C" {
  36. # #endif // __cplusplus
  37. #
  38. # // Generated functions.
  39. #
  40. # #ifdef __cplusplus
  41. # } // extern "C"
  42. # #endif // __cplusplus
  43. #
  44. # If the language is not C this option won't have any effect.
  45. #
  46. # default: false
  47. cpp_compat = true
  48. # Code Style Options
  49. # Include doc comments from Rust as documentation
  50. documentation = false
  51. # Codegen Options
  52. [export]
  53. [export.rename]
  54. "Record" = "void"
  55. "u128" = "__int128_t"
  56. [layout]
  57. # A string that should come before the name of any type which has been marked
  58. # as `#[repr(packed)]`. For instance, "__attribute__((packed))" would be a
  59. # reasonable value if targeting gcc/clang. A more portable solution would
  60. # involve emitting the name of a macro which you define in a platform-specific
  61. # way. e.g. "PACKED"
  62. #
  63. # default: `#[repr(packed)]` types will be treated as opaque, since it would
  64. # be unsafe for C callers to use a incorrectly laid-out union.
  65. packed = "PACKED"
  66. # A string that should come before the name of any type which has been marked
  67. # as `#[repr(align(n))]`. This string must be a function-like macro which takes
  68. # a single argument (the requested alignment, `n`). For instance, a macro
  69. # `#define`d as `ALIGNED(n)` in `header` which translates to
  70. # `__attribute__((aligned(n)))` would be a reasonable value if targeting
  71. # gcc/clang.
  72. #
  73. # default: `#[repr(align(n))]` types will be treated as opaque, since it
  74. # could be unsafe for C callers to use a incorrectly-aligned union.
  75. aligned_n = "ALIGNED(n)"
  76. [enum]
  77. # A rule to use to rename enum variants, and the names of any fields those
  78. # variants have. This should probably be split up into two separate options, but
  79. # for now, they're the same! See the documentation for `[struct]rename_fields`
  80. # for how this applies to fields. Renaming of the variant assumes that the input
  81. # is the Rust standard PascalCase. In the case of QualifiedScreamingSnakeCase,
  82. # it also assumed that the enum's name is PascalCase.
  83. #
  84. # possible values (that actually do something):
  85. # * "CamelCase": MyVariant => myVariant
  86. # * "SnakeCase": MyVariant => my_variant
  87. # * "ScreamingSnakeCase": MyVariant => MY_VARIANT
  88. # * "QualifiedScreamingSnakeCase": MyVariant => ENUM_NAME_MY_VARIANT
  89. # * "LowerCase": MyVariant => myvariant
  90. # * "UpperCase": MyVariant => MYVARIANT
  91. # * "None": apply no renaming
  92. #
  93. # technically possible values (that shouldn't have a purpose for the variants):
  94. # * "PascalCase": apply no renaming
  95. # * "GeckoCase": apply no renaming
  96. #
  97. # default: "None"
  98. rename_variants = "QualifiedScreamingSnakeCase"
  99. # Whether enum variant names should be prefixed with the name of the enum.
  100. # default: false
  101. prefix_with_name = true
  102. [macro_expansion]
  103. # Whether bindings should be generated for instances of the bitflags! macro.
  104. # default: false
  105. bitflags = true
  106. # Options for how your Rust library should be parsed
  107. [parse]
  108. # Whether to use a new temporary target directory when running `rustc -Zunpretty=expanded`.
  109. # This may be required for some build processes.
  110. #
  111. # default: false
  112. clean = true
  113. [parse.expand]
  114. # A list of crate names that should be run through `cargo expand` before
  115. # parsing to expand any macros. Note that if a crate is named here, it
  116. # will always be parsed, even if the blacklist/whitelist says it shouldn't be.
  117. #
  118. # default: []
  119. crates = ["sv-call"]
  120. # If enabled, use the `--all-features` option when expanding. Ignored when
  121. # `features` is set. For backwards-compatibility, this is forced on if
  122. # `expand = ["euclid"]` shorthand is used.
  123. #
  124. # default: false
  125. all_features = false
  126. # When `all_features` is disabled and this is also disabled, use the
  127. # `--no-default-features` option when expanding.
  128. #
  129. # default: true
  130. default_features = true
  131. # A list of feature names that should be used when running `cargo expand`. This
  132. # combines with `default_features` like in your `Cargo.toml`. Note that the features
  133. # listed here are features for the current crate being built, *not* the crates
  134. # being expanded. The crate's `Cargo.toml` must take care of enabling the
  135. # appropriate features in its dependencies
  136. #
  137. # default: []
  138. features = ["call"]
  139. [ptr]
  140. # An optional string to decorate all pointers that are
  141. # required to be non null. Nullability is inferred from the Rust type: `&T`,
  142. # `&mut T` and `NonNull<T>` all require a valid pointer value.
  143. non_null_attribute = "_Nonnull"