tree: d83fb989cf1fad71e7f539db7f8e5c447b7e6bc3 [path history] [tgz]
  1. cjson_generated_bindings.dart
  2. config.yaml
  3. example.json
  4. main.dart
  5. pubspec.yaml
  6. README.md
pkgs/ffigen/example/c_json/README.md

cJson example

Demonstrates generation of bindings for a C library called cJson and then using these bindings to parse some json.

Building the cJson dynamic library

From the root of this repository -

cd third_party/cjson_library
cmake .
make

Generating bindings

At the root of this example (example/c_json), run -

dart run ffigen --config config.yaml

This will generate bindings in a file: cjson_generated_bindings.dart

Running the example

dart main.dart