Skip to main content

Overview

The C SDK provides C-compatible FFI bindings for integrating BoxLite into C/C++ applications. Library: libboxlite Header: boxlite.h

API Styles

The SDK provides two API styles:
  1. Simple API (boxlite_simple_*) - Convenience layer for common use cases
    • No JSON required
    • Auto-managed runtime
    • Buffered command results
  2. Native API (boxlite_*) - Full-featured, flexible interface
    • JSON configuration
    • Streaming output callbacks
    • Advanced features (volumes, networking, etc.)

Quick Start

Native API (Full Control)

Building

Runtime Functions

boxlite_version

Get BoxLite version string.
Returns static string (do not free).

boxlite_runtime_new

Create a new runtime instance.

Parameters

Example

boxlite_runtime_shutdown

Gracefully stop all running boxes.

Parameters

boxlite_runtime_free

Free a runtime instance.
Safe to call with NULL. Automatically frees all boxes.

Simple API

The Simple API provides a streamlined interface for common use cases without JSON configuration.

boxlite_simple_new

Create and auto-start a box with sensible defaults.

Parameters

Returns

BoxliteErrorCode - Ok on success, error code on failure.

Example

boxlite_simple_run

Run a command and get buffered result.

Parameters

Result Structure

Example

boxlite_simple_free

Free a simple box (auto-stops and removes).
Safe to call with NULL.

boxlite_result_free

Free an execution result.
Safe to call with NULL.

Platform Requirements

API Summary

See Also

Native API

Box creation, command execution, and lifecycle functions for full control over BoxLite.

Memory, JSON & Threading

Memory management rules, JSON schema reference, and thread safety patterns.

Errors & Metrics

Error codes, error handling patterns, and runtime/box metrics.

C Quick Start

Get up and running with the C SDK in 5 minutes.