|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
#include <runtime.h>
Data Fields | |
| mln_resource_provider_callback | callback |
| mln_user_data_release | release_user_data |
| mln_delivery_queue | queue |
| const mln_resource_route * | routes |
Resource provider state.
The struct itself is borrowed for the registering call, which copies every route and string before it returns. Exactly one of callback and queue is set. Routes apply in both modes: with routes, a request that matches none passes through to native loading without reaching the provider. Without routes, every network request reaches the provider.
| mln_resource_provider_callback mln_resource_provider::callback |
Decides each request that the routes leave to the provider.
Required in callback mode; null in queue mode.
| mln_delivery_queue mln_resource_provider::queue |
Optional. Queue delivery: native code answers each request MLN_RESOURCE_PROVIDER_DECISION_HANDLE and queues a copy of the request with its handle as an MLN_DELIVERY_TYPE_RESOURCE_REQUEST delivery carrying user_data. A request the queue refuses, because the queue was released or the copy could not be allocated, fails without native loading, except during process exit, which passes it through. After replacement, clear, or runtime teardown retires the registration, the queue receives one MLN_DELIVERY_TYPE_RETIRED delivery carrying user_data, after the registration's last request delivery.
| mln_user_data_release mln_resource_provider::release_user_data |
Optional. Releases user_data exactly once for each accepted registration, after replacement, clear, or runtime teardown has retired the registration and every in-flight callback has returned.
It may run on a runtime, worker, network, or closing thread, and never runs for a rejected registration. Another thread may retire an accepted registration before its registration function returns, so the caller transfers user_data before entering that function and reclaims it only when the registration is rejected. Null in queue mode.
| const mln_resource_route* mln_resource_provider::routes |
The requests that reach the provider; empty to claim every request.