1 module luajit.luajit; 2 /* 3 ** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ 4 ** 5 ** Copyright (C) 2005-2017 Mike Pall. All rights reserved. 6 ** 7 ** Permission is hereby granted, free of charge, to any person obtaining 8 ** a copy of this software and associated documentation files (the 9 ** "Software"), to deal in the Software without restriction, including 10 ** without limitation the rights to use, copy, modify, merge, publish, 11 ** distribute, sublicense, and/or sell copies of the Software, and to 12 ** permit persons to whom the Software is furnished to do so, subject to 13 ** the following conditions: 14 ** 15 ** The above copyright notice and this permission notice shall be 16 ** included in all copies or substantial portions of the Software. 17 ** 18 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 ** 26 ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] 27 */ 28 29 import luajit.lua; 30 31 extern (C): 32 33 enum LUAJIT_VERSION = "LuaJIT 2.0.5"; 34 enum LUAJIT_VERSION_NUM = 20005; /* Version 2.0.5 = 02.00.05. */ 35 alias LUAJIT_VERSION_SYM = luaJIT_version_2_0_5; 36 enum LUAJIT_COPYRIGHT = "Copyright (C) 2005-2017 Mike Pall"; 37 enum LUAJIT_URL = "http://luajit.org/"; 38 39 /* Modes for luaJIT_setmode. */ 40 enum LUAJIT_MODE_MASK = 0x00ff; 41 42 enum 43 { 44 LUAJIT_MODE_ENGINE = 0, /* Set mode for whole JIT engine. */ 45 LUAJIT_MODE_DEBUG = 1, /* Set debug mode (idx = level). */ 46 47 LUAJIT_MODE_FUNC = 2, /* Change mode for a function. */ 48 LUAJIT_MODE_ALLFUNC = 3, /* Recurse into subroutine protos. */ 49 LUAJIT_MODE_ALLSUBFUNC = 4, /* Change only the subroutines. */ 50 51 LUAJIT_MODE_TRACE = 5, /* Flush a compiled trace. */ 52 53 LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ 54 55 LUAJIT_MODE_MAX = 17 56 } 57 58 /* Flags or'ed in to the mode. */ 59 enum LUAJIT_MODE_OFF = 0x0000; /* Turn feature off. */ 60 enum LUAJIT_MODE_ON = 0x0100; /* Turn feature on. */ 61 enum LUAJIT_MODE_FLUSH = 0x0200; /* Flush JIT-compiled code. */ 62 63 /* LuaJIT public C API. */ 64 65 /* Control the JIT engine. */ 66 int luaJIT_setmode (lua_State* L, int idx, int mode); 67 68 /* Enforce (dynamic) linker error for version mismatches. Call from main. */ 69 void luaJIT_version_2_0_5 (); 70