Skip to content

Commit 24d658a

Browse files
committed
Fix outdated docs: variadic/va_list, skippable symbol types, typos.
- c/filtering.md: variadic functions are now supported; va_list is what's skipped - configuration.md: document that skip works for enums, typedefs, unions, variables - c/c_bindings.md: note that va_list functions are skipped - cpp/cpp_bindings.md: fix typos (addition→additional, wrapp→wrap)
1 parent 50afbb1 commit 24d658a

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

docs/c/c_bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ end
105105

106106
`ruby-bindgen` supports the following FFI features:
107107

108-
- [Functions](https://github.com/ffi/ffi/wiki/Basic-Usage) - C functions mapped to Ruby module methods via `attach_function`, including variadic functions (`:varargs`)
108+
- [Functions](https://github.com/ffi/ffi/wiki/Basic-Usage) - C functions mapped to Ruby module methods via `attach_function`, including variadic functions (`:varargs`). Functions taking `va_list` parameters are skipped since `va_list` cannot be constructed from Ruby.
109109
- [Structs](https://github.com/ffi/ffi/wiki/Structs) - C structs mapped to `FFI::Struct` classes with proper layouts
110110
- Unions - C unions mapped to `FFI::Union` classes
111111
- [Enums](https://github.com/ffi/ffi/wiki/Enums) - C enums mapped to FFI enum types

docs/c/filtering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ See [`symbols`](../configuration.md#symbols) in the configuration documentation.
1515
The following are automatically skipped:
1616

1717
- **Deprecated**: Functions marked with `__attribute__((deprecated))` or `[[deprecated]]`
18-
- **Variadic**: Functions with `...` parameters (cannot be called via FFI)
18+
- **va_list**: Functions taking `va_list` parameters (cannot be constructed from Ruby; use the variadic `...` version instead)
1919
- **Private/Protected**: Non-public members
2020
- **System headers**: Declarations from system include paths

docs/configuration.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ The `symbols` option groups per-symbol actions and name mappings by type. The ac
140140

141141
### Skip
142142

143-
The `skip` key lists symbols to exclude from bindings. This is useful when:
143+
The `skip` key lists symbols to exclude from bindings. This works for functions, classes, enums, typedefs, unions, and variables. This is useful when:
144144

145-
- Functions have export macros but still aren't available (build configuration issues)
146-
- Functions are internal/private APIs not meant for external use
147-
- Functions cause linker errors due to missing symbols
145+
- Symbols have export macros but still aren't available (build configuration issues)
146+
- Symbols are internal/private APIs not meant for external use
147+
- Symbols cause linker errors due to missing definitions
148148

149149
Symbol names support:
150150

@@ -160,6 +160,9 @@ symbols:
160160
- cv::ocl::PlatformInfo::versionMinor # Skips only this specific method
161161
- "cv::Mat_::zeros(int, const int *)" # Skips only this overload (others remain)
162162
- /cv::dnn::.*Layer::init.*/ # Regex: skips all init* methods on any Layer class
163+
- DeprecatedEnum # Skips an enum
164+
- InternalUnion # Skips a union
165+
- debugVariable # Skips a variable
163166
```
164167
165168
### Versions

docs/cpp/cpp_bindings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ target_precompile_headers(my_extension PRIVATE
139139
)
140140
```
141141

142-
You can specify a custom include file by setting the `include` option in the configuration file. This will replace the default `rice_include.hpp` file and thus allow you to specify your own `include` files if necessary. Your custom header must include the Rice headers, plus any addition includes or definitions you want to be global.
142+
You can specify a custom include file by setting the `include` option in the configuration file. This will replace the default `rice_include.hpp` file and thus allow you to specify your own `include` files if necessary. Your custom header must include the Rice headers, plus any additional includes or definitions you want to be global.
143143

144-
For example, it is a good place to add support for custom smart pointers. For example, OpenCV defines `cv::Ptr<T>` which inherits from `std::smart_pointer<T>`. The opencv-ruby bindings wrapp this smart pointer in a custom header file that is then added to `rice_includes.hpp`. That means all translation units see it, preventing ODR violations.
144+
For example, it is a good place to add support for custom smart pointers. For example, OpenCV defines `cv::Ptr<T>` which inherits from `std::smart_pointer<T>`. The opencv-ruby bindings wrap this smart pointer in a custom header file that is then added to `rice_includes.hpp`. That means all translation units see it, preventing ODR violations.
145145

146146
A custom include file will not be overwritten by `ruby-bindgen`.
147147

0 commit comments

Comments
 (0)