// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names

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

import 'package:ffi/ffi.dart';

/// Bindings for `src/readability.h`.
///
/// Regenerate bindings with `dart run ffigen --config ffigen.yaml`.
///
class ReadabilityBindings {
  /// Holds the symbol lookup function.
  final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
      _lookup;

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

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

  CArticle Parse(
    ffi.Pointer<Utf8> url,
  ) {
    return _Parse(
      url,
    );
  }

  late final _ParsePtr =
      _lookup<ffi.NativeFunction<CArticle Function(ffi.Pointer<Utf8>)>>(
          'Parse');
  late final _Parse =
      _ParsePtr.asFunction<CArticle Function(ffi.Pointer<Utf8>)>();

  void FreeArticle(
    CArticle article,
  ) {
    return _FreeArticle(
      article,
    );
  }

  late final _FreeArticlePtr =
      _lookup<ffi.NativeFunction<ffi.Void Function(CArticle)>>('FreeArticle');
  late final _FreeArticle =
      _FreeArticlePtr.asFunction<void Function(CArticle)>();
}

final class _GoString_ extends ffi.Struct {
  external ffi.Pointer<Utf8> p;

  @ptrdiff_t()
  external int n;
}

typedef ptrdiff_t = ffi.Long;
typedef Dartptrdiff_t = int;

final class CArticle extends ffi.Struct {
  external ffi.Pointer<Utf8> title;

  external ffi.Pointer<Utf8> author;

  @ffi.Int()
  external int length;

  external ffi.Pointer<Utf8> excerpt;

  external ffi.Pointer<Utf8> site_name;

  external ffi.Pointer<Utf8> image_url;

  external ffi.Pointer<Utf8> favicon_url;

  /// HTML content
  external ffi.Pointer<Utf8> content;

  /// text content
  external ffi.Pointer<Utf8> text_content;

  external ffi.Pointer<Utf8> language;

  external ffi.Pointer<Utf8> published_time;

  external ffi.Pointer<Utf8> err;

  @ffi.Int()
  external int success;
}

final class GoInterface extends ffi.Struct {
  external ffi.Pointer<ffi.Void> t;

  external ffi.Pointer<ffi.Void> v;
}

final class GoSlice extends ffi.Struct {
  external ffi.Pointer<ffi.Void> data;

  @GoInt()
  external int len;

  @GoInt()
  external int cap;
}

typedef GoInt = GoInt64;
typedef GoInt64 = ffi.LongLong;
typedef DartGoInt64 = int;
