Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions make/help.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ help:
@echo " make test:integration:node - Run Node.js SDK integration tests (requires VM)"
@echo " make test:all:node - Run all Node.js SDK tests"
@echo " make test:unit:go - Run Go SDK unit tests"
@echo " make test:integration:go - Run Go SDK archive round-trip test (requires VM, FILTER=<pattern>)"
@echo " make test:all:go - Run all Go SDK tests"
@echo " make test:unit:c - Run C SDK unit tests (no VM required)"
@echo " make test:integration:c - Run C SDK integration tests (requires VM)"
Expand Down
6 changes: 6 additions & 0 deletions make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ test\:unit\:go:
@$(MAKE) dev:go
@cd sdks/go && go test -tags boxlite_dev -v $(GOTEST_FILTER) ./...

# Go SDK archive round-trip integration test. Intentionally excluded from
# default test matrices and CI.
test\:integration\:go: dev\:go
@echo "🧪 Running Go SDK archive integration test (requires VM)..."
@cd sdks/go && go test -count=1 -tags=boxlite_dev,boxlite_integration -v $(GOTEST_FILTER) ./integration/archive

# Go SDK full suite.
test\:all\:go:
@$(MAKE) test:unit:go
Expand Down
36 changes: 32 additions & 4 deletions sdks/c/include/boxlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,20 @@ typedef struct FFIError {
char *message;
} FFIError;

typedef struct RuntimeHandle CBoxliteRuntime;

typedef struct OptionsHandle CBoxliteOptions;

typedef struct BoxHandle CBoxHandle;

typedef struct FFIError CBoxliteError;

// Box export completion.
typedef void (*CBoxExportCb)(char*, CBoxliteError*, void*);

typedef struct RuntimeHandle CBoxliteRuntime;

// Runtime import completion.
typedef void (*CRuntimeImportCb)(CBoxHandle*, CBoxliteError*, void*);

typedef struct OptionsHandle CBoxliteOptions;

// Box creation completion.
typedef void (*CBoxCreateBoxCb)(CBoxHandle*, CBoxliteError*, void*);

Expand Down Expand Up @@ -463,6 +469,28 @@ enum BoxliteErrorCode boxlite_advanced_options_set_capabilities_drop(CAdvancedBo
const char *const *capabilities,
int count);

// Submit a box export.
//
// On success, the callback owns the returned path and must release it with
// `boxlite_free_string`. The archive itself is never deleted by this bridge.
enum BoxliteErrorCode boxlite_box_export(CBoxHandle *handle,
const char *dest,
CBoxExportCb cb,
void *user_data,
CBoxliteError *out_error);

// Submit a trusted archive import.
//
// A null or empty `name_or_null` leaves the new box unnamed. The callback
// owns the returned stopped box handle. The caller retains ownership of the
// archive file; this bridge never removes it.
enum BoxliteErrorCode boxlite_runtime_import(CBoxliteRuntime *runtime,
const char *archive_path,
const char *name_or_null,
CRuntimeImportCb cb,
void *user_data,
CBoxliteError *out_error);

enum BoxliteErrorCode boxlite_create_box(CBoxliteRuntime *runtime,
CBoxliteOptions *opts,
CBoxCreateBoxCb cb,
Expand Down
Loading
Loading