| // 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 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Bool>>('Function1Bool') |
| .asFunction<_dart_Function1Bool>())( |
| x ? 1 : 0, |
| ) != |
| 0; |
| } |
| |
| _dart_Function1Bool? _Function1Bool; |
| |
| int Function1Uint8( |
| int x, |
| ) { |
| return (_Function1Uint8 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Uint8>>('Function1Uint8') |
| .asFunction<_dart_Function1Uint8>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Uint8? _Function1Uint8; |
| |
| int Function1Uint16( |
| int x, |
| ) { |
| return (_Function1Uint16 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Uint16>>('Function1Uint16') |
| .asFunction<_dart_Function1Uint16>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Uint16? _Function1Uint16; |
| |
| int Function1Uint32( |
| int x, |
| ) { |
| return (_Function1Uint32 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Uint32>>('Function1Uint32') |
| .asFunction<_dart_Function1Uint32>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Uint32? _Function1Uint32; |
| |
| int Function1Uint64( |
| int x, |
| ) { |
| return (_Function1Uint64 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Uint64>>('Function1Uint64') |
| .asFunction<_dart_Function1Uint64>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Uint64? _Function1Uint64; |
| |
| int Function1Int8( |
| int x, |
| ) { |
| return (_Function1Int8 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Int8>>('Function1Int8') |
| .asFunction<_dart_Function1Int8>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Int8? _Function1Int8; |
| |
| int Function1Int16( |
| int x, |
| ) { |
| return (_Function1Int16 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Int16>>('Function1Int16') |
| .asFunction<_dart_Function1Int16>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Int16? _Function1Int16; |
| |
| int Function1Int32( |
| int x, |
| ) { |
| return (_Function1Int32 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Int32>>('Function1Int32') |
| .asFunction<_dart_Function1Int32>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Int32? _Function1Int32; |
| |
| int Function1Int64( |
| int x, |
| ) { |
| return (_Function1Int64 ??= |
| _lookup<ffi.NativeFunction<_c_Function1Int64>>('Function1Int64') |
| .asFunction<_dart_Function1Int64>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Int64? _Function1Int64; |
| |
| int Function1IntPtr( |
| int x, |
| ) { |
| return (_Function1IntPtr ??= |
| _lookup<ffi.NativeFunction<_c_Function1IntPtr>>('Function1IntPtr') |
| .asFunction<_dart_Function1IntPtr>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1IntPtr? _Function1IntPtr; |
| |
| double Function1Float( |
| double x, |
| ) { |
| return (_Function1Float ??= |
| _lookup<ffi.NativeFunction<_c_Function1Float>>('Function1Float') |
| .asFunction<_dart_Function1Float>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Float? _Function1Float; |
| |
| double Function1Double( |
| double x, |
| ) { |
| return (_Function1Double ??= |
| _lookup<ffi.NativeFunction<_c_Function1Double>>('Function1Double') |
| .asFunction<_dart_Function1Double>())( |
| x, |
| ); |
| } |
| |
| _dart_Function1Double? _Function1Double; |
| |
| ffi.Pointer<Struct1> getStruct1() { |
| return (_getStruct1 ??= |
| _lookup<ffi.NativeFunction<_c_getStruct1>>('getStruct1') |
| .asFunction<_dart_getStruct1>())(); |
| } |
| |
| _dart_getStruct1? _getStruct1; |
| |
| Struct3 Function1StructReturnByValue( |
| int a, |
| int b, |
| int c, |
| ) { |
| return (_Function1StructReturnByValue ??= |
| _lookup<ffi.NativeFunction<_c_Function1StructReturnByValue>>( |
| 'Function1StructReturnByValue') |
| .asFunction<_dart_Function1StructReturnByValue>())( |
| a, |
| b, |
| c, |
| ); |
| } |
| |
| _dart_Function1StructReturnByValue? _Function1StructReturnByValue; |
| |
| int Function1StructPassByValue( |
| Struct3 sum_a_b_c, |
| ) { |
| return (_Function1StructPassByValue ??= |
| _lookup<ffi.NativeFunction<_c_Function1StructPassByValue>>( |
| 'Function1StructPassByValue') |
| .asFunction<_dart_Function1StructPassByValue>())( |
| sum_a_b_c, |
| ); |
| } |
| |
| _dart_Function1StructPassByValue? _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, |
| ); |