Loading...
Searching...
No Matches
mjs_ffi_public.h
1/*
2 * Copyright (c) 2016 Cesanta Software Limited
3 * All rights reserved
4 */
5
6#ifndef MJS_FFI_PUBLIC_H_
7#define MJS_FFI_PUBLIC_H_
8
9#include "mjs_core_public.h"
10
11#if defined(__cplusplus)
12extern "C" {
13#endif /* __cplusplus */
14
15enum mjs_ffi_ctype {
16 MJS_FFI_CTYPE_NONE,
17 MJS_FFI_CTYPE_USERDATA,
18 MJS_FFI_CTYPE_CALLBACK,
19 MJS_FFI_CTYPE_INT,
20 MJS_FFI_CTYPE_BOOL,
21 MJS_FFI_CTYPE_DOUBLE,
22 MJS_FFI_CTYPE_FLOAT,
23 MJS_FFI_CTYPE_CHAR_PTR,
24 MJS_FFI_CTYPE_VOID_PTR,
25 MJS_FFI_CTYPE_STRUCT_MG_STR_PTR,
26 MJS_FFI_CTYPE_STRUCT_MG_STR,
27 MJS_FFI_CTYPE_INVALID,
28};
29
30typedef void*(mjs_ffi_resolver_t)(void* handle, const char* symbol);
31
32void mjs_set_ffi_resolver(struct mjs* mjs, mjs_ffi_resolver_t* dlsym, void* handle);
33
34void* mjs_ffi_resolve(struct mjs* mjs, const char* symbol);
35
36#if defined(__cplusplus)
37}
38#endif /* __cplusplus */
39
40#endif /* MJS_FFI_PUBLIC_H_ */
Definition mjs_core.h:63