- Add support for ObjC Blocks that can be invoked from any thread, using NativeCallable.listener.
- Fix invalid exceptional return value ObjCBlocks that return floats.
- Fix return_of_invalid_type analysis error for ObjCBlocks.
- Fix crash in ObjC methods and blocks that return structs by value.
- Fix ObjC methods returning instancetype having the wrong type in sublasses.
- When generating typedefs for
Pointer<NativeFunction<Function>>
, also generate a typedef for theFunction
. - Use Dart wrapper types in args and returns of ObjCBlocks.
- Use Dart wrapper types in args and returns of static functions.
- Bump min SDK version to 3.2.0-210.4.beta.
- Renamed
asset
toassetId
forffi-native
.
- Fix doc comment missing on struct/union array fields.
- Allow extern inline functions to be generated.
- Added a JSON schema for FFIgen config files.
- Fixed invalid code generated due to zero-length arrays in structs/union.
- Fixed invalid code generated due to anonymous structs/unions with unsupported types.
- Stable release for Dart 3.0 with support for class modifers, variadic arguments, and
@Native
s.
- Added support for variadic functions using config
functions -> variadic-arguments
.
- Use
@Native
syntax instead of deprecated@FfiNative
syntax.
- Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration.
- Adds
final
class modifier to generated sub typesStruct
,Union
andOpaque
. A class modifier is required in Dart 3.0 because the classesdart:ffi
as markedbase
. When migrating a package that uses FFIgen, and exposes the generated code in the public API of the package, to Dart 3.0, that package does not need a major version bump. Sub typingStruct
,Union
andOpaque
sub types is already disallowed bydart:ffi
pre 3.0, so adding thefinal
keyword is not a breaking change. - Bumps SDK lowerbound to 3.0.
- Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration.
- Generate parameter names in function pointer fields and typedefs.
- Detect LLVM installed using Scoop on Windows machines.
- Automatically generate
ignore_for_file: type=lint
if not specified in preamble.
- Fix some macros not being generated in some cases due to relative header paths.
- Fix path normalization behaviour for absolute paths and globs starting with
**
.
- Add support nested anonymous union/struct
- Add new supported typedef -
uintptr_t
(mapped toffi.UintPtr
).
- Change compiler option order so that user options can override built-in options.
- Added newer versions of LLVM, to default
linuxDylibLocations
.
- Fix helper methods sometimes missing from NSString.
- Added support for sharing bindings using
symbol-file
config. (SeeREADME.md
and examples/shared_bindings).
- Handle declarations with definition accessible from a different entry-point.
- Fix typedef include/exclude config.
- Return
ObjCBlock
wrapper instead of raw pointer in more cases.
- Relative paths in ffigen config files are now assumed to be relative to the config file, rather than the working directory of the tool invocation.
- Fix bug where function bindings were not deduped correctly.
- EXPERIMENTAL support for
FfiNative
. The API and output might change at any point.
- Added
exclude-all-by-default
config flag, which changes the default behavior of declaration filters to exclude everything, rather than include everything.
- Bump
package:ffi
to 2.0.1.
- Replace path separators in
include-directives
before matching file names. - Add more ways to find
libclang
.
- Removed config
dart-bool
. Booleans are now always generated withbool
andffi.Bool
as it's Dart and C Type respectively.
- Add a the xcode tools llvm as default path on MacOS.
- Stable release targeting Dart 2.17, supporting ABI-specific integer types.
- EXPERIMENTAL support for ObjectiveC on MacOS hosts. The API and output might change at any point. Feel free to report bugs if encountered.
- Fixed invalid default dart types being generated for
size_t
andwchar_t
.
- Added support for generating ABI Specific integers.
- Breaking: removed config keys -
size-map
andtypedef-map
. - Added config keys -
library-imports
andtype-map
.
- Analyzer fixes.
- Added fix for empty include list to exclude all
- Added fix for errors due to name collision between member name and type name used internally in structs/unions.
- Add config key
functions -> leaf
for specifyingisLeaf:true
for functions.
- Release for Dart SDK
>=2.14
.
- Added config key
functions -> expose-typedefs
to expose the typedef to Native and Dart type. - Config key
function
->symbol-address
no longer exposes the typedef to Native type. Useexpose-typedefs
to get the native type.
- This package now targets package:lints for the generated code. The generated
code uses C symbol names as is. Use either
// ignore_for_file: lintRule1, lintRule2
in thepreamble
, or rename the symbols to make package:lints happy. - Name collisions are now resolved by suffixing
<int>
instead of_<int>
.
- Added support for generating typedefs (referred typedefs only).
Example C Code | Generated Dart typedef |
typedef struct A{
...
} TA, *PA;
TA func(PA ptr); |
class A extends ffi.Struct {...}
typedef TA = A;
typedef PA = ffi.Pointer<A>;
TA func(PA ptr){...} |
- All declarations that are excluded by the user are now only included if being used somewhere.
- Improved struct/union include/exclude. These declarations can now be targetted by their actual name, or if they are unnamed then by the name of the first typedef that refers to them.
- Users can now specify exact path to dynamic library in
llvm-path
.
- Added support for generating unions.
- Release for dart sdk
>=2.13
(Support for packed structs and inline arrays).
- Added support for inline arrays in
Struct
s. - Remove config key
array-workaround
. - Remove deprecated key
llvm-lib
from config, Usellvm-path
instead.
- Added support for
Packed
structs. Packed annotations are generated automatically but can be overriden usingstructs -> pack
config. - Updated sdk constraints to
>=2.13.0-211.6.beta
.
- Fix issues due to declarations having duplicate names.
- Fix name conflict of declaration with ffi library prefix.
- Fix
char
not being recognized on platforms where it's unsigned by default.
- Added
/usr/lib
to default dynamic library location for linux.
- Added new config key
llvm-path
that accepts a list ofpath/to/llvm
. - Deprecated config key
llvm-lib
.
- Added config key
compiler-opts-automatic -> macos -> include-c-standard-library
(default: true) to automatically find and add C standard library on macOS. - Allow passing list of string to config key
compiler-opts
.
- Added new command line flag
--compiler-opts
to the command line tool.
- Fix
sort: true
not working. - Fix extra
//
or///
in comments when usingcomments -> style
:full
.
- Added new subkey
dependency-only
(options -full (default) | opaque
) understructs
. When set toopaque
, ffigen will generate emptyOpaque
structs if structs were excluded in config (i.e added because they were a dependency) and only passed by reference(pointer).
- Fixed generation of empty opaque structs due to forward declarations in header files.
- Fixed generation of duplicate constants suffixed with
_<int>
when using multiple entry points.
- Added subkey
symbol-address
to expose native symbol pointers forfunctions
andglobals
.
- Added a new named constructor
NativeLibrary.fromLookup()
to support dynamic linking. - Updated dart SDK constraints to latest stable version
2.12.0
.
- Ignore typedef to struct pointer when possible.
- Recursively create directories for output file.
- Fixed illegal use of
const
in name, crash due to unnamed inline structs and structs havingOpaque
members.
- Switch to preview release of
package:quiver
.
- Upgraded all dependencies.
package:ffigen
now runs with sound null safety.
- Functions marked
inline
are now skipped.
- Use
Opaque
for representing emptyStruct
s.
- Add support for parsing and generating globals.
- Removed the usage of
--no-sound-null-safety
flag.
- Removed setup phase for ffigen. Added new optional config key
llvm-lib
to specify path tollvm/lib
folder.
- Added support for passing and returning struct by value in functions.
- Added support for Nested structs.
- Removed the need for
--no-sound-null-safety
flag.
- Migrated to (unsound) null safety.
- Added support for
Dart_Handle
fromdart_api.h
.
typedef-map
can now be used to map a typedef name to a native type directly.
- Fixed missing typedefs nested in another typedef's return types.
- Fixed issues with generating macros of type
double.Infinity
anddouble.NaN
.
- Updated code to use
dart format
instead ofdartfmt
for sdk version>= 2.10.0
.
- Fixed errors due to extended ASCII and control characters in macro strings.
- Fix indentation for pub's readme.
- Fixed generation of
NativeFunction
parameters instead ofPointer<NativeFunction>
in type signatures.
- Bump version to 1.0.0.
- Handle unimplememnted function pointers causing errors.
- Log lexical/semantic issues in headers as SEVERE.
- Added support for including/excluding/renaming un-named enums using key
unnamed_enums
.
- Minor changes to dylib creation error log.
- Added support for C booleans as Uint8.
- Added config
dart-bool
(default: true) to use dart bool instead of int in function parameters and return type.
- Wrapper dynamic library version now uses ffigen version from its pubspec.yaml file.
- Handle code formatting using dartfmt by finding dart-sdk.
- Fixed missing typedefs of nested function pointers.
- Fixed parsing structs with bitfields, all members of structs with bit field members will now be removed. See #84
- Updated
package:meta
version to^1.1.8
for compatibility with flutter sdk.
- Fixed multiple generation/skipping of typedef enclosed declarations.
- Typedef names are now given higher preference over inner names, See #83.
- Added FAQ to readme.
- Fixed missing/duplicate typedef generation.
- Updated header config. Header
entry-points
andinclude-directives
are now specified underheaders
key. Glob syntax is allowed. - Updated declaration
include
/exclude
config. These are now specified as a list. - Added Regexp based declaration renaming using
rename
subkey. - Added Regexp based member renaming for structs, enums and functions using
member-rename
subkey.prefix
andprefix-replacement
subkeys have been removed.
- Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants.
- Comments config now has a style and length sub keys -
style: doxygen(default) | any
,length: brief | full(default)
, and can be disabled by passingcomments: false
.
- Handled function arguments - dart keyword name collision
- Fix travis tests: the dynamic library is created using
pub run ffigen:setup
before running the tests.
- Fixed wrapper not found error when running
pub run ffigen
.
- Address pub score: follow dart File conventions, provide documentation, and pass static analysis.
- Support for Functions, Structs and Enums.
- Glob support for specifying headers.
- HeaderFilter - Include/Exclude declarations from specific header files using name matching.
- Filters - Include/Exclude function, structs and enum declarations using Regexp or Name matching.
- Prefixing - function, structs and enums can have a global prefix. Individual prefix Replacement support using Regexp.
- Comment extraction: full/brief/none
- Support for fixed size arrays in struct.
array-workaround
(if enabled) will generate helpers for accessing fixed size arrays in structs. - Size for ints can be specified using
size-map
in config. - Options to disable using supported typedefs (e.g
uint8_t => Uint8
), sort bindings. - Option to add a raw
preamble
which is included as is in the generated file.