Commit Graph
4 Commits
Author SHA1 Message Date
Adrià Arrufat 11f38b9787 c_api: add lp_last_error functions
Expose `lp_last_error` and `lp_browser_last_error` in the C API to
retrieve the error name of the most recent failing call.
2026-08-03 09:24:58 +02:00
Adrià Arrufat 8c0e20cdbc c-api: use explicit string lengths 2026-08-03 09:16:05 +02:00
Adrià Arrufat 6f2fbb12ed build: rename lib-shared and lib-test targets 2026-07-31 21:15:42 +02:00
Adrià Arrufat 65a88617ec c-api: expose liblightpanda.so and C header for embedding
A C ABI (include/lightpanda.h + src/c_api.zig) over the browser tool
surface: lp_init/lp_shutdown, lp_fetch, sessions with lp_call/pump/
cancel, lp_tools_json. Built as a shared library only; the version
script keeps everything but lp_* internal so the bundled OpenSSL/curl/
sqlite cannot collide with a host's own.

Embedders get a hidden 'embed' Config mode (not parseable from the
CLI) with telemetry defaulting off; crash reports honor the same
opt-out. ToolSession in lightpanda.zig owns the browser/session/
registry lifecycle the C API drives.

Build: C deps are always PIC (like boringssl's force_pic) and the
pinned zig-v8-fork always builds V8 library-safe, so 'zig build
shared-lib' needs no flags. It only refuses -Dprebuilt_v8_path:
today's published archives are exe-only (local-exec TLS, malloc
shim); the guard goes away once a fork release ships library-safe
archives. make lib-shared / lib-test / lib-shared-example drive it.
2026-07-31 17:49:02 +02:00