github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/include/jit/jit-dynamic.h (about) 1 /* 2 * jit-dynamic.h - Managing dynamic libraries and cross-language invocation. 3 * 4 * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 * 6 * The libjit library is free software: you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public License 8 * as published by the Free Software Foundation, either version 2.1 of 9 * the License, or (at your option) any later version. 10 * 11 * The libjit library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with the libjit library. If not, see 18 * <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef _JIT_DYNAMIC_H 22 #define _JIT_DYNAMIC_H 23 24 #include <jit/jit-common.h> 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 /* 31 * Dynamic library routines. 32 */ 33 typedef void *jit_dynlib_handle_t; 34 jit_dynlib_handle_t jit_dynlib_open(const char *name) JIT_NOTHROW; 35 void jit_dynlib_close(jit_dynlib_handle_t handle) JIT_NOTHROW; 36 void *jit_dynlib_get_symbol 37 (jit_dynlib_handle_t handle, const char *symbol) JIT_NOTHROW; 38 const char *jit_dynlib_get_suffix(void) JIT_NOTHROW; 39 void jit_dynlib_set_debug(int flag) JIT_NOTHROW; 40 41 /* 42 * C++ name mangling definitions. 43 */ 44 #define JIT_MANGLE_PUBLIC 0x0001 45 #define JIT_MANGLE_PROTECTED 0x0002 46 #define JIT_MANGLE_PRIVATE 0x0003 47 #define JIT_MANGLE_STATIC 0x0008 48 #define JIT_MANGLE_VIRTUAL 0x0010 49 #define JIT_MANGLE_CONST 0x0020 50 #define JIT_MANGLE_EXPLICIT_THIS 0x0040 51 #define JIT_MANGLE_IS_CTOR 0x0080 52 #define JIT_MANGLE_IS_DTOR 0x0100 53 #define JIT_MANGLE_BASE 0x0200 54 char *jit_mangle_global_function 55 (const char *name, jit_type_t signature, int form) JIT_NOTHROW; 56 char *jit_mangle_member_function 57 (const char *class_name, const char *name, 58 jit_type_t signature, int form, int flags) JIT_NOTHROW; 59 60 #ifdef __cplusplus 61 }; 62 #endif 63 64 #endif /* _JIT_DYNAMIC_H */