ffi_tool 0.2.5 ffi_tool: ^0.2.5 copied to clipboard
A tool for generating 'dart:ffi' bindings for C and Objective-C libraries.
import 'package:ffi_tool/c.dart';
import 'dart:io';
void main() {
generateFile(File('generated.dart'), library);
}
final library = Library(
dynamicLibraryPath: 'path/to/library',
elements: [
// A function
Func(
name: 'Example',
parameterTypes: ['int32', 'float64', '*void'],
returnType: 'void',
),
// A global
Global(
name: 'ExampleGlobal',
type: 'int32',
),
],
);