c-library

A Nikaia package C calls (ADR-284): artifact = "c-library" in nikaia.toml makes a shared and a static library and wordtally.h, and every pub extern fn is an entry point.

nikaia build
cc -I target/nikaia/c-library use.c -L target/nikaia/c-library -lwordtally -o use
LD_LIBRARY_PATH=target/nikaia/c-library ./use
9 words, the longest "quick" (status 0)
the first two words of "Hello NIKAIA from c":
  Hello (mixed)
  NIKAIA (upper)
stopped after 2

What crosses, in src/main.nika and use.c:

crates/nikaia/tests/it/c_library.rs builds it in place under --locked, compiles use.c against it, and checks that output.

This site is open source. Improve this page.