Files
MeshPort/crates/meshport-ffi/include/meshport.h
T

23 lines
704 B
C

#ifndef MESHPORT_H
#define MESHPORT_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
uint32_t meshport_abi_version(void);
uint64_t meshport_context_new(void);
void meshport_context_free(uint64_t context);
/* Blocking; run off the UI thread. Owned JSON result, free exactly once. */
char *meshport_call(uint64_t context, const char *request_json);
void meshport_string_free(char *response);
#ifdef __ANDROID__
/* Process-wide callback; keep valid until all native contexts have stopped.
* Invoked on native workers. Return VpnService.protect(fd)'s result. */
void meshport_set_android_socket_protector(bool (*callback)(int fd));
#endif
#ifdef __cplusplus
}
#endif
#endif