ffi_universe 0.0.8 copy "ffi_universe: ^0.0.8" to clipboard
ffi_universe: ^0.0.8 copied to clipboard

Standarization FFI will bring support cross platform same style api for boost project

FFI UNIVERSE #

FFI UNIVERSE Standarization FFI will bring support cross platform same style api for boost project

Copyright (c) 2024 GLOBAL CORPORATION - GENERAL DEVELOPER

📚ī¸ Docs #

  1. Documentation
  2. Youtube
  3. Telegram Support Group
  4. Contact Developer (check social media or readme profile github)

🔖ī¸ Features #

  1. ✅ 📱ī¸ Cross Platform support (Device, Edge Severless functions)
  2. ✅ 📜ī¸ Standarization Style Code
  3. ✅ ⌨ī¸ Cli (Terminal for help you use this library or create project)
  4. ✅ đŸ”Ĩī¸ Api (If you developer bot / userbot you can use this library without interact cli just add library and use 🚀ī¸)
  5. ✅ 🧩ī¸ Customizable Extension (if you want add extension so you can more speed up on development)
  6. ✅ ✨ī¸ Pretty Information (user friendly for newbie)

❔ī¸ Fun Fact #

  • This library 100% use on every my create project (App, Server, Bot, Userbot)

📈ī¸ Proggres #

  • 10-02-2025 Starting Release Stable With core Features

đŸ“Ĩī¸ Install Library #

  1. Dart
dart pub add ffi_universe
copied to clipboard

🚀ī¸ Quick Start #

Example Quickstart script minimal for insight you or make you use this library because very simple

import 'dart:convert';
import 'package:ffi_universe/ffi_universe.dart';

typedef MainFunctionNative = Int Function(Int argc, Pointer<Pointer<Char>> argv);
typedef MainFunctionDart = int Function(int argc, Pointer<Pointer<Char>> argv);

typedef TestFunctionNative = Void Function(Pointer<Char> text);
typedef TestFunctionDart = void Function(Pointer<Char> text);

typedef InvokeFunctionNative = Pointer<Char> Function(Pointer<Char> parameters);
typedef InvokeFunctionDart = Pointer<Char> Function(Pointer<Char> parameters);

void main() async {
  final DynamicLibrary dynamicLibrary = await FFIUniverse.open(
    path: "libraryname",
  );

  /// main_function
  {
    final List<String> arguments = [
      "",
      "--help",
      "name",
    ];
    final MainFunctionDart mainFunction = dynamicLibrary.lookupFunction<MainFunctionNative, MainFunctionDart>("main");
    mainFunction(arguments.length, arguments.toNativeVectorChar());
  }

  /// test_function
  {
    final String text = "Hello";
    final Pointer<Utf8> textNative = text.toNativeUtf8();
    final TestFunctionDart testFunction = dynamicLibrary.lookupFunction<TestFunctionNative, TestFunctionDart>("test");
    testFunction(textNative.cast<Char>());
    malloc.free(textNative);
  }

  /// invoke_function
  {
    final Map<String, dynamic> parameters = {
      "@type": "getVersion",
    };
    final Pointer<Utf8> parametersNative = json.encode(parameters).toNativeUtf8();
    final InvokeFunctionDart invokeFunction = dynamicLibrary.lookupFunction<InvokeFunctionNative, InvokeFunctionDart>("invoke");
    final Pointer<Char> resultInvoke = invokeFunction(parametersNative.cast<Char>());
    print(resultInvoke.cast<Utf8>().toDartString());
    malloc.free(parametersNative);
  }

  dynamicLibrary.close();
}

copied to clipboard

Copyright (c) 2024 GLOBAL CORPORATION - GENERAL DEVELOPER

0
likes
150
points
4.33k
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.16 - 2025.03.31

Standarization FFI will bring support cross platform same style api for boost project

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com
github.com

License

MIT (license)

Dependencies

ffi, http, js, meta, path, web

More

Packages that depend on ffi_universe