MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1
5
6#ifndef MAPLIBRE_NATIVE_C_BASE_H
7#define MAPLIBRE_NATIVE_C_BASE_H
8
9#ifndef __cplusplus
10#include <stdbool.h>
11#endif
12
13#include <stddef.h>
14#include <stdint.h>
15
16#ifdef _WIN32
17#if defined(MLN_STATIC)
18#define MLN_API
19#elif defined(MLN_BUILDING_C)
20#define MLN_API __declspec(dllexport)
21#else
22#define MLN_API __declspec(dllimport)
23#endif
24#else
25#define MLN_API __attribute__((visibility("default")))
26#endif
27
28#ifdef __cplusplus
29#define MLN_NOEXCEPT noexcept
30#else
31#define MLN_NOEXCEPT
32#endif
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
53
55typedef enum mln_render_backend_flag : uint32_t {
56 MLN_RENDER_BACKEND_FLAG_METAL = 1u << 0u,
57 MLN_RENDER_BACKEND_FLAG_VULKAN = 1u << 1u,
58 MLN_RENDER_BACKEND_FLAG_OPENGL = 1u << 2u,
59 MLN_RENDER_BACKEND_FLAG_WEBGPU = 1u << 3u,
61
70#define MLN_HANDLE_NULL ((uint64_t)0)
71
86typedef uint64_t mln_runtime;
87typedef uint64_t mln_map;
88typedef uint64_t mln_map_projection;
89typedef uint64_t mln_offline_region_snapshot;
90typedef uint64_t mln_offline_region_list;
91typedef uint64_t mln_buffer;
92typedef uint64_t mln_resource_request_handle;
93typedef uint64_t mln_render_session;
94typedef uint64_t mln_wake_source;
95
103typedef struct mln_buffer_view {
104 const void* data;
105 size_t size;
107
120MLN_API mln_status
121mln_buffer_get(mln_buffer buffer, mln_buffer_view* out_view) MLN_NOEXCEPT;
122
124MLN_API void mln_buffer_destroy(mln_buffer buffer) MLN_NOEXCEPT;
125
130MLN_API uint32_t mln_c_version(void) MLN_NOEXCEPT;
131
137MLN_API uint32_t mln_supported_render_backend_mask(void) MLN_NOEXCEPT;
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif // MAPLIBRE_NATIVE_C_BASE_H
void mln_buffer_destroy(mln_buffer buffer)
mln_status mln_buffer_get(mln_buffer buffer, mln_buffer_view *out_view)
uint64_t mln_runtime
Definition base.h:86
mln_status
Definition base.h:39
@ MLN_STATUS_NATIVE_ERROR
Definition base.h:51
@ MLN_STATUS_UNSUPPORTED
Definition base.h:49
@ MLN_STATUS_INVALID_STATE
Definition base.h:44
@ MLN_STATUS_WRONG_THREAD
Definition base.h:47
@ MLN_STATUS_INVALID_ARGUMENT
Definition base.h:42
mln_render_backend_flag
Definition base.h:55
uint32_t mln_supported_render_backend_mask(void)
uint32_t mln_c_version(void)
Definition base.h:103