blob: 39e098469a92543f9933c6e12e1f3313f28a2550 [file] [log] [blame] [edit]
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: deprecated_member_use
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
@ffi.DefaultAsset('package:ffinative_example/generated_bindings.dart')
library;
import 'dart:ffi' as ffi;
import '' as self;
/// Adds 2 integers.
@ffi.Native<ffi.Int Function(ffi.Int, ffi.Int)>()
external int sum(
int a,
int b,
);
/// Subtracts 2 integers.
@ffi.Native<ffi.Int Function(ffi.Int, ffi.Int)>()
external int subtract(
int a,
int b,
);
/// Multiplies 2 integers, returns pointer to an integer,.
@ffi.Native<ffi.Pointer<ffi.Int> Function(ffi.Int, ffi.Int)>()
external ffi.Pointer<ffi.Int> multiply(
int a,
int b,
);
/// Divides 2 integers, returns pointer to a float.
@ffi.Native<ffi.Pointer<ffi.Float> Function(ffi.Int, ffi.Int)>()
external ffi.Pointer<ffi.Float> divide(
int a,
int b,
);
/// Divides 2 floats, returns a pointer to double.
@ffi.Native<ffi.Pointer<ffi.Double> Function(ffi.Float, ffi.Float)>()
external ffi.Pointer<ffi.Double> dividePrecision(
double a,
double b,
);
@ffi.Native<ffi.Int>()
external int log_level;
@ffi.Array.multi([5])
@ffi.Native<ffi.Array<ffi.Int>>()
external ffi.Array<ffi.Int> array;
/// Version of the native C library
@ffi.Native<ffi.Pointer<ffi.Char>>()
external final ffi.Pointer<ffi.Char> library_version;
const addresses = _SymbolAddresses();
class _SymbolAddresses {
const _SymbolAddresses();
ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Int, ffi.Int)>> get sum =>
ffi.Native.addressOf(self.sum);
ffi.Pointer<ffi.Pointer<ffi.Char>> get library_version =>
ffi.Native.addressOf(self.library_version);
}