blob: a964f5074ff52982186a8ed5e2b0ba6104c39cd3 [file] [log] [blame]
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
import 'dart:ffi' as ffi;
/// Bindings to `headers/example.h`.
class NativeLibrary {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;
/// The symbols are looked up in [dynamicLibrary].
NativeLibrary(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
NativeLibrary.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
/// Adds 2 integers.
int sum(
int a,
int b,
) {
return _sum(
a,
b,
);
}
late final _sum_ptr =
_lookup<ffi.NativeFunction<ffi.Int32 Function(ffi.Int32, ffi.Int32)>>(
'sum');
late final _sum = _sum_ptr.asFunction<int Function(int, int)>();
/// Subtracts 2 integers.
int subtract(
ffi.Pointer<ffi.Int32> a,
int b,
) {
return _subtract(
a,
b,
);
}
late final _subtract_ptr = _lookup<
ffi.NativeFunction<
ffi.Int32 Function(ffi.Pointer<ffi.Int32>, ffi.Int32)>>('subtract');
late final _subtract =
_subtract_ptr.asFunction<int Function(ffi.Pointer<ffi.Int32>, int)>();
/// Multiplies 2 integers, returns pointer to an integer,.
ffi.Pointer<ffi.Int32> multiply(
int a,
int b,
) {
return _multiply(
a,
b,
);
}
late final _multiply_ptr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Int32> Function(ffi.Int32, ffi.Int32)>>('multiply');
late final _multiply =
_multiply_ptr.asFunction<ffi.Pointer<ffi.Int32> Function(int, int)>();
/// Divides 2 integers, returns pointer to a float.
ffi.Pointer<ffi.Float> divide(
int a,
int b,
) {
return _divide(
a,
b,
);
}
late final _divide_ptr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Float> Function(ffi.Int32, ffi.Int32)>>('divide');
late final _divide =
_divide_ptr.asFunction<ffi.Pointer<ffi.Float> Function(int, int)>();
/// Divides 2 floats, returns a pointer to double.
ffi.Pointer<ffi.Double> dividePercision(
ffi.Pointer<ffi.Float> a,
ffi.Pointer<ffi.Float> b,
) {
return _dividePercision(
a,
b,
);
}
late final _dividePercision_ptr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Double> Function(ffi.Pointer<ffi.Float>,
ffi.Pointer<ffi.Float>)>>('dividePercision');
late final _dividePercision = _dividePercision_ptr.asFunction<
ffi.Pointer<ffi.Double> Function(
ffi.Pointer<ffi.Float>, ffi.Pointer<ffi.Float>)>();
}