c_kit 0.0.1 copy "c_kit: ^0.0.1" to clipboard
c_kit: ^0.0.1 copied to clipboard

A comprehensive Dart FFI suite combining popular header-only C libraries into a single native powerhouse for Flutter and Dart projects.

c_kit #

c_kit is a lightweight, high-performance native powerhouse toolkit that bundles essential single-header/single-file C libraries into the Flutter and Dart ecosystems using Dart FFI (Foreign Function Interface).


πŸ“¦ Included Native Libraries (Ecosystem) #

c_kit consolidates the following core utilities and the popular stb series, categorized by their distinct feature domains:

1. Core Utilities & Frameworks #

  • miniaudio.h (Audio Engine): A fully-featured playback and recording audio processing engine. It interfaces directly with low-latency native audio frameworks.
  • miniz.h (Data Compression): A high-performance, open-source replacement for zlib. It handles ZIP archive reading/writing and Deflate algorithm configurations.
  • cJSON.h (JSON Parser): An ultra-lightweight, ANSI C-compliant JSON parser and generator designed for fast string conversion at the native layer.
  • http_parser.h (Network Stream Parser): A fast, stream-based HTTP request and response parser tailored for raw memory buffers.
  • monocypher.h (Cryptography): A modern, lightweight cryptographic library providing clean implementations for hashing, encryption, and digital signatures.

2. Graphics & Text Processing (stb Series) #

  • stb_image.h & stb_image_write.h: Decodes various image formats (JPEG, PNG, BMP, GIF, etc.) into raw pixel arrays (Uint8List) and encodes raw memory buffers back into image files on disk.
  • stb_image_resize2.h: High-quality image resizing using advanced filtering algorithms like Mitchell, Lanczos, or Cubic.
  • stb_rect_pack.h: An optimal 2D rectangle packing library designed to minimize wasted space in textures or custom rendering structures.
  • stb_truetype.h: Handles vector font files (TTF/OTF) and performs fast text rasterization (vector-to-bitmap conversion).

3. Low-Level Development Tools #

  • stb_ds.h: Provides typesafe Dynamic Arrays (Vectors) and Hash Maps missing from standard C, drastically speeding up native data lookups.
  • stb_sprintf.h: A fast, memory-safe, drop-in replacement for the standard sprintf formatting utility.
  • stb_leakcheck.h: Tracks allocations and frees to trace down hidden memory leaks within the native boundaries during development.

πŸ› οΈ Architecture & Compilation Strategy #

To eliminate the build complexities of managing dozens of independent .c files, c_kit implements a Single-file Master Compilation pattern.

Everything is encapsulated within src/c_kit.c, where specific implementation macros are unlocked before binding, ensuring an extremely small binary footprint and maximum linking speed.

  Flutter / Dart Layer (FFI)
           β”‚
           β–Ό  (Dart Bindings via ffigen)
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚    c_kit.c    β”‚  ◄─── [Master Entry Point]
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
           β”œβ”€β–Ί miniaudio.h (Audio)
           β”œβ”€β–Ί miniz.h     (Compression)
           β”œβ”€β–Ί stb_image.h (Graphics)
           └─► stb_ds.h    (Data Structures)

c_kit #

A high-performance Dart FFI toolkit.

πŸ‘‰ α€™α€Όα€”α€Ία€™α€¬α€˜α€¬α€žα€¬α€–α€Όα€„α€·α€Ί ဖတ်ရန် (Read in Myanmar)

0
likes
150
points
34
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A comprehensive Dart FFI suite combining popular header-only C libraries into a single native powerhouse for Flutter and Dart projects.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

code_assets, ffi, hooks, logging, native_toolchain_c

More

Packages that depend on c_kit