| // AUTO GENERATED FILE, DO NOT EDIT. |
| // |
| // Generated by `package:ffigen`. |
| import 'dart:ffi' as ffi; |
| |
| /// Native tests. |
| 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; |
| |
| bool Function1Bool( |
| bool x, |
| ) { |
| return _Function1Bool( |
| x ? 1 : 0, |
| ) != |
| 0; |
| } |
| |
| late final _Function1Bool_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Bool>>('Function1Bool'); |
| late final _dart_Function1Bool _Function1Bool = |
| _Function1Bool_ptr.asFunction<_dart_Function1Bool>(); |
| |
| int Function1Uint8( |
| int x, |
| ) { |
| return _Function1Uint8( |
| x, |
| ); |
| } |
| |
| late final _Function1Uint8_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Uint8>>('Function1Uint8'); |
| late final _dart_Function1Uint8 _Function1Uint8 = |
| _Function1Uint8_ptr.asFunction<_dart_Function1Uint8>(); |
| |
| int Function1Uint16( |
| int x, |
| ) { |
| return _Function1Uint16( |
| x, |
| ); |
| } |
| |
| late final _Function1Uint16_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Uint16>>('Function1Uint16'); |
| late final _dart_Function1Uint16 _Function1Uint16 = |
| _Function1Uint16_ptr.asFunction<_dart_Function1Uint16>(); |
| |
| int Function1Uint32( |
| int x, |
| ) { |
| return _Function1Uint32( |
| x, |
| ); |
| } |
| |
| late final _Function1Uint32_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Uint32>>('Function1Uint32'); |
| late final _dart_Function1Uint32 _Function1Uint32 = |
| _Function1Uint32_ptr.asFunction<_dart_Function1Uint32>(); |
| |
| int Function1Uint64( |
| int x, |
| ) { |
| return _Function1Uint64( |
| x, |
| ); |
| } |
| |
| late final _Function1Uint64_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Uint64>>('Function1Uint64'); |
| late final _dart_Function1Uint64 _Function1Uint64 = |
| _Function1Uint64_ptr.asFunction<_dart_Function1Uint64>(); |
| |
| int Function1Int8( |
| int x, |
| ) { |
| return _Function1Int8( |
| x, |
| ); |
| } |
| |
| late final _Function1Int8_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Int8>>('Function1Int8'); |
| late final _dart_Function1Int8 _Function1Int8 = |
| _Function1Int8_ptr.asFunction<_dart_Function1Int8>(); |
| |
| int Function1Int16( |
| int x, |
| ) { |
| return _Function1Int16( |
| x, |
| ); |
| } |
| |
| late final _Function1Int16_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Int16>>('Function1Int16'); |
| late final _dart_Function1Int16 _Function1Int16 = |
| _Function1Int16_ptr.asFunction<_dart_Function1Int16>(); |
| |
| int Function1Int32( |
| int x, |
| ) { |
| return _Function1Int32( |
| x, |
| ); |
| } |
| |
| late final _Function1Int32_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Int32>>('Function1Int32'); |
| late final _dart_Function1Int32 _Function1Int32 = |
| _Function1Int32_ptr.asFunction<_dart_Function1Int32>(); |
| |
| int Function1Int64( |
| int x, |
| ) { |
| return _Function1Int64( |
| x, |
| ); |
| } |
| |
| late final _Function1Int64_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Int64>>('Function1Int64'); |
| late final _dart_Function1Int64 _Function1Int64 = |
| _Function1Int64_ptr.asFunction<_dart_Function1Int64>(); |
| |
| int Function1IntPtr( |
| int x, |
| ) { |
| return _Function1IntPtr( |
| x, |
| ); |
| } |
| |
| late final _Function1IntPtr_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1IntPtr>>('Function1IntPtr'); |
| late final _dart_Function1IntPtr _Function1IntPtr = |
| _Function1IntPtr_ptr.asFunction<_dart_Function1IntPtr>(); |
| |
| double Function1Float( |
| double x, |
| ) { |
| return _Function1Float( |
| x, |
| ); |
| } |
| |
| late final _Function1Float_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Float>>('Function1Float'); |
| late final _dart_Function1Float _Function1Float = |
| _Function1Float_ptr.asFunction<_dart_Function1Float>(); |
| |
| double Function1Double( |
| double x, |
| ) { |
| return _Function1Double( |
| x, |
| ); |
| } |
| |
| late final _Function1Double_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1Double>>('Function1Double'); |
| late final _dart_Function1Double _Function1Double = |
| _Function1Double_ptr.asFunction<_dart_Function1Double>(); |
| |
| ffi.Pointer<Struct1> getStruct1() { |
| return _getStruct1(); |
| } |
| |
| late final _getStruct1_ptr = |
| _lookup<ffi.NativeFunction<_c_getStruct1>>('getStruct1'); |
| late final _dart_getStruct1 _getStruct1 = |
| _getStruct1_ptr.asFunction<_dart_getStruct1>(); |
| |
| Struct3 Function1StructReturnByValue( |
| int a, |
| int b, |
| int c, |
| ) { |
| return _Function1StructReturnByValue( |
| a, |
| b, |
| c, |
| ); |
| } |
| |
| late final _Function1StructReturnByValue_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1StructReturnByValue>>( |
| 'Function1StructReturnByValue'); |
| late final _dart_Function1StructReturnByValue _Function1StructReturnByValue = |
| _Function1StructReturnByValue_ptr.asFunction< |
| _dart_Function1StructReturnByValue>(); |
| |
| int Function1StructPassByValue( |
| Struct3 sum_a_b_c, |
| ) { |
| return _Function1StructPassByValue( |
| sum_a_b_c, |
| ); |
| } |
| |
| late final _Function1StructPassByValue_ptr = |
| _lookup<ffi.NativeFunction<_c_Function1StructPassByValue>>( |
| 'Function1StructPassByValue'); |
| late final _dart_Function1StructPassByValue _Function1StructPassByValue = |
| _Function1StructPassByValue_ptr.asFunction< |
| _dart_Function1StructPassByValue>(); |
| } |
| |
| class Struct1 extends ffi.Struct { |
| @ffi.Int8() |
| external int a; |
| |
| @ffi.Int32() |
| external int _unique_data_item_0; |
| @ffi.Int32() |
| external int _unique_data_item_1; |
| @ffi.Int32() |
| external int _unique_data_item_2; |
| @ffi.Int32() |
| external int _unique_data_item_3; |
| @ffi.Int32() |
| external int _unique_data_item_4; |
| @ffi.Int32() |
| external int _unique_data_item_5; |
| |
| /// Helper for array `data`. |
| ArrayHelper_Struct1_data_level0 get data => |
| ArrayHelper_Struct1_data_level0(this, [3, 1, 2], 0, 0); |
| } |
| |
| /// Helper for array `data` in struct `Struct1`. |
| class ArrayHelper_Struct1_data_level0 { |
| final Struct1 _struct; |
| final List<int> dimensions; |
| final int level; |
| final int _absoluteIndex; |
| int get length => dimensions[level]; |
| ArrayHelper_Struct1_data_level0( |
| this._struct, this.dimensions, this.level, this._absoluteIndex); |
| void _checkBounds(int index) { |
| if (index >= length || index < 0) { |
| throw RangeError( |
| 'Dimension $level: index not in range 0..$length exclusive.'); |
| } |
| } |
| |
| ArrayHelper_Struct1_data_level1 operator [](int index) { |
| _checkBounds(index); |
| var offset = index; |
| for (var i = level + 1; i < dimensions.length; i++) { |
| offset *= dimensions[i]; |
| } |
| return ArrayHelper_Struct1_data_level1( |
| _struct, dimensions, level + 1, _absoluteIndex + offset); |
| } |
| } |
| |
| /// Helper for array `data` in struct `Struct1`. |
| class ArrayHelper_Struct1_data_level1 { |
| final Struct1 _struct; |
| final List<int> dimensions; |
| final int level; |
| final int _absoluteIndex; |
| int get length => dimensions[level]; |
| ArrayHelper_Struct1_data_level1( |
| this._struct, this.dimensions, this.level, this._absoluteIndex); |
| void _checkBounds(int index) { |
| if (index >= length || index < 0) { |
| throw RangeError( |
| 'Dimension $level: index not in range 0..$length exclusive.'); |
| } |
| } |
| |
| ArrayHelper_Struct1_data_level2 operator [](int index) { |
| _checkBounds(index); |
| var offset = index; |
| for (var i = level + 1; i < dimensions.length; i++) { |
| offset *= dimensions[i]; |
| } |
| return ArrayHelper_Struct1_data_level2( |
| _struct, dimensions, level + 1, _absoluteIndex + offset); |
| } |
| } |
| |
| /// Helper for array `data` in struct `Struct1`. |
| class ArrayHelper_Struct1_data_level2 { |
| final Struct1 _struct; |
| final List<int> dimensions; |
| final int level; |
| final int _absoluteIndex; |
| int get length => dimensions[level]; |
| ArrayHelper_Struct1_data_level2( |
| this._struct, this.dimensions, this.level, this._absoluteIndex); |
| void _checkBounds(int index) { |
| if (index >= length || index < 0) { |
| throw RangeError( |
| 'Dimension $level: index not in range 0..$length exclusive.'); |
| } |
| } |
| |
| int operator [](int index) { |
| _checkBounds(index); |
| switch (_absoluteIndex + index) { |
| case 0: |
| return _struct._unique_data_item_0; |
| case 1: |
| return _struct._unique_data_item_1; |
| case 2: |
| return _struct._unique_data_item_2; |
| case 3: |
| return _struct._unique_data_item_3; |
| case 4: |
| return _struct._unique_data_item_4; |
| case 5: |
| return _struct._unique_data_item_5; |
| default: |
| throw Exception('Invalid Array Helper generated.'); |
| } |
| } |
| |
| void operator []=(int index, int value) { |
| _checkBounds(index); |
| switch (_absoluteIndex + index) { |
| case 0: |
| _struct._unique_data_item_0 = value; |
| break; |
| case 1: |
| _struct._unique_data_item_1 = value; |
| break; |
| case 2: |
| _struct._unique_data_item_2 = value; |
| break; |
| case 3: |
| _struct._unique_data_item_3 = value; |
| break; |
| case 4: |
| _struct._unique_data_item_4 = value; |
| break; |
| case 5: |
| _struct._unique_data_item_5 = value; |
| break; |
| default: |
| throw Exception('Invalid Array Helper generated.'); |
| } |
| } |
| } |
| |
| class Struct3 extends ffi.Struct { |
| @ffi.Int32() |
| external int a; |
| |
| @ffi.Int32() |
| external int b; |
| |
| @ffi.Int32() |
| external int c; |
| } |
| |
| typedef _c_Function1Bool = ffi.Uint8 Function( |
| ffi.Uint8 x, |
| ); |
| |
| typedef _dart_Function1Bool = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Uint8 = ffi.Uint8 Function( |
| ffi.Uint8 x, |
| ); |
| |
| typedef _dart_Function1Uint8 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Uint16 = ffi.Uint16 Function( |
| ffi.Uint16 x, |
| ); |
| |
| typedef _dart_Function1Uint16 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Uint32 = ffi.Uint32 Function( |
| ffi.Uint32 x, |
| ); |
| |
| typedef _dart_Function1Uint32 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Uint64 = ffi.Uint64 Function( |
| ffi.Uint64 x, |
| ); |
| |
| typedef _dart_Function1Uint64 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Int8 = ffi.Int8 Function( |
| ffi.Int8 x, |
| ); |
| |
| typedef _dart_Function1Int8 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Int16 = ffi.Int16 Function( |
| ffi.Int16 x, |
| ); |
| |
| typedef _dart_Function1Int16 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Int32 = ffi.Int32 Function( |
| ffi.Int32 x, |
| ); |
| |
| typedef _dart_Function1Int32 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Int64 = ffi.Int64 Function( |
| ffi.Int64 x, |
| ); |
| |
| typedef _dart_Function1Int64 = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1IntPtr = ffi.IntPtr Function( |
| ffi.IntPtr x, |
| ); |
| |
| typedef _dart_Function1IntPtr = int Function( |
| int x, |
| ); |
| |
| typedef _c_Function1Float = ffi.Float Function( |
| ffi.Float x, |
| ); |
| |
| typedef _dart_Function1Float = double Function( |
| double x, |
| ); |
| |
| typedef _c_Function1Double = ffi.Double Function( |
| ffi.Double x, |
| ); |
| |
| typedef _dart_Function1Double = double Function( |
| double x, |
| ); |
| |
| typedef _c_getStruct1 = ffi.Pointer<Struct1> Function(); |
| |
| typedef _dart_getStruct1 = ffi.Pointer<Struct1> Function(); |
| |
| typedef _c_Function1StructReturnByValue = Struct3 Function( |
| ffi.Int32 a, |
| ffi.Int32 b, |
| ffi.Int32 c, |
| ); |
| |
| typedef _dart_Function1StructReturnByValue = Struct3 Function( |
| int a, |
| int b, |
| int c, |
| ); |
| |
| typedef _c_Function1StructPassByValue = ffi.Int32 Function( |
| Struct3 sum_a_b_c, |
| ); |
| |
| typedef _dart_Function1StructPassByValue = int Function( |
| Struct3 sum_a_b_c, |
| ); |