Module ffi

Module ffi 

Source
Expand description

FFI Layer - Multi-language SDK Support

This module provides a C-compatible Foreign Function Interface (FFI) that enables the web server abstraction to be used from other programming languages.

Structs§

FfiContext
FFI context for managing server instances and state
PythonServerHandle
Python bindings helper structures

Constants§

FFI_ERROR_INTERNAL
FFI_ERROR_INVALID_ARGUMENT
FFI_ERROR_NULL_POINTER
FFI_ERROR_SERVER_NOT_FOUND
FFI_SUCCESS
C-compatible result codes

Functions§

generate_c_header
Generate C header file content for FFI bindings
save_c_header
Save C header to file
ws_add_route
Add a route to the server Returns FFI_SUCCESS on success, negative value on error
ws_bind_server
Bind server to an address Returns FFI_SUCCESS on success, negative value on error
ws_create_go_server
Go bindings helper - create server with Go-style error handling
ws_create_nodejs_server
Node.js bindings helper - create server with callback support
ws_create_python_server
Create Python-compatible server handle
ws_create_server
Create a new web server instance Returns server ID on success, negative value on error
ws_destroy_server
Destroy a server instance Returns FFI_SUCCESS on success, negative value on error
ws_ffi_cleanup
Cleanup the FFI library (call at program exit)
ws_ffi_init
Initialize the FFI library Returns FFI_SUCCESS on success
ws_free_string
Free a string allocated by the FFI
ws_get_last_error
Get the last error message Returns pointer to error string (caller must free with ws_free_string) Returns null if no error
ws_get_version
Get library version Returns pointer to version string (caller must free with ws_free_string)
ws_is_server_running
Check if server is running Returns 1 if running, 0 if not running, negative value on error
ws_start_server
Start the server Returns FFI_SUCCESS on success, negative value on error
ws_stop_server
Stop the server Returns FFI_SUCCESS on success, negative value on error