// ignore_for_file: camel_case_types, non_constant_identifier_names

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
import 'dart:ffi' as ffi;

/// Bindings to IrisApiEngine
class NativeIrisTesterBinding {
  /// Holds the symbol lookup function.
  final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
      _lookup;

  /// The symbols are looked up in [dynamicLibrary].
  NativeIrisTesterBinding(ffi.DynamicLibrary dynamicLibrary)
      : _lookup = dynamicLibrary.lookup;

  /// The symbols are looked up with [lookup].
  NativeIrisTesterBinding.fromLookup(
      ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
          lookup)
      : _lookup = lookup;

  IrisApiEnginePtr CreateDebugApiEngine() {
    return _CreateDebugApiEngine();
  }

  late final _CreateDebugApiEnginePtr =
      _lookup<ffi.NativeFunction<IrisApiEnginePtr Function()>>(
          'CreateDebugApiEngine');
  late final _CreateDebugApiEngine =
      _CreateDebugApiEnginePtr.asFunction<IrisApiEnginePtr Function()>();

  ffi.Pointer<ffi.Void> CreateFakeRtcEngine() {
    return _CreateFakeRtcEngine();
  }

  late final _CreateFakeRtcEnginePtr =
      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Void> Function()>>(
          'CreateFakeRtcEngine');
  late final _CreateFakeRtcEngine =
      _CreateFakeRtcEnginePtr.asFunction<ffi.Pointer<ffi.Void> Function()>();

  void DestroyFakeRtcEngine(ffi.Pointer<ffi.Void> handle) {
    return _DestroyFakeRtcEngine(handle);
  }

  late final _DestroyFakeRtcEnginePtr =
      _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
          'DestroyFakeRtcEngine');
  late final _DestroyFakeRtcEngine = _DestroyFakeRtcEnginePtr.asFunction<
      void Function(ffi.Pointer<ffi.Void>)>();

// IRIS_API void IRIS_CALL DestroyFakeRtcEngine(void *handle);

  void MockApiResult(
    ffi.Pointer<ffi.Int8> apiType,
    ffi.Pointer<ffi.Int8> param,
    int paramLength,
  ) {
    return _MockApiResult(
      apiType,
      param,
      paramLength,
    );
  }

  late final _MockApiResultPtr = _lookup<
      ffi.NativeFunction<
          ffi.Void Function(ffi.Pointer<ffi.Int8>, ffi.Pointer<ffi.Int8>,
              ffi.Int32)>>('MockApiResult');
  late final _MockApiResult = _MockApiResultPtr.asFunction<
      void Function(ffi.Pointer<ffi.Int8>, ffi.Pointer<ffi.Int8>, int)>();

  void MockApiReturnCode(
    ffi.Pointer<ffi.Int8> apiType,
    int code,
  ) {
    return _MockApiReturnCode(
      apiType,
      code,
    );
  }

  late final _MockApiReturnCodePtr = _lookup<
          ffi
          .NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Int8>, ffi.Int32)>>(
      'MockApiReturnCode');
  late final _MockApiReturnCode = _MockApiReturnCodePtr.asFunction<
      void Function(ffi.Pointer<ffi.Int8>, int)>();

  int ExpectCalled(
    ffi.Pointer<ffi.Int8> func_name,
    ffi.Pointer<ffi.Int8> params,
    int paramLength,
    ffi.Pointer<ffi.Pointer<ffi.Void>> buffers,
    int buffer_count,
  ) {
    return _ExpectCalled(
      func_name,
      params,
      paramLength,
      buffers,
      buffer_count,
    );
  }

  late final _ExpectCalledPtr = _lookup<
      ffi.NativeFunction<
          ffi.Int32 Function(
              ffi.Pointer<ffi.Int8>,
              ffi.Pointer<ffi.Int8>,
              ffi.Uint32,
              ffi.Pointer<ffi.Pointer<ffi.Void>>,
              ffi.Uint32)>>('ExpectCalled');
  late final _ExpectCalled = _ExpectCalledPtr.asFunction<
      int Function(ffi.Pointer<ffi.Int8>, ffi.Pointer<ffi.Int8>, int,
          ffi.Pointer<ffi.Pointer<ffi.Void>>, int)>();

  int TriggerEventWithFakeApiEngine(
    ffi.Pointer<ffi.Void> api_engine,
    ffi.Pointer<ApiParam> param,
  ) {
    return _TriggerEventWithFakeApiEngine(
      api_engine,
      param,
    );
  }

  late final _TriggerEventWithFakeApiEnginePtr = _lookup<
      ffi.NativeFunction<
          ffi.Int32 Function(ffi.Pointer<ffi.Void>,
              ffi.Pointer<ApiParam>)>>('TriggerEventWithFakeApiEngine');
  late final _TriggerEventWithFakeApiEngine = _TriggerEventWithFakeApiEnginePtr
      .asFunction<int Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ApiParam>)>();

  int TriggerEventWithFakeRtcEngine(
    ffi.Pointer<ffi.Void> rtc_engine,
    ffi.Pointer<ApiParam> param,
  ) {
    return _TriggerEventWithFakeRtcEngine(
      rtc_engine,
      param,
    );
  }

  late final _TriggerEventWithFakeRtcEnginePtr = _lookup<
      ffi.NativeFunction<
          ffi.Int32 Function(ffi.Pointer<ffi.Void>,
              ffi.Pointer<ApiParam>)>>('TriggerEventWithFakeRtcEngine');
  late final _TriggerEventWithFakeRtcEngine = _TriggerEventWithFakeRtcEnginePtr
      .asFunction<int Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ApiParam>)>();

  void SetShouldReadBufferFromJson(
    int readBufferFromJson,
  ) {
    return _SetShouldReadBufferFromJson(
      readBufferFromJson,
    );
  }

  late final _SetShouldReadBufferFromJsonPtr =
      _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int32)>>(
          'SetShouldReadBufferFromJson');
  late final _SetShouldReadBufferFromJson =
      _SetShouldReadBufferFromJsonPtr.asFunction<void Function(int)>();
}

typedef IrisApiEnginePtr = ffi.Pointer<ffi.Void>;
typedef ApiParam = EventParam;

class EventParam extends ffi.Struct {
  external ffi.Pointer<ffi.Int8> event;

  external ffi.Pointer<ffi.Int8> data;

  @ffi.Uint32()
  external int data_size;

  external ffi.Pointer<ffi.Int8> result;

  external ffi.Pointer<ffi.Pointer<ffi.Void>> buffer;

  external ffi.Pointer<ffi.Uint32> length;

  @ffi.Uint32()
  external int buffer_count;
}
