|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_buffer_view |
Macros | |
| #define | MLN_HANDLE_NULL ((uint64_t)0) |
Typedefs | |
| typedef enum mln_status | mln_status |
| typedef enum mln_render_backend_flag | mln_render_backend_flag |
| typedef uint64_t | mln_runtime |
| typedef struct mln_buffer_view | mln_buffer_view |
Enumerations | |
| enum | mln_status : int32_t { } |
| enum | mln_render_backend_flag : uint32_t |
Functions | |
| mln_status | mln_buffer_get (mln_buffer buffer, mln_buffer_view *out_view) |
| void | mln_buffer_destroy (mln_buffer buffer) |
| uint32_t | mln_c_version (void) |
| uint32_t | mln_supported_render_backend_mask (void) |
Public C API declarations for base ABI types and status values.
| #define MLN_HANDLE_NULL ((uint64_t)0) |
The null handle, for every handle type.
A live handle always carries a nonzero kind tag, so this value names no object of any type. Status-returning functions reject it. Void release functions accept it as a no-op. Output handle parameters that create or acquire ownership require *out_handle to equal it on entry.
| typedef struct mln_buffer_view mln_buffer_view |
Borrowed data. The data pointer may be null only when size is zero.
Each parameter documents whether its view contains UTF-8 text, serialized data, or arbitrary bytes. The view carries no ownership and requires no trailing null byte.
| typedef enum mln_render_backend_flag mln_render_backend_flag |
Render backend support flags reported by this native library build.
| typedef uint64_t mln_runtime |
Handles are opaque 64-bit generational ids.
Each id packs the handle's type, a slot index, and a reuse generation, so a released handle stays distinguishable from every later handle. Passing a released id, an id of the wrong type, or a value this library never issued reports MLN_STATUS_INVALID_ARGUMENT and leaves the call without effect; mln_thread_last_error_message() distinguishes the cases. Handle values are safe to copy, compare, hash, and move between threads, and carry no ownership on their own.
The bit layout is internal. Hosts pass handles back as issued rather than decoding or synthesizing them.
| typedef enum mln_status mln_status |
Status values returned by status-returning functions.
| enum mln_render_backend_flag : uint32_t |
Render backend support flags reported by this native library build.
| enum mln_status : int32_t |
Status values returned by status-returning functions.
| void mln_buffer_destroy | ( | mln_buffer | buffer | ) |
Destroys an owned buffer. A null handle is a no-op.
| mln_status mln_buffer_get | ( | mln_buffer | buffer, |
| mln_buffer_view * | out_view ) |
Borrows the data stored by an owned buffer.
The view remains valid until buffer is destroyed. The caller must not access it concurrently with mln_buffer_destroy().
Returns:
| uint32_t mln_c_version | ( | void | ) |
Reports the C ABI contract version. The value is 0 while the ABI is unstable, and will increment on each SemVer major release.
| uint32_t mln_supported_render_backend_mask | ( | void | ) |
Reports the render backends available in this native library build.
The return value is a mask of mln_render_backend_flag values.