c_kit 0.0.1
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 forzlib. 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 standardsprintfformatting 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)