mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Initial implementation of the TCC module.
This commit is contained in:
parent
fdbd78cdd1
commit
ac95c019c5
414
cbp/ModTCC.cbp
Normal file
414
cbp/ModTCC.cbp
Normal file
@ -0,0 +1,414 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="Mod TCC" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="Win32 Debug Dynamic">
|
||||||
|
<Option output="../bin/win32-d/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win32-d/" />
|
||||||
|
<Option object_output="../obj/mingw32-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/mingw32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add directory="../lib/mingw32-d" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win32 Release Dynamic">
|
||||||
|
<Option output="../bin/win32/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win32/" />
|
||||||
|
<Option object_output="../obj/mingw32/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/mingw32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add directory="../lib/mingw32" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win64 Debug Dynamic">
|
||||||
|
<Option output="../bin/win64-d/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win64-d/" />
|
||||||
|
<Option object_output="../obj/mingw64-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/mingw64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add directory="../lib/mingw64-d" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win64 Release Dynamic">
|
||||||
|
<Option output="../bin/win64/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win64/" />
|
||||||
|
<Option object_output="../obj/mingw64/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/mingw64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add directory="../lib/mingw64" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux32 Debug Dynamic">
|
||||||
|
<Option output="../bin/linux32-d/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux32-d/" />
|
||||||
|
<Option object_output="../obj/gcc32-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/gcc32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add directory="../lib/gcc32-d" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux32 Release Dynamic">
|
||||||
|
<Option output="../bin/linux32/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux32/" />
|
||||||
|
<Option object_output="../obj/gcc32/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/gcc32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add directory="../lib/gcc32" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux64 Debug Dynamic">
|
||||||
|
<Option output="../bin/linux64-d/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux64-d/" />
|
||||||
|
<Option object_output="../obj/gcc64-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/gcc64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add directory="../lib/gcc64-d" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux64 Release Dynamic">
|
||||||
|
<Option output="../bin/linux64/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux64/" />
|
||||||
|
<Option object_output="../obj/gcc64/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/gcc64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add directory="../lib/gcc64" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win32 Debug Standalone">
|
||||||
|
<Option output="../bin/win32-d/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win32-d/" />
|
||||||
|
<Option object_output="../obj/mingw32-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/mingw32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add directory="../lib/mingw32-d" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win32 Release Standalone">
|
||||||
|
<Option output="../bin/win32/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win32/" />
|
||||||
|
<Option object_output="../obj/mingw32/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/mingw32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add directory="../lib/mingw32" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win64 Debug Standalone">
|
||||||
|
<Option output="../bin/win64-d/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win64-d/" />
|
||||||
|
<Option object_output="../obj/mingw64-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/mingw64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add directory="../lib/mingw64-d" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Win64 Release Standalone">
|
||||||
|
<Option output="../bin/win64/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/win64/" />
|
||||||
|
<Option object_output="../obj/mingw64/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/mingw64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add directory="../lib/mingw64" />
|
||||||
|
</Linker>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
||||||
|
</ExtraCommands>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux32 Debug Standalone">
|
||||||
|
<Option output="../bin/linux32-d/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux32-d/" />
|
||||||
|
<Option object_output="../obj/gcc32-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/gcc32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-Bstatic" />
|
||||||
|
<Add directory="../lib/gcc32-d" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux32 Release Standalone">
|
||||||
|
<Option output="../bin/linux32/mod_tcc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux32/" />
|
||||||
|
<Option object_output="../obj/gcc32/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-DTCC_TARGET_I386" />
|
||||||
|
<Add directory="../config/gcc32" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m32" />
|
||||||
|
<Add option="-Bstatic" />
|
||||||
|
<Add directory="../lib/gcc32" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux64 Debug Standalone">
|
||||||
|
<Option output="../bin/linux64-d/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux64-d/" />
|
||||||
|
<Option object_output="../obj/gcc64-d/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-D_DEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/gcc64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-Bstatic" />
|
||||||
|
<Add directory="../lib/gcc64-d" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Linux64 Release Standalone">
|
||||||
|
<Option output="../bin/linux64/mod_tcc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
||||||
|
<Option working_dir="../bin/linux64/" />
|
||||||
|
<Option object_output="../obj/gcc64/" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-static-libgcc" />
|
||||||
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add option="-enable-static" />
|
||||||
|
<Add option="-fPIC" />
|
||||||
|
<Add option="-DNDEBUG" />
|
||||||
|
<Add option="-D_SQ64" />
|
||||||
|
<Add option="-DTCC_TARGET_X86_64" />
|
||||||
|
<Add directory="../config/gcc64" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-m64" />
|
||||||
|
<Add option="-Bstatic" />
|
||||||
|
<Add directory="../lib/gcc64" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-Wextra" />
|
||||||
|
<Add option="-Wall" />
|
||||||
|
<Add option="-std=c++14" />
|
||||||
|
<Add option="-DSQMOD_PLUGIN_API" />
|
||||||
|
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
||||||
|
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
||||||
|
<Add option="-DTCC_IS_NATIVE" />
|
||||||
|
<Add option="-DTCC_TARGET_PE" />
|
||||||
|
<Add option="-DCONFIG_TCC_STATIC" />
|
||||||
|
<Add directory="../modules/tcc" />
|
||||||
|
<Add directory="../shared" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../config/common" />
|
||||||
|
<Add directory="../external/TCC" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="tcc" />
|
||||||
|
</Linker>
|
||||||
|
<Unit filename="../modules/tcc/API.cpp" />
|
||||||
|
<Unit filename="../modules/tcc/Common.cpp" />
|
||||||
|
<Unit filename="../modules/tcc/Common.hpp" />
|
||||||
|
<Unit filename="../modules/tcc/Module.cpp" />
|
||||||
|
<Unit filename="../modules/tcc/Module.hpp" />
|
||||||
|
<Unit filename="../modules/tcc/State.cpp" />
|
||||||
|
<Unit filename="../modules/tcc/State.hpp" />
|
||||||
|
<Unit filename="../modules/tcc/Symbol.cpp" />
|
||||||
|
<Unit filename="../modules/tcc/Symbol.hpp" />
|
||||||
|
<Unit filename="../shared/SqMod.cpp" />
|
||||||
|
<Extensions>
|
||||||
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
|
<debugger />
|
||||||
|
<lib_finder disable_auto="1" />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
607
modules/tcc/API.cpp
Normal file
607
modules/tcc/API.cpp
Normal file
@ -0,0 +1,607 @@
|
|||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "Common.hpp"
|
||||||
|
#include "Module.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#define TCC_FUNC(p) reinterpret_cast< const void * >(p)
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
static HSQUIRRELVM GetSqVM()
|
||||||
|
{
|
||||||
|
return _SqVM;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void RegisterAPI(StateHnd & s)
|
||||||
|
{
|
||||||
|
// Make sure the state is valid and not relocated
|
||||||
|
if (!s || s->mRelocated)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Specify whether this is a 64bit build
|
||||||
|
#ifdef _SQ64
|
||||||
|
s.DefineSymbol("__SQ64", "1");
|
||||||
|
#endif // _SQ64
|
||||||
|
// ctype.h
|
||||||
|
s.AddSymbol("isalnum", TCC_FUNC(isalnum));
|
||||||
|
s.AddSymbol("isalpha", TCC_FUNC(isalpha));
|
||||||
|
s.AddSymbol("isblank", TCC_FUNC(isblank));
|
||||||
|
s.AddSymbol("iscntrl", TCC_FUNC(iscntrl));
|
||||||
|
s.AddSymbol("isdigit", TCC_FUNC(isdigit));
|
||||||
|
s.AddSymbol("isgraph", TCC_FUNC(isgraph));
|
||||||
|
s.AddSymbol("islower", TCC_FUNC(islower));
|
||||||
|
s.AddSymbol("isprint", TCC_FUNC(isprint));
|
||||||
|
s.AddSymbol("ispunct", TCC_FUNC(ispunct));
|
||||||
|
s.AddSymbol("isspace", TCC_FUNC(isspace));
|
||||||
|
s.AddSymbol("isupper", TCC_FUNC(isupper));
|
||||||
|
s.AddSymbol("isxdigit", TCC_FUNC(isxdigit));
|
||||||
|
// stdio.h
|
||||||
|
s.AddSymbol("printf", TCC_FUNC(printf));
|
||||||
|
// Helpers
|
||||||
|
s.AddSymbol("get_sqvm", TCC_FUNC(GetSqVM));
|
||||||
|
// VC:MP
|
||||||
|
s.AddSymbol("vcGetServerVersion", TCC_FUNC(_Func->GetServerVersion));
|
||||||
|
s.AddSymbol("vcGetServerSettings", TCC_FUNC(_Func->GetServerSettings));
|
||||||
|
s.AddSymbol("vcExportFunctions", TCC_FUNC(_Func->ExportFunctions));
|
||||||
|
s.AddSymbol("vcGetNumberOfPlugins", TCC_FUNC(_Func->GetNumberOfPlugins));
|
||||||
|
s.AddSymbol("vcGetPluginInfo", TCC_FUNC(_Func->GetPluginInfo));
|
||||||
|
s.AddSymbol("vcFindPlugin", TCC_FUNC(_Func->FindPlugin));
|
||||||
|
s.AddSymbol("vcGetPluginExports", TCC_FUNC(_Func->GetPluginExports));
|
||||||
|
s.AddSymbol("vcGetTime", TCC_FUNC(_Func->GetTime));
|
||||||
|
s.AddSymbol("vcprintf", TCC_FUNC(_Func->printf));
|
||||||
|
s.AddSymbol("vcSendCustomCommand", TCC_FUNC(_Func->SendCustomCommand));
|
||||||
|
s.AddSymbol("vcSendClientMessage", TCC_FUNC(_Func->SendClientMessage));
|
||||||
|
s.AddSymbol("vcSendGameMessage", TCC_FUNC(_Func->SendGameMessage));
|
||||||
|
s.AddSymbol("vcSetServerName", TCC_FUNC(_Func->SetServerName));
|
||||||
|
s.AddSymbol("vcGetServerName", TCC_FUNC(_Func->GetServerName));
|
||||||
|
s.AddSymbol("vcSetMaxPlayers", TCC_FUNC(_Func->SetMaxPlayers));
|
||||||
|
s.AddSymbol("vcGetMaxPlayers", TCC_FUNC(_Func->GetMaxPlayers));
|
||||||
|
s.AddSymbol("vcSetServerPassword", TCC_FUNC(_Func->SetServerPassword));
|
||||||
|
s.AddSymbol("vcGetServerPassword", TCC_FUNC(_Func->GetServerPassword));
|
||||||
|
s.AddSymbol("vcSetGameModeText", TCC_FUNC(_Func->SetGameModeText));
|
||||||
|
s.AddSymbol("vcGetGameModeText", TCC_FUNC(_Func->GetGameModeText));
|
||||||
|
s.AddSymbol("vcShutdownServer", TCC_FUNC(_Func->ShutdownServer));
|
||||||
|
s.AddSymbol("vcSetWorldBounds", TCC_FUNC(_Func->SetWorldBounds));
|
||||||
|
s.AddSymbol("vcGetWorldBounds", TCC_FUNC(_Func->GetWorldBounds));
|
||||||
|
s.AddSymbol("vcSetWastedSettings", TCC_FUNC(_Func->SetWastedSettings));
|
||||||
|
s.AddSymbol("vcGetWastedSettings", TCC_FUNC(_Func->GetWastedSettings));
|
||||||
|
s.AddSymbol("vcSetTimeRate", TCC_FUNC(_Func->SetTimeRate));
|
||||||
|
s.AddSymbol("vcGetTimeRate", TCC_FUNC(_Func->GetTimeRate));
|
||||||
|
s.AddSymbol("vcSetHour", TCC_FUNC(_Func->SetHour));
|
||||||
|
s.AddSymbol("vcGetHour", TCC_FUNC(_Func->GetHour));
|
||||||
|
s.AddSymbol("vcSetMinute", TCC_FUNC(_Func->SetMinute));
|
||||||
|
s.AddSymbol("vcGetMinute", TCC_FUNC(_Func->GetMinute));
|
||||||
|
s.AddSymbol("vcSetWeather", TCC_FUNC(_Func->SetWeather));
|
||||||
|
s.AddSymbol("vcGetWeather", TCC_FUNC(_Func->GetWeather));
|
||||||
|
s.AddSymbol("vcSetGravity", TCC_FUNC(_Func->SetGravity));
|
||||||
|
s.AddSymbol("vcGetGravity", TCC_FUNC(_Func->GetGravity));
|
||||||
|
s.AddSymbol("vcSetGamespeed", TCC_FUNC(_Func->SetGamespeed));
|
||||||
|
s.AddSymbol("vcGetGamespeed", TCC_FUNC(_Func->GetGamespeed));
|
||||||
|
s.AddSymbol("vcSetWaterLevel", TCC_FUNC(_Func->SetWaterLevel));
|
||||||
|
s.AddSymbol("vcGetWaterLevel", TCC_FUNC(_Func->GetWaterLevel));
|
||||||
|
s.AddSymbol("vcSetMaxHeight", TCC_FUNC(_Func->SetMaxHeight));
|
||||||
|
s.AddSymbol("vcGetMaxHeight", TCC_FUNC(_Func->GetMaxHeight));
|
||||||
|
s.AddSymbol("vcSetKillCmdDelay", TCC_FUNC(_Func->SetKillCmdDelay));
|
||||||
|
s.AddSymbol("vcGetKillCmdDelay", TCC_FUNC(_Func->GetKillCmdDelay));
|
||||||
|
s.AddSymbol("vcSetVehiclesForcedRespawnHeight", TCC_FUNC(_Func->SetVehiclesForcedRespawnHeight));
|
||||||
|
s.AddSymbol("vcGetVehiclesForcedRespawnHeight", TCC_FUNC(_Func->GetVehiclesForcedRespawnHeight));
|
||||||
|
s.AddSymbol("vcToggleSyncFrameLimiter", TCC_FUNC(_Func->ToggleSyncFrameLimiter));
|
||||||
|
s.AddSymbol("vcEnabledSyncFrameLimiter", TCC_FUNC(_Func->EnabledSyncFrameLimiter));
|
||||||
|
s.AddSymbol("vcToggleFrameLimiter", TCC_FUNC(_Func->ToggleFrameLimiter));
|
||||||
|
s.AddSymbol("vcEnabledFrameLimiter", TCC_FUNC(_Func->EnabledFrameLimiter));
|
||||||
|
s.AddSymbol("vcToggleTaxiBoostJump", TCC_FUNC(_Func->ToggleTaxiBoostJump));
|
||||||
|
s.AddSymbol("vcEnabledTaxiBoostJump", TCC_FUNC(_Func->EnabledTaxiBoostJump));
|
||||||
|
s.AddSymbol("vcToggleDriveOnWater", TCC_FUNC(_Func->ToggleDriveOnWater));
|
||||||
|
s.AddSymbol("vcEnabledDriveOnWater", TCC_FUNC(_Func->EnabledDriveOnWater));
|
||||||
|
s.AddSymbol("vcToggleFastSwitch", TCC_FUNC(_Func->ToggleFastSwitch));
|
||||||
|
s.AddSymbol("vcEnabledFastSwitch", TCC_FUNC(_Func->EnabledFastSwitch));
|
||||||
|
s.AddSymbol("vcToggleFriendlyFire", TCC_FUNC(_Func->ToggleFriendlyFire));
|
||||||
|
s.AddSymbol("vcEnabledFriendlyFire", TCC_FUNC(_Func->EnabledFriendlyFire));
|
||||||
|
s.AddSymbol("vcToggleDisableDriveby", TCC_FUNC(_Func->ToggleDisableDriveby));
|
||||||
|
s.AddSymbol("vcEnabledDisableDriveby", TCC_FUNC(_Func->EnabledDisableDriveby));
|
||||||
|
s.AddSymbol("vcTogglePerfectHandling", TCC_FUNC(_Func->TogglePerfectHandling));
|
||||||
|
s.AddSymbol("vcEnabledPerfectHandling", TCC_FUNC(_Func->EnabledPerfectHandling));
|
||||||
|
s.AddSymbol("vcToggleFlyingCars", TCC_FUNC(_Func->ToggleFlyingCars));
|
||||||
|
s.AddSymbol("vcEnabledFlyingCars", TCC_FUNC(_Func->EnabledFlyingCars));
|
||||||
|
s.AddSymbol("vcToggleJumpSwitch", TCC_FUNC(_Func->ToggleJumpSwitch));
|
||||||
|
s.AddSymbol("vcEnabledJumpSwitch", TCC_FUNC(_Func->EnabledJumpSwitch));
|
||||||
|
s.AddSymbol("vcToggleShowMarkers", TCC_FUNC(_Func->ToggleShowMarkers));
|
||||||
|
s.AddSymbol("vcEnabledShowMarkers", TCC_FUNC(_Func->EnabledShowMarkers));
|
||||||
|
s.AddSymbol("vcToggleOnlyShowTeamMarkers", TCC_FUNC(_Func->ToggleOnlyShowTeamMarkers));
|
||||||
|
s.AddSymbol("vcEnabledOnlyShowTeamMarkers", TCC_FUNC(_Func->EnabledOnlyShowTeamMarkers));
|
||||||
|
s.AddSymbol("vcToggleStuntBike", TCC_FUNC(_Func->ToggleStuntBike));
|
||||||
|
s.AddSymbol("vcEnabledStuntBike", TCC_FUNC(_Func->EnabledStuntBike));
|
||||||
|
s.AddSymbol("vcToggleShootInAir", TCC_FUNC(_Func->ToggleShootInAir));
|
||||||
|
s.AddSymbol("vcEnabledShootInAir", TCC_FUNC(_Func->EnabledShootInAir));
|
||||||
|
s.AddSymbol("vcToggleShowNametags", TCC_FUNC(_Func->ToggleShowNametags));
|
||||||
|
s.AddSymbol("vcEnabledShowNametags", TCC_FUNC(_Func->EnabledShowNametags));
|
||||||
|
s.AddSymbol("vcToggleJoinMessages", TCC_FUNC(_Func->ToggleJoinMessages));
|
||||||
|
s.AddSymbol("vcEnabledJoinMessages", TCC_FUNC(_Func->EnabledJoinMessages));
|
||||||
|
s.AddSymbol("vcToggleDeathMessages", TCC_FUNC(_Func->ToggleDeathMessages));
|
||||||
|
s.AddSymbol("vcEnabledDeathMessages", TCC_FUNC(_Func->EnabledDeathMessages));
|
||||||
|
s.AddSymbol("vcToggleChatTagsByDefaultEnabled", TCC_FUNC(_Func->ToggleChatTagsByDefaultEnabled));
|
||||||
|
s.AddSymbol("vcEnabledChatTagsByDefault", TCC_FUNC(_Func->EnabledChatTagsByDefault));
|
||||||
|
s.AddSymbol("vcCreateExplosion", TCC_FUNC(_Func->CreateExplosion));
|
||||||
|
s.AddSymbol("vcPlaySound", TCC_FUNC(_Func->PlaySound));
|
||||||
|
s.AddSymbol("vcHideMapObject", TCC_FUNC(_Func->HideMapObject));
|
||||||
|
s.AddSymbol("vcShowMapObject", TCC_FUNC(_Func->ShowMapObject));
|
||||||
|
s.AddSymbol("vcShowAllMapObjects", TCC_FUNC(_Func->ShowAllMapObjects));
|
||||||
|
s.AddSymbol("vcSetWeaponDataValue", TCC_FUNC(_Func->SetWeaponDataValue));
|
||||||
|
s.AddSymbol("vcGetWeaponDataValue", TCC_FUNC(_Func->GetWeaponDataValue));
|
||||||
|
s.AddSymbol("vcResetWeaponDataValue", TCC_FUNC(_Func->ResetWeaponDataValue));
|
||||||
|
s.AddSymbol("vcIsWeaponDataValueModified", TCC_FUNC(_Func->IsWeaponDataValueModified));
|
||||||
|
s.AddSymbol("vcResetWeaponData", TCC_FUNC(_Func->ResetWeaponData));
|
||||||
|
s.AddSymbol("vcResetAllWeaponData", TCC_FUNC(_Func->ResetAllWeaponData));
|
||||||
|
s.AddSymbol("vcGetKeyBindUnusedSlot", TCC_FUNC(_Func->GetKeyBindUnusedSlot));
|
||||||
|
s.AddSymbol("vcGetKeyBindData", TCC_FUNC(_Func->GetKeyBindData));
|
||||||
|
s.AddSymbol("vcRegisterKeyBind", TCC_FUNC(_Func->RegisterKeyBind));
|
||||||
|
s.AddSymbol("vcRemoveKeyBind", TCC_FUNC(_Func->RemoveKeyBind));
|
||||||
|
s.AddSymbol("vcRemoveAllKeyBinds", TCC_FUNC(_Func->RemoveAllKeyBinds));
|
||||||
|
s.AddSymbol("vcCreateCoordBlip", TCC_FUNC(_Func->CreateCoordBlip));
|
||||||
|
s.AddSymbol("vcDestroyCoordBlip", TCC_FUNC(_Func->DestroyCoordBlip));
|
||||||
|
s.AddSymbol("vcGetCoordBlipInfo", TCC_FUNC(_Func->GetCoordBlipInfo));
|
||||||
|
s.AddSymbol("vcCreateSprite", TCC_FUNC(_Func->CreateSprite));
|
||||||
|
s.AddSymbol("vcDestroySprite", TCC_FUNC(_Func->DestroySprite));
|
||||||
|
s.AddSymbol("vcShowSprite", TCC_FUNC(_Func->ShowSprite));
|
||||||
|
s.AddSymbol("vcHideSprite", TCC_FUNC(_Func->HideSprite));
|
||||||
|
s.AddSymbol("vcMoveSprite", TCC_FUNC(_Func->MoveSprite));
|
||||||
|
s.AddSymbol("vcSetSpriteCenter", TCC_FUNC(_Func->SetSpriteCenter));
|
||||||
|
s.AddSymbol("vcRotateSprite", TCC_FUNC(_Func->RotateSprite));
|
||||||
|
s.AddSymbol("vcSetSpriteAlpha", TCC_FUNC(_Func->SetSpriteAlpha));
|
||||||
|
s.AddSymbol("vcSetSpriteRelativity", TCC_FUNC(_Func->SetSpriteRelativity));
|
||||||
|
s.AddSymbol("vcCreateTextdraw", TCC_FUNC(_Func->CreateTextdraw));
|
||||||
|
s.AddSymbol("vcDestroyTextdraw", TCC_FUNC(_Func->DestroyTextdraw));
|
||||||
|
s.AddSymbol("vcShowTextdraw", TCC_FUNC(_Func->ShowTextdraw));
|
||||||
|
s.AddSymbol("vcHideTextdraw", TCC_FUNC(_Func->HideTextdraw));
|
||||||
|
s.AddSymbol("vcMoveTextdraw", TCC_FUNC(_Func->MoveTextdraw));
|
||||||
|
s.AddSymbol("vcSetTextdrawColour", TCC_FUNC(_Func->SetTextdrawColour));
|
||||||
|
s.AddSymbol("vcSetTextdrawRelativity", TCC_FUNC(_Func->SetTextdrawRelativity));
|
||||||
|
s.AddSymbol("vcAddRadioStream", TCC_FUNC(_Func->AddRadioStream));
|
||||||
|
s.AddSymbol("vcRemoveRadioStream", TCC_FUNC(_Func->RemoveRadioStream));
|
||||||
|
s.AddSymbol("vcSetUseClasses", TCC_FUNC(_Func->SetUseClasses));
|
||||||
|
s.AddSymbol("vcGetUseClasses", TCC_FUNC(_Func->GetUseClasses));
|
||||||
|
s.AddSymbol("vcGetPlayerClass", TCC_FUNC(_Func->GetPlayerClass));
|
||||||
|
s.AddSymbol("vcAddPlayerClass", TCC_FUNC(_Func->AddPlayerClass));
|
||||||
|
s.AddSymbol("vcSetSpawnPlayerPos", TCC_FUNC(_Func->SetSpawnPlayerPos));
|
||||||
|
s.AddSymbol("vcSetSpawnCameraPos", TCC_FUNC(_Func->SetSpawnCameraPos));
|
||||||
|
s.AddSymbol("vcSetSpawnCameraLookAt", TCC_FUNC(_Func->SetSpawnCameraLookAt));
|
||||||
|
s.AddSymbol("vcIsPlayerAdmin", TCC_FUNC(_Func->IsPlayerAdmin));
|
||||||
|
s.AddSymbol("vcSetPlayerAdmin", TCC_FUNC(_Func->SetPlayerAdmin));
|
||||||
|
s.AddSymbol("vcGetPlayerIP", TCC_FUNC(_Func->GetPlayerIP));
|
||||||
|
s.AddSymbol("vcKickPlayer", TCC_FUNC(_Func->KickPlayer));
|
||||||
|
s.AddSymbol("vcBanPlayer", TCC_FUNC(_Func->BanPlayer));
|
||||||
|
s.AddSymbol("vcBanIP", TCC_FUNC(_Func->BanIP));
|
||||||
|
s.AddSymbol("vcUnbanIP", TCC_FUNC(_Func->UnbanIP));
|
||||||
|
s.AddSymbol("vcIsIPBanned", TCC_FUNC(_Func->IsIPBanned));
|
||||||
|
s.AddSymbol("vcGetPlayerIDFromName", TCC_FUNC(_Func->GetPlayerIDFromName));
|
||||||
|
s.AddSymbol("vcIsPlayerConnected", TCC_FUNC(_Func->IsPlayerConnected));
|
||||||
|
s.AddSymbol("vcIsPlayerSpawned", TCC_FUNC(_Func->IsPlayerSpawned));
|
||||||
|
s.AddSymbol("vcIsPlayerStreamedForPlayer", TCC_FUNC(_Func->IsPlayerStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcGetPlayerKey", TCC_FUNC(_Func->GetPlayerKey));
|
||||||
|
s.AddSymbol("vcSetPlayerWorld", TCC_FUNC(_Func->SetPlayerWorld));
|
||||||
|
s.AddSymbol("vcGetPlayerWorld", TCC_FUNC(_Func->GetPlayerWorld));
|
||||||
|
s.AddSymbol("vcSetPlayerSecWorld", TCC_FUNC(_Func->SetPlayerSecWorld));
|
||||||
|
s.AddSymbol("vcGetPlayerSecWorld", TCC_FUNC(_Func->GetPlayerSecWorld));
|
||||||
|
s.AddSymbol("vcGetPlayerUniqueWorld", TCC_FUNC(_Func->GetPlayerUniqueWorld));
|
||||||
|
s.AddSymbol("vcIsPlayerWorldCompatible", TCC_FUNC(_Func->IsPlayerWorldCompatible));
|
||||||
|
s.AddSymbol("vcGetPlayerState", TCC_FUNC(_Func->GetPlayerState));
|
||||||
|
s.AddSymbol("vcGetPlayerName", TCC_FUNC(_Func->GetPlayerName));
|
||||||
|
s.AddSymbol("vcSetPlayerName", TCC_FUNC(_Func->SetPlayerName));
|
||||||
|
s.AddSymbol("vcSetPlayerTeam", TCC_FUNC(_Func->SetPlayerTeam));
|
||||||
|
s.AddSymbol("vcGetPlayerTeam", TCC_FUNC(_Func->GetPlayerTeam));
|
||||||
|
s.AddSymbol("vcSetPlayerSkin", TCC_FUNC(_Func->SetPlayerSkin));
|
||||||
|
s.AddSymbol("vcGetPlayerSkin", TCC_FUNC(_Func->GetPlayerSkin));
|
||||||
|
s.AddSymbol("vcSetPlayerColour", TCC_FUNC(_Func->SetPlayerColour));
|
||||||
|
s.AddSymbol("vcGetPlayerColour", TCC_FUNC(_Func->GetPlayerColour));
|
||||||
|
s.AddSymbol("vcForcePlayerSpawn", TCC_FUNC(_Func->ForcePlayerSpawn));
|
||||||
|
s.AddSymbol("vcForcePlayerSelect", TCC_FUNC(_Func->ForcePlayerSelect));
|
||||||
|
s.AddSymbol("vcForceAllSelect", TCC_FUNC(_Func->ForceAllSelect));
|
||||||
|
s.AddSymbol("vcGivePlayerMoney", TCC_FUNC(_Func->GivePlayerMoney));
|
||||||
|
s.AddSymbol("vcSetPlayerMoney", TCC_FUNC(_Func->SetPlayerMoney));
|
||||||
|
s.AddSymbol("vcGetPlayerMoney", TCC_FUNC(_Func->GetPlayerMoney));
|
||||||
|
s.AddSymbol("vcSetPlayerScore", TCC_FUNC(_Func->SetPlayerScore));
|
||||||
|
s.AddSymbol("vcGetPlayerScore", TCC_FUNC(_Func->GetPlayerScore));
|
||||||
|
s.AddSymbol("vcGetPlayerPing", TCC_FUNC(_Func->GetPlayerPing));
|
||||||
|
s.AddSymbol("vcIsPlayerTyping", TCC_FUNC(_Func->IsPlayerTyping));
|
||||||
|
s.AddSymbol("vcGetPlayerFPS", TCC_FUNC(_Func->GetPlayerFPS));
|
||||||
|
s.AddSymbol("vcGetPlayerUID", TCC_FUNC(_Func->GetPlayerUID));
|
||||||
|
s.AddSymbol("vcGetPlayerWantedLevel", TCC_FUNC(_Func->GetPlayerWantedLevel));
|
||||||
|
s.AddSymbol("vcSetPlayerHealth", TCC_FUNC(_Func->SetPlayerHealth));
|
||||||
|
s.AddSymbol("vcGetPlayerHealth", TCC_FUNC(_Func->GetPlayerHealth));
|
||||||
|
s.AddSymbol("vcSetPlayerArmour", TCC_FUNC(_Func->SetPlayerArmour));
|
||||||
|
s.AddSymbol("vcGetPlayerArmour", TCC_FUNC(_Func->GetPlayerArmour));
|
||||||
|
s.AddSymbol("vcSetPlayerImmunityFlags", TCC_FUNC(_Func->SetPlayerImmunityFlags));
|
||||||
|
s.AddSymbol("vcGetPlayerImmunityFlags", TCC_FUNC(_Func->GetPlayerImmunityFlags));
|
||||||
|
s.AddSymbol("vcSetPlayerPos", TCC_FUNC(_Func->SetPlayerPos));
|
||||||
|
s.AddSymbol("vcGetPlayerPos", TCC_FUNC(_Func->GetPlayerPos));
|
||||||
|
s.AddSymbol("vcSetPlayerSpeed", TCC_FUNC(_Func->SetPlayerSpeed));
|
||||||
|
s.AddSymbol("vcGetPlayerSpeed", TCC_FUNC(_Func->GetPlayerSpeed));
|
||||||
|
s.AddSymbol("vcAddPlayerSpeed", TCC_FUNC(_Func->AddPlayerSpeed));
|
||||||
|
s.AddSymbol("vcSetPlayerHeading", TCC_FUNC(_Func->SetPlayerHeading));
|
||||||
|
s.AddSymbol("vcGetPlayerHeading", TCC_FUNC(_Func->GetPlayerHeading));
|
||||||
|
s.AddSymbol("vcSetPlayerAlpha", TCC_FUNC(_Func->SetPlayerAlpha));
|
||||||
|
s.AddSymbol("vcGetPlayerAlpha", TCC_FUNC(_Func->GetPlayerAlpha));
|
||||||
|
s.AddSymbol("vcGetPlayerOnFireStatus", TCC_FUNC(_Func->GetPlayerOnFireStatus));
|
||||||
|
s.AddSymbol("vcGetPlayerCrouchStatus", TCC_FUNC(_Func->GetPlayerCrouchStatus));
|
||||||
|
s.AddSymbol("vcGetPlayerAction", TCC_FUNC(_Func->GetPlayerAction));
|
||||||
|
s.AddSymbol("vcGetPlayerGameKeys", TCC_FUNC(_Func->GetPlayerGameKeys));
|
||||||
|
s.AddSymbol("vcGetPlayerAimPos", TCC_FUNC(_Func->GetPlayerAimPos));
|
||||||
|
s.AddSymbol("vcGetPlayerAimDir", TCC_FUNC(_Func->GetPlayerAimDir));
|
||||||
|
s.AddSymbol("vcPutPlayerInVehicle", TCC_FUNC(_Func->PutPlayerInVehicle));
|
||||||
|
s.AddSymbol("vcRemovePlayerFromVehicle", TCC_FUNC(_Func->RemovePlayerFromVehicle));
|
||||||
|
s.AddSymbol("vcGetPlayerInVehicleStatus", TCC_FUNC(_Func->GetPlayerInVehicleStatus));
|
||||||
|
s.AddSymbol("vcGetPlayerInVehicleSlot", TCC_FUNC(_Func->GetPlayerInVehicleSlot));
|
||||||
|
s.AddSymbol("vcGetPlayerVehicleID", TCC_FUNC(_Func->GetPlayerVehicleID));
|
||||||
|
s.AddSymbol("vcTogglePlayerControllable", TCC_FUNC(_Func->TogglePlayerControllable));
|
||||||
|
s.AddSymbol("vcEnabledPlayerControllable", TCC_FUNC(_Func->EnabledPlayerControllable));
|
||||||
|
s.AddSymbol("vcTogglePlayerDriveby", TCC_FUNC(_Func->TogglePlayerDriveby));
|
||||||
|
s.AddSymbol("vcEnabledPlayerDriveby", TCC_FUNC(_Func->EnabledPlayerDriveby));
|
||||||
|
s.AddSymbol("vcTogglePlayerWhiteScanlines", TCC_FUNC(_Func->TogglePlayerWhiteScanlines));
|
||||||
|
s.AddSymbol("vcEnabledPlayerWhiteScanlines", TCC_FUNC(_Func->EnabledPlayerWhiteScanlines));
|
||||||
|
s.AddSymbol("vcTogglePlayerGreenScanlines", TCC_FUNC(_Func->TogglePlayerGreenScanlines));
|
||||||
|
s.AddSymbol("vcEnabledPlayerGreenScanlines", TCC_FUNC(_Func->EnabledPlayerGreenScanlines));
|
||||||
|
s.AddSymbol("vcTogglePlayerWidescreen", TCC_FUNC(_Func->TogglePlayerWidescreen));
|
||||||
|
s.AddSymbol("vcEnabledPlayerWidescreen", TCC_FUNC(_Func->EnabledPlayerWidescreen));
|
||||||
|
s.AddSymbol("vcTogglePlayerShowMarkers", TCC_FUNC(_Func->TogglePlayerShowMarkers));
|
||||||
|
s.AddSymbol("vcEnabledPlayerShowMarkers", TCC_FUNC(_Func->EnabledPlayerShowMarkers));
|
||||||
|
s.AddSymbol("vcTogglePlayerAttackPriv", TCC_FUNC(_Func->TogglePlayerAttackPriv));
|
||||||
|
s.AddSymbol("vcEnabledPlayerAttackPriv", TCC_FUNC(_Func->EnabledPlayerAttackPriv));
|
||||||
|
s.AddSymbol("vcTogglePlayerHasMarker", TCC_FUNC(_Func->TogglePlayerHasMarker));
|
||||||
|
s.AddSymbol("vcEnabledPlayerHasMarker", TCC_FUNC(_Func->EnabledPlayerHasMarker));
|
||||||
|
s.AddSymbol("vcTogglePlayerChatTagsEnabled", TCC_FUNC(_Func->TogglePlayerChatTagsEnabled));
|
||||||
|
s.AddSymbol("vcEnabledPlayerChatTags", TCC_FUNC(_Func->EnabledPlayerChatTags));
|
||||||
|
s.AddSymbol("vcTogglePlayerDrunkEffects", TCC_FUNC(_Func->TogglePlayerDrunkEffects));
|
||||||
|
s.AddSymbol("vcEnabledPlayerDrunkEffects", TCC_FUNC(_Func->EnabledPlayerDrunkEffects));
|
||||||
|
s.AddSymbol("vcGivePlayerWeapon", TCC_FUNC(_Func->GivePlayerWeapon));
|
||||||
|
s.AddSymbol("vcSetPlayerWeapon", TCC_FUNC(_Func->SetPlayerWeapon));
|
||||||
|
s.AddSymbol("vcGetPlayerWeapon", TCC_FUNC(_Func->GetPlayerWeapon));
|
||||||
|
s.AddSymbol("vcGetPlayerWeaponAmmo", TCC_FUNC(_Func->GetPlayerWeaponAmmo));
|
||||||
|
s.AddSymbol("vcSetPlayerWeaponSlot", TCC_FUNC(_Func->SetPlayerWeaponSlot));
|
||||||
|
s.AddSymbol("vcGetPlayerWeaponSlot", TCC_FUNC(_Func->GetPlayerWeaponSlot));
|
||||||
|
s.AddSymbol("vcGetPlayerWeaponAtSlot", TCC_FUNC(_Func->GetPlayerWeaponAtSlot));
|
||||||
|
s.AddSymbol("vcGetPlayerAmmoAtSlot", TCC_FUNC(_Func->GetPlayerAmmoAtSlot));
|
||||||
|
s.AddSymbol("vcRemovePlayerWeapon", TCC_FUNC(_Func->RemovePlayerWeapon));
|
||||||
|
s.AddSymbol("vcRemoveAllWeapons", TCC_FUNC(_Func->RemoveAllWeapons));
|
||||||
|
s.AddSymbol("vcSetCameraPosition", TCC_FUNC(_Func->SetCameraPosition));
|
||||||
|
s.AddSymbol("vcRestoreCamera", TCC_FUNC(_Func->RestoreCamera));
|
||||||
|
s.AddSymbol("vcIsCameraLocked", TCC_FUNC(_Func->IsCameraLocked));
|
||||||
|
s.AddSymbol("vcSetPlayerAnimation", TCC_FUNC(_Func->SetPlayerAnimation));
|
||||||
|
s.AddSymbol("vcSetPlayerWantedLevel", TCC_FUNC(_Func->SetPlayerWantedLevel));
|
||||||
|
s.AddSymbol("vcGetPlayerStandingOnVehicle", TCC_FUNC(_Func->GetPlayerStandingOnVehicle));
|
||||||
|
s.AddSymbol("vcGetPlayerStandingOnObject", TCC_FUNC(_Func->GetPlayerStandingOnObject));
|
||||||
|
s.AddSymbol("vcIsPlayerAway", TCC_FUNC(_Func->IsPlayerAway));
|
||||||
|
s.AddSymbol("vcGetPlayerSpectateTarget", TCC_FUNC(_Func->GetPlayerSpectateTarget));
|
||||||
|
s.AddSymbol("vcSetPlayerSpectateTarget", TCC_FUNC(_Func->SetPlayerSpectateTarget));
|
||||||
|
s.AddSymbol("vcRedirectPlayerToServer", TCC_FUNC(_Func->RedirectPlayerToServer));
|
||||||
|
s.AddSymbol("vcCreateVehicle", TCC_FUNC(_Func->CreateVehicle));
|
||||||
|
s.AddSymbol("vcDeleteVehicle", TCC_FUNC(_Func->DeleteVehicle));
|
||||||
|
s.AddSymbol("vcGetVehicleSyncSource", TCC_FUNC(_Func->GetVehicleSyncSource));
|
||||||
|
s.AddSymbol("vcGetVehicleSyncType", TCC_FUNC(_Func->GetVehicleSyncType));
|
||||||
|
s.AddSymbol("vcIsVehicleStreamedForPlayer", TCC_FUNC(_Func->IsVehicleStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcSetVehicleWorld", TCC_FUNC(_Func->SetVehicleWorld));
|
||||||
|
s.AddSymbol("vcGetVehicleWorld", TCC_FUNC(_Func->GetVehicleWorld));
|
||||||
|
s.AddSymbol("vcGetVehicleModel", TCC_FUNC(_Func->GetVehicleModel));
|
||||||
|
s.AddSymbol("vcGetVehicleOccupant", TCC_FUNC(_Func->GetVehicleOccupant));
|
||||||
|
s.AddSymbol("vcRespawnVehicle", TCC_FUNC(_Func->RespawnVehicle));
|
||||||
|
s.AddSymbol("vcSetVehicleImmunityFlags", TCC_FUNC(_Func->SetVehicleImmunityFlags));
|
||||||
|
s.AddSymbol("vcGetVehicleImmunityFlags", TCC_FUNC(_Func->GetVehicleImmunityFlags));
|
||||||
|
s.AddSymbol("vcKillVehicle", TCC_FUNC(_Func->KillVehicle));
|
||||||
|
s.AddSymbol("vcIsVehicleWrecked", TCC_FUNC(_Func->IsVehicleWrecked));
|
||||||
|
s.AddSymbol("vcSetVehiclePos", TCC_FUNC(_Func->SetVehiclePos));
|
||||||
|
s.AddSymbol("vcGetVehiclePos", TCC_FUNC(_Func->GetVehiclePos));
|
||||||
|
s.AddSymbol("vcSetVehicleRot", TCC_FUNC(_Func->SetVehicleRot));
|
||||||
|
s.AddSymbol("vcSetVehicleRotEuler", TCC_FUNC(_Func->SetVehicleRotEuler));
|
||||||
|
s.AddSymbol("vcGetVehicleRot", TCC_FUNC(_Func->GetVehicleRot));
|
||||||
|
s.AddSymbol("vcGetVehicleRotEuler", TCC_FUNC(_Func->GetVehicleRotEuler));
|
||||||
|
s.AddSymbol("vcSetVehicleSpeed", TCC_FUNC(_Func->SetVehicleSpeed));
|
||||||
|
s.AddSymbol("vcGetVehicleSpeed", TCC_FUNC(_Func->GetVehicleSpeed));
|
||||||
|
s.AddSymbol("vcAddVehicleSpeed", TCC_FUNC(_Func->AddVehicleSpeed));
|
||||||
|
s.AddSymbol("vcSetVehicleRelSpeed", TCC_FUNC(_Func->SetVehicleRelSpeed));
|
||||||
|
s.AddSymbol("vcGetVehicleRelSpeed", TCC_FUNC(_Func->GetVehicleRelSpeed));
|
||||||
|
s.AddSymbol("vcAddVehicleRelSpeed", TCC_FUNC(_Func->AddVehicleRelSpeed));
|
||||||
|
s.AddSymbol("vcSetVehicleTurnSpeed", TCC_FUNC(_Func->SetVehicleTurnSpeed));
|
||||||
|
s.AddSymbol("vcGetVehicleTurnSpeed", TCC_FUNC(_Func->GetVehicleTurnSpeed));
|
||||||
|
s.AddSymbol("vcAddVehicleTurnSpeed", TCC_FUNC(_Func->AddVehicleTurnSpeed));
|
||||||
|
s.AddSymbol("vcSetVehicleRelTurnSpeed", TCC_FUNC(_Func->SetVehicleRelTurnSpeed));
|
||||||
|
s.AddSymbol("vcGetVehicleRelTurnSpeed", TCC_FUNC(_Func->GetVehicleRelTurnSpeed));
|
||||||
|
s.AddSymbol("vcAddVehicleRelTurnSpeed", TCC_FUNC(_Func->AddVehicleRelTurnSpeed));
|
||||||
|
s.AddSymbol("vcSetVehicleSpawnPos", TCC_FUNC(_Func->SetVehicleSpawnPos));
|
||||||
|
s.AddSymbol("vcGetVehicleSpawnPos", TCC_FUNC(_Func->GetVehicleSpawnPos));
|
||||||
|
s.AddSymbol("vcSetVehicleSpawnRot", TCC_FUNC(_Func->SetVehicleSpawnRot));
|
||||||
|
s.AddSymbol("vcSetVehicleSpawnRotEuler", TCC_FUNC(_Func->SetVehicleSpawnRotEuler));
|
||||||
|
s.AddSymbol("vcGetVehicleSpawnRot", TCC_FUNC(_Func->GetVehicleSpawnRot));
|
||||||
|
s.AddSymbol("vcGetVehicleSpawnRotEuler", TCC_FUNC(_Func->GetVehicleSpawnRotEuler));
|
||||||
|
s.AddSymbol("vcSetVehicleIdleRespawnTimer", TCC_FUNC(_Func->SetVehicleIdleRespawnTimer));
|
||||||
|
s.AddSymbol("vcGetVehicleIdleRespawnTimer", TCC_FUNC(_Func->GetVehicleIdleRespawnTimer));
|
||||||
|
s.AddSymbol("vcSetVehicleHealth", TCC_FUNC(_Func->SetVehicleHealth));
|
||||||
|
s.AddSymbol("vcGetVehicleHealth", TCC_FUNC(_Func->GetVehicleHealth));
|
||||||
|
s.AddSymbol("vcSetVehicleColour", TCC_FUNC(_Func->SetVehicleColour));
|
||||||
|
s.AddSymbol("vcGetVehicleColour", TCC_FUNC(_Func->GetVehicleColour));
|
||||||
|
s.AddSymbol("vcSetVehicleDoorsLocked", TCC_FUNC(_Func->SetVehicleDoorsLocked));
|
||||||
|
s.AddSymbol("vcGetVehicleDoorsLocked", TCC_FUNC(_Func->GetVehicleDoorsLocked));
|
||||||
|
s.AddSymbol("vcSetVehiclePartStatus", TCC_FUNC(_Func->SetVehiclePartStatus));
|
||||||
|
s.AddSymbol("vcGetVehiclePartStatus", TCC_FUNC(_Func->GetVehiclePartStatus));
|
||||||
|
s.AddSymbol("vcSetVehicleTyreStatus", TCC_FUNC(_Func->SetVehicleTyreStatus));
|
||||||
|
s.AddSymbol("vcGetVehicleTyreStatus", TCC_FUNC(_Func->GetVehicleTyreStatus));
|
||||||
|
s.AddSymbol("vcSetVehicleDamageData", TCC_FUNC(_Func->SetVehicleDamageData));
|
||||||
|
s.AddSymbol("vcGetVehicleDamageData", TCC_FUNC(_Func->GetVehicleDamageData));
|
||||||
|
s.AddSymbol("vcSetVehicleAlarm", TCC_FUNC(_Func->SetVehicleAlarm));
|
||||||
|
s.AddSymbol("vcGetVehicleAlarm", TCC_FUNC(_Func->GetVehicleAlarm));
|
||||||
|
s.AddSymbol("vcSetVehicleLights", TCC_FUNC(_Func->SetVehicleLights));
|
||||||
|
s.AddSymbol("vcGetVehicleLights", TCC_FUNC(_Func->GetVehicleLights));
|
||||||
|
s.AddSymbol("vcSetVehicleRadio", TCC_FUNC(_Func->SetVehicleRadio));
|
||||||
|
s.AddSymbol("vcGetVehicleRadio", TCC_FUNC(_Func->GetVehicleRadio));
|
||||||
|
s.AddSymbol("vcSetVehicleRadioLocked", TCC_FUNC(_Func->SetVehicleRadioLocked));
|
||||||
|
s.AddSymbol("vcIsVehicleRadioLocked", TCC_FUNC(_Func->IsVehicleRadioLocked));
|
||||||
|
s.AddSymbol("vcGetVehicleGhostState", TCC_FUNC(_Func->GetVehicleGhostState));
|
||||||
|
s.AddSymbol("vcSetVehicleGhostState", TCC_FUNC(_Func->SetVehicleGhostState));
|
||||||
|
s.AddSymbol("vcGetVehicleTurretRotation", TCC_FUNC(_Func->GetVehicleTurretRotation));
|
||||||
|
s.AddSymbol("vcResetAllVehicleHandlings", TCC_FUNC(_Func->ResetAllVehicleHandlings));
|
||||||
|
s.AddSymbol("vcExistsHandlingRule", TCC_FUNC(_Func->ExistsHandlingRule));
|
||||||
|
s.AddSymbol("vcSetHandlingRule", TCC_FUNC(_Func->SetHandlingRule));
|
||||||
|
s.AddSymbol("vcGetHandlingRule", TCC_FUNC(_Func->GetHandlingRule));
|
||||||
|
s.AddSymbol("vcResetHandlingRule", TCC_FUNC(_Func->ResetHandlingRule));
|
||||||
|
s.AddSymbol("vcResetHandling", TCC_FUNC(_Func->ResetHandling));
|
||||||
|
s.AddSymbol("vcExistsInstHandlingRule", TCC_FUNC(_Func->ExistsInstHandlingRule));
|
||||||
|
s.AddSymbol("vcSetInstHandlingRule", TCC_FUNC(_Func->SetInstHandlingRule));
|
||||||
|
s.AddSymbol("vcGetInstHandlingRule", TCC_FUNC(_Func->GetInstHandlingRule));
|
||||||
|
s.AddSymbol("vcResetInstHandlingRule", TCC_FUNC(_Func->ResetInstHandlingRule));
|
||||||
|
s.AddSymbol("vcResetInstHandling", TCC_FUNC(_Func->ResetInstHandling));
|
||||||
|
s.AddSymbol("vcCreatePickup", TCC_FUNC(_Func->CreatePickup));
|
||||||
|
s.AddSymbol("vcDeletePickup", TCC_FUNC(_Func->DeletePickup));
|
||||||
|
s.AddSymbol("vcIsPickupStreamedForPlayer", TCC_FUNC(_Func->IsPickupStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcSetPickupWorld", TCC_FUNC(_Func->SetPickupWorld));
|
||||||
|
s.AddSymbol("vcGetPickupWorld", TCC_FUNC(_Func->GetPickupWorld));
|
||||||
|
s.AddSymbol("vcPickupGetAlpha", TCC_FUNC(_Func->PickupGetAlpha));
|
||||||
|
s.AddSymbol("vcPickupSetAlpha", TCC_FUNC(_Func->PickupSetAlpha));
|
||||||
|
s.AddSymbol("vcPickupIsAutomatic", TCC_FUNC(_Func->PickupIsAutomatic));
|
||||||
|
s.AddSymbol("vcPickupSetAutomatic", TCC_FUNC(_Func->PickupSetAutomatic));
|
||||||
|
s.AddSymbol("vcSetPickupAutoTimer", TCC_FUNC(_Func->SetPickupAutoTimer));
|
||||||
|
s.AddSymbol("vcGetPickupAutoTimer", TCC_FUNC(_Func->GetPickupAutoTimer));
|
||||||
|
s.AddSymbol("vcPickupRefresh", TCC_FUNC(_Func->PickupRefresh));
|
||||||
|
s.AddSymbol("vcPickupGetPos", TCC_FUNC(_Func->PickupGetPos));
|
||||||
|
s.AddSymbol("vcPickupSetPos", TCC_FUNC(_Func->PickupSetPos));
|
||||||
|
s.AddSymbol("vcPickupGetModel", TCC_FUNC(_Func->PickupGetModel));
|
||||||
|
s.AddSymbol("vcPickupGetQuantity", TCC_FUNC(_Func->PickupGetQuantity));
|
||||||
|
s.AddSymbol("vcCreateObject", TCC_FUNC(_Func->CreateObject));
|
||||||
|
s.AddSymbol("vcDeleteObject", TCC_FUNC(_Func->DeleteObject));
|
||||||
|
s.AddSymbol("vcIsObjectStreamedForPlayer", TCC_FUNC(_Func->IsObjectStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcGetObjectModel", TCC_FUNC(_Func->GetObjectModel));
|
||||||
|
s.AddSymbol("vcSetObjectWorld", TCC_FUNC(_Func->SetObjectWorld));
|
||||||
|
s.AddSymbol("vcGetObjectWorld", TCC_FUNC(_Func->GetObjectWorld));
|
||||||
|
s.AddSymbol("vcSetObjectAlpha", TCC_FUNC(_Func->SetObjectAlpha));
|
||||||
|
s.AddSymbol("vcGetObjectAlpha", TCC_FUNC(_Func->GetObjectAlpha));
|
||||||
|
s.AddSymbol("vcMoveObjectTo", TCC_FUNC(_Func->MoveObjectTo));
|
||||||
|
s.AddSymbol("vcMoveObjectBy", TCC_FUNC(_Func->MoveObjectBy));
|
||||||
|
s.AddSymbol("vcSetObjectPos", TCC_FUNC(_Func->SetObjectPos));
|
||||||
|
s.AddSymbol("vcGetObjectPos", TCC_FUNC(_Func->GetObjectPos));
|
||||||
|
s.AddSymbol("vcRotObjectTo", TCC_FUNC(_Func->RotObjectTo));
|
||||||
|
s.AddSymbol("vcRotObjectToEuler", TCC_FUNC(_Func->RotObjectToEuler));
|
||||||
|
s.AddSymbol("vcRotObjectBy", TCC_FUNC(_Func->RotObjectBy));
|
||||||
|
s.AddSymbol("vcRotObjectByEuler", TCC_FUNC(_Func->RotObjectByEuler));
|
||||||
|
s.AddSymbol("vcGetObjectRot", TCC_FUNC(_Func->GetObjectRot));
|
||||||
|
s.AddSymbol("vcGetObjectRotEuler", TCC_FUNC(_Func->GetObjectRotEuler));
|
||||||
|
s.AddSymbol("vcSetObjectShotReport", TCC_FUNC(_Func->SetObjectShotReport));
|
||||||
|
s.AddSymbol("vcIsObjectShotReport", TCC_FUNC(_Func->IsObjectShotReport));
|
||||||
|
s.AddSymbol("vcSetObjectBumpReport", TCC_FUNC(_Func->SetObjectBumpReport));
|
||||||
|
s.AddSymbol("vcIsObjectBumpReport", TCC_FUNC(_Func->IsObjectBumpReport));
|
||||||
|
s.AddSymbol("vcToggleWallglitch", TCC_FUNC(_Func->ToggleWallglitch));
|
||||||
|
s.AddSymbol("vcEnabledWallglitch", TCC_FUNC(_Func->EnabledWallglitch));
|
||||||
|
s.AddSymbol("vcSetVehicleSiren", TCC_FUNC(_Func->SetVehicleSiren));
|
||||||
|
s.AddSymbol("vcGetVehicleSiren", TCC_FUNC(_Func->GetVehicleSiren));
|
||||||
|
s.AddSymbol("vcGetPlayerUID2", TCC_FUNC(_Func->GetPlayerUID2));
|
||||||
|
s.AddSymbol("vcCreateCheckpoint", TCC_FUNC(_Func->CreateCheckpoint));
|
||||||
|
s.AddSymbol("vcDeleteCheckpoint", TCC_FUNC(_Func->DeleteCheckpoint));
|
||||||
|
s.AddSymbol("vcIsCheckpointStreamedForPlayer", TCC_FUNC(_Func->IsCheckpointStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcSetCheckpointWorld", TCC_FUNC(_Func->SetCheckpointWorld));
|
||||||
|
s.AddSymbol("vcGetCheckpointWorld", TCC_FUNC(_Func->GetCheckpointWorld));
|
||||||
|
s.AddSymbol("vcSetCheckpointColor", TCC_FUNC(_Func->SetCheckpointColor));
|
||||||
|
s.AddSymbol("vcGetCheckpointColor", TCC_FUNC(_Func->GetCheckpointColor));
|
||||||
|
s.AddSymbol("vcSetCheckpointPos", TCC_FUNC(_Func->SetCheckpointPos));
|
||||||
|
s.AddSymbol("vcGetCheckpointPos", TCC_FUNC(_Func->GetCheckpointPos));
|
||||||
|
s.AddSymbol("vcSetCheckpointRadius", TCC_FUNC(_Func->SetCheckpointRadius));
|
||||||
|
s.AddSymbol("vcGetCheckpointRadius", TCC_FUNC(_Func->GetCheckpointRadius));
|
||||||
|
s.AddSymbol("vcGetCheckpointOwner", TCC_FUNC(_Func->GetCheckpointOwner));
|
||||||
|
s.AddSymbol("vcCreateSphere", TCC_FUNC(_Func->CreateSphere));
|
||||||
|
s.AddSymbol("vcDeleteSphere", TCC_FUNC(_Func->DeleteSphere));
|
||||||
|
s.AddSymbol("vcIsSphereStreamedForPlayer", TCC_FUNC(_Func->IsSphereStreamedForPlayer));
|
||||||
|
s.AddSymbol("vcSetSphereWorld", TCC_FUNC(_Func->SetSphereWorld));
|
||||||
|
s.AddSymbol("vcGetSphereWorld", TCC_FUNC(_Func->GetSphereWorld));
|
||||||
|
s.AddSymbol("vcSetSphereColor", TCC_FUNC(_Func->SetSphereColor));
|
||||||
|
s.AddSymbol("vcGetSphereColor", TCC_FUNC(_Func->GetSphereColor));
|
||||||
|
s.AddSymbol("vcSetSpherePos", TCC_FUNC(_Func->SetSpherePos));
|
||||||
|
s.AddSymbol("vcGetSpherePos", TCC_FUNC(_Func->GetSpherePos));
|
||||||
|
s.AddSymbol("vcSetSphereRadius", TCC_FUNC(_Func->SetSphereRadius));
|
||||||
|
s.AddSymbol("vcGetSphereRadius", TCC_FUNC(_Func->GetSphereRadius));
|
||||||
|
s.AddSymbol("vcGetSphereOwner", TCC_FUNC(_Func->GetSphereOwner));
|
||||||
|
// Squirrel Library
|
||||||
|
s.AddSymbol("sq_open", TCC_FUNC(_SqAPI->open));
|
||||||
|
s.AddSymbol("sq_newthread", TCC_FUNC(_SqAPI->newthread));
|
||||||
|
s.AddSymbol("sq_seterrorhandler", TCC_FUNC(_SqAPI->seterrorhandler));
|
||||||
|
s.AddSymbol("sq_close", TCC_FUNC(_SqAPI->close));
|
||||||
|
s.AddSymbol("sq_setforeignptr", TCC_FUNC(_SqAPI->setforeignptr));
|
||||||
|
s.AddSymbol("sq_getforeignptr", TCC_FUNC(_SqAPI->getforeignptr));
|
||||||
|
s.AddSymbol("sq_setsharedforeignptr", TCC_FUNC(_SqAPI->setsharedforeignptr));
|
||||||
|
s.AddSymbol("sq_getsharedforeignptr", TCC_FUNC(_SqAPI->getsharedforeignptr));
|
||||||
|
s.AddSymbol("sq_setvmreleasehook", TCC_FUNC(_SqAPI->setvmreleasehook));
|
||||||
|
s.AddSymbol("sq_getvmreleasehook", TCC_FUNC(_SqAPI->getvmreleasehook));
|
||||||
|
s.AddSymbol("sq_setsharedreleasehook", TCC_FUNC(_SqAPI->setsharedreleasehook));
|
||||||
|
s.AddSymbol("sq_getsharedreleasehook", TCC_FUNC(_SqAPI->getsharedreleasehook));
|
||||||
|
s.AddSymbol("sq_setprintfunc", TCC_FUNC(_SqAPI->setprintfunc));
|
||||||
|
s.AddSymbol("sq_getprintfunc", TCC_FUNC(_SqAPI->getprintfunc));
|
||||||
|
s.AddSymbol("sq_geterrorfunc", TCC_FUNC(_SqAPI->geterrorfunc));
|
||||||
|
s.AddSymbol("sq_suspendvm", TCC_FUNC(_SqAPI->suspendvm));
|
||||||
|
s.AddSymbol("sq_wakeupvm", TCC_FUNC(_SqAPI->wakeupvm));
|
||||||
|
s.AddSymbol("sq_getvmstate", TCC_FUNC(_SqAPI->getvmstate));
|
||||||
|
s.AddSymbol("sq_getversion", TCC_FUNC(_SqAPI->getversion));
|
||||||
|
s.AddSymbol("sq_compile", TCC_FUNC(_SqAPI->compile));
|
||||||
|
s.AddSymbol("sq_compilebuffer", TCC_FUNC(_SqAPI->compilebuffer));
|
||||||
|
s.AddSymbol("sq_enabledebuginfo", TCC_FUNC(_SqAPI->enabledebuginfo));
|
||||||
|
s.AddSymbol("sq_notifyallexceptions", TCC_FUNC(_SqAPI->notifyallexceptions));
|
||||||
|
s.AddSymbol("sq_setcompilererrorhandler", TCC_FUNC(_SqAPI->setcompilererrorhandler));
|
||||||
|
s.AddSymbol("sq_push", TCC_FUNC(_SqAPI->push));
|
||||||
|
s.AddSymbol("sq_pop", TCC_FUNC(_SqAPI->pop));
|
||||||
|
s.AddSymbol("sq_poptop", TCC_FUNC(_SqAPI->poptop));
|
||||||
|
s.AddSymbol("sq_remove", TCC_FUNC(_SqAPI->remove));
|
||||||
|
s.AddSymbol("sq_gettop", TCC_FUNC(_SqAPI->gettop));
|
||||||
|
s.AddSymbol("sq_settop", TCC_FUNC(_SqAPI->settop));
|
||||||
|
s.AddSymbol("sq_reservestack", TCC_FUNC(_SqAPI->reservestack));
|
||||||
|
s.AddSymbol("sq_cmp", TCC_FUNC(_SqAPI->cmp));
|
||||||
|
s.AddSymbol("sq_move", TCC_FUNC(_SqAPI->move));
|
||||||
|
s.AddSymbol("sq_newuserdata", TCC_FUNC(_SqAPI->newuserdata));
|
||||||
|
s.AddSymbol("sq_newtable", TCC_FUNC(_SqAPI->newtable));
|
||||||
|
s.AddSymbol("sq_newtableex", TCC_FUNC(_SqAPI->newtableex));
|
||||||
|
s.AddSymbol("sq_newarray", TCC_FUNC(_SqAPI->newarray));
|
||||||
|
s.AddSymbol("sq_newclosure", TCC_FUNC(_SqAPI->newclosure));
|
||||||
|
s.AddSymbol("sq_setparamscheck", TCC_FUNC(_SqAPI->setparamscheck));
|
||||||
|
s.AddSymbol("sq_bindenv", TCC_FUNC(_SqAPI->bindenv));
|
||||||
|
s.AddSymbol("sq_setclosureroot", TCC_FUNC(_SqAPI->setclosureroot));
|
||||||
|
s.AddSymbol("sq_getclosureroot", TCC_FUNC(_SqAPI->getclosureroot));
|
||||||
|
s.AddSymbol("sq_pushstring", TCC_FUNC(_SqAPI->pushstring));
|
||||||
|
s.AddSymbol("sq_pushfloat", TCC_FUNC(_SqAPI->pushfloat));
|
||||||
|
s.AddSymbol("sq_pushinteger", TCC_FUNC(_SqAPI->pushinteger));
|
||||||
|
s.AddSymbol("sq_pushbool", TCC_FUNC(_SqAPI->pushbool));
|
||||||
|
s.AddSymbol("sq_pushuserpointer", TCC_FUNC(_SqAPI->pushuserpointer));
|
||||||
|
s.AddSymbol("sq_pushnull", TCC_FUNC(_SqAPI->pushnull));
|
||||||
|
s.AddSymbol("sq_pushthread", TCC_FUNC(_SqAPI->pushthread));
|
||||||
|
s.AddSymbol("sq_gettype", TCC_FUNC(_SqAPI->gettype));
|
||||||
|
s.AddSymbol("sq_typeof", TCC_FUNC(_SqAPI->typeof_));
|
||||||
|
s.AddSymbol("sq_getsize", TCC_FUNC(_SqAPI->getsize));
|
||||||
|
s.AddSymbol("sq_gethash", TCC_FUNC(_SqAPI->gethash));
|
||||||
|
s.AddSymbol("sq_getbase", TCC_FUNC(_SqAPI->getbase));
|
||||||
|
s.AddSymbol("sq_instanceof", TCC_FUNC(_SqAPI->instanceof));
|
||||||
|
s.AddSymbol("sq_tostring", TCC_FUNC(_SqAPI->tostring));
|
||||||
|
s.AddSymbol("sq_tobool", TCC_FUNC(_SqAPI->tobool));
|
||||||
|
s.AddSymbol("sq_getstring", TCC_FUNC(_SqAPI->getstring));
|
||||||
|
s.AddSymbol("sq_getinteger", TCC_FUNC(_SqAPI->getinteger));
|
||||||
|
s.AddSymbol("sq_getfloat", TCC_FUNC(_SqAPI->getfloat));
|
||||||
|
s.AddSymbol("sq_getbool", TCC_FUNC(_SqAPI->getbool));
|
||||||
|
s.AddSymbol("sq_getthread", TCC_FUNC(_SqAPI->getthread));
|
||||||
|
s.AddSymbol("sq_getuserpointer", TCC_FUNC(_SqAPI->getuserpointer));
|
||||||
|
s.AddSymbol("sq_getuserdata", TCC_FUNC(_SqAPI->getuserdata));
|
||||||
|
s.AddSymbol("sq_settypetag", TCC_FUNC(_SqAPI->settypetag));
|
||||||
|
s.AddSymbol("sq_gettypetag", TCC_FUNC(_SqAPI->gettypetag));
|
||||||
|
s.AddSymbol("sq_setreleasehook", TCC_FUNC(_SqAPI->setreleasehook));
|
||||||
|
s.AddSymbol("sq_getreleasehook", TCC_FUNC(_SqAPI->getreleasehook));
|
||||||
|
s.AddSymbol("sq_getscratchpad", TCC_FUNC(_SqAPI->getscratchpad));
|
||||||
|
s.AddSymbol("sq_getfunctioninfo", TCC_FUNC(_SqAPI->getfunctioninfo));
|
||||||
|
s.AddSymbol("sq_getclosureinfo", TCC_FUNC(_SqAPI->getclosureinfo));
|
||||||
|
s.AddSymbol("sq_getclosurename", TCC_FUNC(_SqAPI->getclosurename));
|
||||||
|
s.AddSymbol("sq_setnativeclosurename", TCC_FUNC(_SqAPI->setnativeclosurename));
|
||||||
|
s.AddSymbol("sq_setinstanceup", TCC_FUNC(_SqAPI->setinstanceup));
|
||||||
|
s.AddSymbol("sq_getinstanceup", TCC_FUNC(_SqAPI->getinstanceup));
|
||||||
|
s.AddSymbol("sq_setclassudsize", TCC_FUNC(_SqAPI->setclassudsize));
|
||||||
|
s.AddSymbol("sq_newclass", TCC_FUNC(_SqAPI->newclass));
|
||||||
|
s.AddSymbol("sq_createinstance", TCC_FUNC(_SqAPI->createinstance));
|
||||||
|
s.AddSymbol("sq_setattributes", TCC_FUNC(_SqAPI->setattributes));
|
||||||
|
s.AddSymbol("sq_getattributes", TCC_FUNC(_SqAPI->getattributes));
|
||||||
|
s.AddSymbol("sq_getclass", TCC_FUNC(_SqAPI->getclass));
|
||||||
|
s.AddSymbol("sq_weakref", TCC_FUNC(_SqAPI->weakref));
|
||||||
|
s.AddSymbol("sq_getdefaultdelegate", TCC_FUNC(_SqAPI->getdefaultdelegate));
|
||||||
|
s.AddSymbol("sq_getmemberhandle", TCC_FUNC(_SqAPI->getmemberhandle));
|
||||||
|
s.AddSymbol("sq_getbyhandle", TCC_FUNC(_SqAPI->getbyhandle));
|
||||||
|
s.AddSymbol("sq_setbyhandle", TCC_FUNC(_SqAPI->setbyhandle));
|
||||||
|
s.AddSymbol("sq_pushroottable", TCC_FUNC(_SqAPI->pushroottable));
|
||||||
|
s.AddSymbol("sq_pushregistrytable", TCC_FUNC(_SqAPI->pushregistrytable));
|
||||||
|
s.AddSymbol("sq_pushconsttable", TCC_FUNC(_SqAPI->pushconsttable));
|
||||||
|
s.AddSymbol("sq_setroottable", TCC_FUNC(_SqAPI->setroottable));
|
||||||
|
s.AddSymbol("sq_setconsttable", TCC_FUNC(_SqAPI->setconsttable));
|
||||||
|
s.AddSymbol("sq_newslot", TCC_FUNC(_SqAPI->newslot));
|
||||||
|
s.AddSymbol("sq_deleteslot", TCC_FUNC(_SqAPI->deleteslot));
|
||||||
|
s.AddSymbol("sq_set", TCC_FUNC(_SqAPI->set));
|
||||||
|
s.AddSymbol("sq_get", TCC_FUNC(_SqAPI->get));
|
||||||
|
s.AddSymbol("sq_rawget", TCC_FUNC(_SqAPI->rawget));
|
||||||
|
s.AddSymbol("sq_rawset", TCC_FUNC(_SqAPI->rawset));
|
||||||
|
s.AddSymbol("sq_rawdeleteslot", TCC_FUNC(_SqAPI->rawdeleteslot));
|
||||||
|
s.AddSymbol("sq_newmember", TCC_FUNC(_SqAPI->newmember));
|
||||||
|
s.AddSymbol("sq_rawnewmember", TCC_FUNC(_SqAPI->rawnewmember));
|
||||||
|
s.AddSymbol("sq_arrayappend", TCC_FUNC(_SqAPI->arrayappend));
|
||||||
|
s.AddSymbol("sq_arraypop", TCC_FUNC(_SqAPI->arraypop));
|
||||||
|
s.AddSymbol("sq_arrayresize", TCC_FUNC(_SqAPI->arrayresize));
|
||||||
|
s.AddSymbol("sq_arrayreverse", TCC_FUNC(_SqAPI->arrayreverse));
|
||||||
|
s.AddSymbol("sq_arrayremove", TCC_FUNC(_SqAPI->arrayremove));
|
||||||
|
s.AddSymbol("sq_arrayinsert", TCC_FUNC(_SqAPI->arrayinsert));
|
||||||
|
s.AddSymbol("sq_setdelegate", TCC_FUNC(_SqAPI->setdelegate));
|
||||||
|
s.AddSymbol("sq_getdelegate", TCC_FUNC(_SqAPI->getdelegate));
|
||||||
|
s.AddSymbol("sq_clone", TCC_FUNC(_SqAPI->clone));
|
||||||
|
s.AddSymbol("sq_setfreevariable", TCC_FUNC(_SqAPI->setfreevariable));
|
||||||
|
s.AddSymbol("sq_next", TCC_FUNC(_SqAPI->next));
|
||||||
|
s.AddSymbol("sq_getweakrefval", TCC_FUNC(_SqAPI->getweakrefval));
|
||||||
|
s.AddSymbol("sq_clear", TCC_FUNC(_SqAPI->clear));
|
||||||
|
s.AddSymbol("sq_call", TCC_FUNC(_SqAPI->call));
|
||||||
|
s.AddSymbol("sq_resume", TCC_FUNC(_SqAPI->resume));
|
||||||
|
s.AddSymbol("sq_getlocal", TCC_FUNC(_SqAPI->getlocal));
|
||||||
|
s.AddSymbol("sq_getcallee", TCC_FUNC(_SqAPI->getcallee));
|
||||||
|
s.AddSymbol("sq_getfreevariable", TCC_FUNC(_SqAPI->getfreevariable));
|
||||||
|
s.AddSymbol("sq_throwerror", TCC_FUNC(_SqAPI->throwerror));
|
||||||
|
s.AddSymbol("sq_throwobject", TCC_FUNC(_SqAPI->throwobject));
|
||||||
|
s.AddSymbol("sq_reseterror", TCC_FUNC(_SqAPI->reseterror));
|
||||||
|
s.AddSymbol("sq_getlasterror", TCC_FUNC(_SqAPI->getlasterror));
|
||||||
|
s.AddSymbol("sq_getstackobj", TCC_FUNC(_SqAPI->getstackobj));
|
||||||
|
s.AddSymbol("sq_pushobject", TCC_FUNC(_SqAPI->pushobject));
|
||||||
|
s.AddSymbol("sq_addref", TCC_FUNC(_SqAPI->addref));
|
||||||
|
s.AddSymbol("sq_release", TCC_FUNC(_SqAPI->release));
|
||||||
|
s.AddSymbol("sq_getrefcount", TCC_FUNC(_SqAPI->getrefcount));
|
||||||
|
s.AddSymbol("sq_resetobject", TCC_FUNC(_SqAPI->resetobject));
|
||||||
|
s.AddSymbol("sq_objtostring", TCC_FUNC(_SqAPI->objtostring));
|
||||||
|
s.AddSymbol("sq_objtobool", TCC_FUNC(_SqAPI->objtobool));
|
||||||
|
s.AddSymbol("sq_objtointeger", TCC_FUNC(_SqAPI->objtointeger));
|
||||||
|
s.AddSymbol("sq_objtofloat", TCC_FUNC(_SqAPI->objtofloat));
|
||||||
|
s.AddSymbol("sq_objtouserpointer", TCC_FUNC(_SqAPI->objtouserpointer));
|
||||||
|
s.AddSymbol("sq_getobjtypetag", TCC_FUNC(_SqAPI->getobjtypetag));
|
||||||
|
s.AddSymbol("sq_getvmrefcount", TCC_FUNC(_SqAPI->getvmrefcount));
|
||||||
|
s.AddSymbol("sq_collectgarbage", TCC_FUNC(_SqAPI->collectgarbage));
|
||||||
|
s.AddSymbol("sq_resurrectunreachable", TCC_FUNC(_SqAPI->resurrectunreachable));
|
||||||
|
s.AddSymbol("sq_writeclosure", TCC_FUNC(_SqAPI->writeclosure));
|
||||||
|
s.AddSymbol("sq_readclosure", TCC_FUNC(_SqAPI->readclosure));
|
||||||
|
s.AddSymbol("sq_malloc", TCC_FUNC(_SqAPI->malloc));
|
||||||
|
s.AddSymbol("sq_realloc", TCC_FUNC(_SqAPI->realloc));
|
||||||
|
s.AddSymbol("sq_free", TCC_FUNC(_SqAPI->free));
|
||||||
|
s.AddSymbol("sq_stackinfos", TCC_FUNC(_SqAPI->stackinfos));
|
||||||
|
s.AddSymbol("sq_setdebughook", TCC_FUNC(_SqAPI->setdebughook));
|
||||||
|
s.AddSymbol("sq_setnativedebughook", TCC_FUNC(_SqAPI->setnativedebughook));
|
||||||
|
s.AddSymbol("sqstd_loadfile", TCC_FUNC(_SqAPI->loadfile));
|
||||||
|
s.AddSymbol("sqstd_dofile", TCC_FUNC(_SqAPI->dofile));
|
||||||
|
s.AddSymbol("sqstd_writeclosuretofile", TCC_FUNC(_SqAPI->writeclosuretofile));
|
||||||
|
s.AddSymbol("sqstd_createblob", TCC_FUNC(_SqAPI->createblob));
|
||||||
|
s.AddSymbol("sqstd_getblob", TCC_FUNC(_SqAPI->getblob));
|
||||||
|
s.AddSymbol("sqstd_getblobsize", TCC_FUNC(_SqAPI->getblobsize));
|
||||||
|
s.AddSymbol("sqstd_format", TCC_FUNC(_SqAPI->format));
|
||||||
|
// Host Module
|
||||||
|
s.AddSymbol("SqMod_GetSquirrelVM", TCC_FUNC(_SqMod->GetSquirrelVM));
|
||||||
|
s.AddSymbol("SqMod_LogDbg", TCC_FUNC(_SqMod->LogDbg));
|
||||||
|
s.AddSymbol("SqMod_LogUsr", TCC_FUNC(_SqMod->LogUsr));
|
||||||
|
s.AddSymbol("SqMod_LogScs", TCC_FUNC(_SqMod->LogScs));
|
||||||
|
s.AddSymbol("SqMod_LogInf", TCC_FUNC(_SqMod->LogInf));
|
||||||
|
s.AddSymbol("SqMod_LogWrn", TCC_FUNC(_SqMod->LogWrn));
|
||||||
|
s.AddSymbol("SqMod_LogErr", TCC_FUNC(_SqMod->LogErr));
|
||||||
|
s.AddSymbol("SqMod_LogFtl", TCC_FUNC(_SqMod->LogFtl));
|
||||||
|
s.AddSymbol("SqMod_LogSDbg", TCC_FUNC(_SqMod->LogSDbg));
|
||||||
|
s.AddSymbol("SqMod_LogSUsr", TCC_FUNC(_SqMod->LogSUsr));
|
||||||
|
s.AddSymbol("SqMod_LogSScs", TCC_FUNC(_SqMod->LogSScs));
|
||||||
|
s.AddSymbol("SqMod_LogSInf", TCC_FUNC(_SqMod->LogSInf));
|
||||||
|
s.AddSymbol("SqMod_LogSWrn", TCC_FUNC(_SqMod->LogSWrn));
|
||||||
|
s.AddSymbol("SqMod_LogSErr", TCC_FUNC(_SqMod->LogSErr));
|
||||||
|
s.AddSymbol("SqMod_LogSFtl", TCC_FUNC(_SqMod->LogSFtl));
|
||||||
|
s.AddSymbol("SqMod_LoadScript", TCC_FUNC(_SqMod->LoadScript));
|
||||||
|
s.AddSymbol("SqMod_GetSLongValue", TCC_FUNC(_SqMod->GetSLongValue));
|
||||||
|
s.AddSymbol("SqMod_PushSLongObject", TCC_FUNC(_SqMod->PushSLongObject));
|
||||||
|
s.AddSymbol("SqMod_GetULongValue", TCC_FUNC(_SqMod->GetULongValue));
|
||||||
|
s.AddSymbol("SqMod_PushULongObject", TCC_FUNC(_SqMod->PushULongObject));
|
||||||
|
s.AddSymbol("SqMod_GetCurrentSysTime", TCC_FUNC(_SqMod->GetCurrentSysTime));
|
||||||
|
s.AddSymbol("SqMod_GetEpochTimeMicro", TCC_FUNC(_SqMod->GetEpochTimeMicro));
|
||||||
|
s.AddSymbol("SqMod_GetEpochTimeMilli", TCC_FUNC(_SqMod->GetEpochTimeMilli));
|
||||||
|
s.AddSymbol("SqMod_GetTimestamp", TCC_FUNC(_SqMod->GetTimestamp));
|
||||||
|
s.AddSymbol("SqMod_PushTimestamp", TCC_FUNC(_SqMod->PushTimestamp));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
1474
modules/tcc/Common.cpp
Normal file
1474
modules/tcc/Common.cpp
Normal file
File diff suppressed because it is too large
Load Diff
695
modules/tcc/Common.hpp
Normal file
695
modules/tcc/Common.hpp
Normal file
@ -0,0 +1,695 @@
|
|||||||
|
#ifndef _SQTCC_COMMON_HPP_
|
||||||
|
#define _SQTCC_COMMON_HPP_
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "ModBase.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <vcmp.h>
|
||||||
|
#include <sqrat.h>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct TCCState;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* SOFTWARE INFORMATION
|
||||||
|
*/
|
||||||
|
#define SQTCC_NAME "Squirrel TCC Module"
|
||||||
|
#define SQTCC_AUTHOR "Sandu Liviu Catalin (S.L.C)"
|
||||||
|
#define SQTCC_COPYRIGHT "Copyright (C) 2016 Sandu Liviu Catalin"
|
||||||
|
#define SQTCC_HOST_NAME "SqModTCCHost"
|
||||||
|
#define SQTCC_VERSION 001
|
||||||
|
#define SQTCC_VERSION_STR "0.0.1"
|
||||||
|
#define SQTCC_VERSION_MAJOR 0
|
||||||
|
#define SQTCC_VERSION_MINOR 0
|
||||||
|
#define SQTCC_VERSION_PATCH 1
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the temporary buffer.
|
||||||
|
*/
|
||||||
|
SStr GetTempBuff();
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the size of the temporary buffer.
|
||||||
|
*/
|
||||||
|
Uint32 GetTempBuffSize();
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Throw a formatted exception.
|
||||||
|
*/
|
||||||
|
void SqThrowF(CSStr str, ...);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Generate a formatted string.
|
||||||
|
*/
|
||||||
|
CSStr FmtStr(CSStr str, ...);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Implements RAII to restore the VM stack to it's initial size on function exit.
|
||||||
|
*/
|
||||||
|
struct StackGuard
|
||||||
|
{
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Base constructor.
|
||||||
|
*/
|
||||||
|
StackGuard(HSQUIRRELVM vm);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~StackGuard();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor.
|
||||||
|
*/
|
||||||
|
StackGuard(const StackGuard &);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move constructor.
|
||||||
|
*/
|
||||||
|
StackGuard(StackGuard &&);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy assignment operator.
|
||||||
|
*/
|
||||||
|
StackGuard & operator = (const StackGuard &);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move assignment operator.
|
||||||
|
*/
|
||||||
|
StackGuard & operator = (StackGuard &&);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
Int32 m_Top; /* The top of the stack when this instance was created. */
|
||||||
|
HSQUIRRELVM m_VM; /* The VM where the stack should be restored. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Helper structure for retrieving a value from the stack as a string or a formatted string.
|
||||||
|
*/
|
||||||
|
struct StackStrF
|
||||||
|
{
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
CSStr mPtr; // Pointer to the C string that was retrieved.
|
||||||
|
SQInteger mLen; // The string length if it could be retrieved.
|
||||||
|
SQRESULT mRes; // The result of the retrieval attempts.
|
||||||
|
HSQOBJECT mObj; // Strong reference to the string object.
|
||||||
|
HSQUIRRELVM mVM; // The associated virtual machine.
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Base constructor.
|
||||||
|
*/
|
||||||
|
StackStrF(HSQUIRRELVM vm, SQInteger idx, bool fmt = true);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor. (disabled)
|
||||||
|
*/
|
||||||
|
StackStrF(const StackStrF & o) = delete;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor. (disabled)
|
||||||
|
*/
|
||||||
|
StackStrF(StackStrF && o) = delete;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~StackStrF();
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor. (disabled)
|
||||||
|
*/
|
||||||
|
StackStrF & operator = (const StackStrF & o) = delete;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor. (disabled)
|
||||||
|
*/
|
||||||
|
StackStrF & operator = (StackStrF && o) = delete;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
class State;
|
||||||
|
class Symbol;
|
||||||
|
class StateHnd;
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Register the standard API on the specified compiler state.
|
||||||
|
*/
|
||||||
|
extern void RegisterAPI(StateHnd & s);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Server events that can be toggled.
|
||||||
|
*/
|
||||||
|
enum EventType
|
||||||
|
{
|
||||||
|
EvUnknown = 0,
|
||||||
|
EvOnFrame,
|
||||||
|
EvOnPlayerConnect,
|
||||||
|
EvOnPlayerDisconnect,
|
||||||
|
EvOnPlayerBeginTyping,
|
||||||
|
EvOnPlayerEndTyping,
|
||||||
|
EvOnPlayerRequestClass,
|
||||||
|
EvOnPlayerRequestSpawn,
|
||||||
|
EvOnPlayerSpawn,
|
||||||
|
EvOnPlayerDeath,
|
||||||
|
EvOnPlayerUpdate,
|
||||||
|
EvOnPlayerRequestEnter,
|
||||||
|
EvOnPlayerEnterVehicle,
|
||||||
|
EvOnPlayerExitVehicle,
|
||||||
|
EvOnPlayerNameChange,
|
||||||
|
EvOnPlayerStateChange,
|
||||||
|
EvOnPlayerActionChange,
|
||||||
|
EvOnPlayerOnFireChange,
|
||||||
|
EvOnPlayerCrouchChange,
|
||||||
|
EvOnPlayerGameKeysChange,
|
||||||
|
EvOnPickupClaimPicked,
|
||||||
|
EvOnPickupPickedUp,
|
||||||
|
EvOnPickupRespawn,
|
||||||
|
EvOnVehicleUpdate,
|
||||||
|
EvOnVehicleExplode,
|
||||||
|
EvOnVehicleRespawn,
|
||||||
|
EvOnObjectShot,
|
||||||
|
EvOnObjectBump,
|
||||||
|
EvOnPublicMessage,
|
||||||
|
EvOnCommandMessage,
|
||||||
|
EvOnPrivateMessage,
|
||||||
|
EvOnLoginAttempt,
|
||||||
|
EvOnEntityPoolChange,
|
||||||
|
EvOnKeyBindDown,
|
||||||
|
EvOnKeyBindUp,
|
||||||
|
EvOnPlayerAwayChange,
|
||||||
|
EvOnPlayerSpectate,
|
||||||
|
EvOnPlayerCrashReport,
|
||||||
|
EvOnServerPerformanceReport,
|
||||||
|
EvOnCheckpointEntered,
|
||||||
|
EvOnCheckpointExited,
|
||||||
|
EvOnSphereEntered,
|
||||||
|
EvOnSphereExited,
|
||||||
|
EvCount
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Manages a reference counted compiler state handle.
|
||||||
|
*/
|
||||||
|
class StateHnd
|
||||||
|
{
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
friend class State;
|
||||||
|
friend class Symbol;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef TCCState Type; // The managed type.
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef Type* Pointer; // Pointer to the managed type.
|
||||||
|
typedef const Type* ConstPtr; // Constant pointer to the managed type.
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef Type& Reference; // Reference to the managed type.
|
||||||
|
typedef const Type& ConstRef; // Constant reference to the managed type.
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef unsigned int Counter; // Reference counter type.
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Validate the managed handle and throw exception if invalid.
|
||||||
|
*/
|
||||||
|
void Validate() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The structure that holds the data associated with a certain state.
|
||||||
|
*/
|
||||||
|
struct Handle
|
||||||
|
{
|
||||||
|
// ----------------------------------------------------------------------------------------
|
||||||
|
Pointer mPtr; // The TCC state handle resource.
|
||||||
|
Counter mRef; // Reference count to the managed handle.
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------------
|
||||||
|
SDK_OnInitServer mOnInitServer;
|
||||||
|
SDK_OnShutdownServer mOnShutdownServer;
|
||||||
|
SDK_OnFrame mOnFrame;
|
||||||
|
SDK_OnPlayerConnect mOnPlayerConnect;
|
||||||
|
SDK_OnPlayerDisconnect mOnPlayerDisconnect;
|
||||||
|
SDK_OnPlayerBeginTyping mOnPlayerBeginTyping;
|
||||||
|
SDK_OnPlayerEndTyping mOnPlayerEndTyping;
|
||||||
|
SDK_OnPlayerRequestClass mOnPlayerRequestClass;
|
||||||
|
SDK_OnPlayerRequestSpawn mOnPlayerRequestSpawn;
|
||||||
|
SDK_OnPlayerSpawn mOnPlayerSpawn;
|
||||||
|
SDK_OnPlayerDeath mOnPlayerDeath;
|
||||||
|
SDK_OnPlayerUpdate mOnPlayerUpdate;
|
||||||
|
SDK_OnPlayerRequestEnter mOnPlayerRequestEnter;
|
||||||
|
SDK_OnPlayerEnterVehicle mOnPlayerEnterVehicle;
|
||||||
|
SDK_OnPlayerExitVehicle mOnPlayerExitVehicle;
|
||||||
|
SDK_OnPlayerNameChange mOnPlayerNameChange;
|
||||||
|
SDK_OnPlayerStateChange mOnPlayerStateChange;
|
||||||
|
SDK_OnPlayerActionChange mOnPlayerActionChange;
|
||||||
|
SDK_OnPlayerOnFireChange mOnPlayerOnFireChange;
|
||||||
|
SDK_OnPlayerCrouchChange mOnPlayerCrouchChange;
|
||||||
|
SDK_OnPlayerGameKeysChange mOnPlayerGameKeysChange;
|
||||||
|
SDK_OnPickupClaimPicked mOnPickupClaimPicked;
|
||||||
|
SDK_OnPickupPickedUp mOnPickupPickedUp;
|
||||||
|
SDK_OnPickupRespawn mOnPickupRespawn;
|
||||||
|
SDK_OnVehicleUpdate mOnVehicleUpdate;
|
||||||
|
SDK_OnVehicleExplode mOnVehicleExplode;
|
||||||
|
SDK_OnVehicleRespawn mOnVehicleRespawn;
|
||||||
|
SDK_OnObjectShot mOnObjectShot;
|
||||||
|
SDK_OnObjectBump mOnObjectBump;
|
||||||
|
SDK_OnPublicMessage mOnPublicMessage;
|
||||||
|
SDK_OnCommandMessage mOnCommandMessage;
|
||||||
|
SDK_OnPrivateMessage mOnPrivateMessage;
|
||||||
|
SDK_OnInternalCommand mOnInternalCommand;
|
||||||
|
SDK_OnLoginAttempt mOnLoginAttempt;
|
||||||
|
SDK_OnEntityPoolChange mOnEntityPoolChange;
|
||||||
|
SDK_OnKeyBindDown mOnKeyBindDown;
|
||||||
|
SDK_OnKeyBindUp mOnKeyBindUp;
|
||||||
|
SDK_OnPlayerAwayChange mOnPlayerAwayChange;
|
||||||
|
SDK_OnPlayerSpectate mOnPlayerSpectate;
|
||||||
|
SDK_OnPlayerCrashReport mOnPlayerCrashReport;
|
||||||
|
SDK_OnServerPerformanceReport mOnServerPerformanceReport;
|
||||||
|
SDK_OnCheckpointEntered mOnCheckpointEntered;
|
||||||
|
SDK_OnCheckpointExited mOnCheckpointExited;
|
||||||
|
SDK_OnSphereEntered mOnSphereEntered;
|
||||||
|
SDK_OnSphereExited mOnSphereExited;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------------
|
||||||
|
bool mRelocated; // Whether the state was relocated.
|
||||||
|
bool mNoErrors; // Don't output errors even if there is no error handler.
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------------
|
||||||
|
Function mErrorHandler; // The custom script error handler.
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------------
|
||||||
|
String mName; // The name given to this state.
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------------------
|
||||||
|
* Base constructor.
|
||||||
|
*/
|
||||||
|
Handle(Counter counter, CSStr name);
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~Handle();
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef std::vector< Handle * > Handles; // List of handles that receive callbacks.
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
static Handles s_Handles;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* See whether the specified state instance is in the handles list.
|
||||||
|
*/
|
||||||
|
static bool IsListed(Handle * hnd);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add the specified state instance to the handles list to receive callbacks.
|
||||||
|
*/
|
||||||
|
static void Remember(Handle * hnd);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Remove the specified state instance from the handles list.
|
||||||
|
*/
|
||||||
|
static void Forget(Handle * hnd);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Make the specified handle to be the first in the list.
|
||||||
|
*/
|
||||||
|
static void ToHead(Handle * hnd);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The error handler assigned to every created state.
|
||||||
|
*/
|
||||||
|
static void ErrorHandler(void * opaque, const char * msg);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a symbol to the compiled program.
|
||||||
|
*/
|
||||||
|
void PushSymbol(CSStr name, const void * value);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Return symbol value or NULL if not found.
|
||||||
|
*/
|
||||||
|
void * PullSymbol(CSStr name) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
Handle* m_Hnd;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Grab a strong reference to a state handle.
|
||||||
|
*/
|
||||||
|
void Grab()
|
||||||
|
{
|
||||||
|
if (m_Hnd)
|
||||||
|
{
|
||||||
|
++(m_Hnd->mRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Drop a strong reference to a state handle.
|
||||||
|
*/
|
||||||
|
void Drop()
|
||||||
|
{
|
||||||
|
if (m_Hnd && --(m_Hnd->mRef) == 0)
|
||||||
|
{
|
||||||
|
delete m_Hnd; // Let the destructor take care of cleaning up (if necessary)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Base constructor.
|
||||||
|
*/
|
||||||
|
StateHnd(CSStr name)
|
||||||
|
: m_Hnd(name ? new Handle(1, name) : nullptr)
|
||||||
|
{
|
||||||
|
RegisterAPI(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Default constructor (null).
|
||||||
|
*/
|
||||||
|
StateHnd()
|
||||||
|
: m_Hnd(nullptr)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor.
|
||||||
|
*/
|
||||||
|
StateHnd(const StateHnd & o)
|
||||||
|
: m_Hnd(o.m_Hnd)
|
||||||
|
{
|
||||||
|
Grab();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move constructor.
|
||||||
|
*/
|
||||||
|
StateHnd(StateHnd && o)
|
||||||
|
: m_Hnd(o.m_Hnd)
|
||||||
|
{
|
||||||
|
o.m_Hnd = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~StateHnd()
|
||||||
|
{
|
||||||
|
Drop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy assignment operator.
|
||||||
|
*/
|
||||||
|
StateHnd & operator = (const StateHnd & o)
|
||||||
|
{
|
||||||
|
if (m_Hnd != o.m_Hnd)
|
||||||
|
{
|
||||||
|
Drop();
|
||||||
|
m_Hnd = o.m_Hnd;
|
||||||
|
Grab();
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move assignment operator.
|
||||||
|
*/
|
||||||
|
StateHnd & operator = (StateHnd && o)
|
||||||
|
{
|
||||||
|
if (m_Hnd != o.m_Hnd)
|
||||||
|
{
|
||||||
|
m_Hnd = o.m_Hnd;
|
||||||
|
o.m_Hnd = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an equality comparison between two state handles.
|
||||||
|
*/
|
||||||
|
bool operator == (const StateHnd & o) const
|
||||||
|
{
|
||||||
|
return (m_Hnd == o.m_Hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an inequality comparison between two state handles.
|
||||||
|
*/
|
||||||
|
bool operator != (const StateHnd & o) const
|
||||||
|
{
|
||||||
|
return (m_Hnd != o.m_Hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to boolean for use in boolean operations.
|
||||||
|
*/
|
||||||
|
operator bool () const
|
||||||
|
{
|
||||||
|
return m_Hnd && m_Hnd->mPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the managed instance.
|
||||||
|
*/
|
||||||
|
operator Pointer ()
|
||||||
|
{
|
||||||
|
return m_Hnd ? m_Hnd->mPtr : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the managed instance.
|
||||||
|
*/
|
||||||
|
operator Pointer () const
|
||||||
|
{
|
||||||
|
return m_Hnd ? m_Hnd->mPtr : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the managed instance.
|
||||||
|
*/
|
||||||
|
operator Reference ()
|
||||||
|
{
|
||||||
|
assert(m_Hnd && m_Hnd->mPtr);
|
||||||
|
return *(m_Hnd->mPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the managed instance.
|
||||||
|
*/
|
||||||
|
operator ConstRef () const
|
||||||
|
{
|
||||||
|
assert(m_Hnd && m_Hnd->mPtr);
|
||||||
|
return *(m_Hnd->mPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Member operator for dereferencing the managed pointer.
|
||||||
|
*/
|
||||||
|
Handle * operator -> () const
|
||||||
|
{
|
||||||
|
assert(m_Hnd);
|
||||||
|
return m_Hnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Indirection operator for obtaining a reference of the managed pointer.
|
||||||
|
*/
|
||||||
|
Handle & operator * () const
|
||||||
|
{
|
||||||
|
assert(m_Hnd);
|
||||||
|
return *m_Hnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the raw handle structure pointer.
|
||||||
|
*/
|
||||||
|
Handle * HndPtr()
|
||||||
|
{
|
||||||
|
return m_Hnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the raw handle structure pointer.
|
||||||
|
*/
|
||||||
|
Handle * HndPtr() const
|
||||||
|
{
|
||||||
|
return m_Hnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the number of active references to the managed instance.
|
||||||
|
*/
|
||||||
|
Counter Count() const
|
||||||
|
{
|
||||||
|
return m_Hnd ? m_Hnd->mRef : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set options as from command line (multiple supported).
|
||||||
|
*/
|
||||||
|
void SetOptions(CSStr opt) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Define preprocessor symbol 'sym'. Can put optional value.
|
||||||
|
*/
|
||||||
|
void DefineSymbol(CSStr sym, CSStr value) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Undefine preprocess symbol 'sym'.
|
||||||
|
*/
|
||||||
|
void UndefineSymbol(CSStr sym) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add include path.
|
||||||
|
*/
|
||||||
|
void AddIncludePath(CSStr path) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add in system include path.
|
||||||
|
*/
|
||||||
|
void AddSysIncludePath(CSStr path) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set CONFIG_TCCDIR at runtime.
|
||||||
|
*/
|
||||||
|
void SetLibPath(CSStr path) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Equivalent to -Lpath option.
|
||||||
|
*/
|
||||||
|
void AddLibraryPath(CSStr path) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The library name is the same as the argument of the '-l' option.
|
||||||
|
*/
|
||||||
|
void AddLibrary(CSStr name) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Compile a string containing a C source.
|
||||||
|
*/
|
||||||
|
void CompileString(CSStr str) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a file (C file, dll, object, library, ld script).
|
||||||
|
*/
|
||||||
|
void AddFile(CSStr filename, Int32 type) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Do all relocations (needed before using tcc_get_symbol())
|
||||||
|
*/
|
||||||
|
void Relocate() const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a symbol to the compiled program.
|
||||||
|
*/
|
||||||
|
template < typename T > void AddSymbol(CSStr name, T value)
|
||||||
|
{
|
||||||
|
PushSymbol(name, reinterpret_cast< const void * >(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Return symbol value or NULL if not found.
|
||||||
|
*/
|
||||||
|
template < typename T > T GetSymbol(CSStr name) const
|
||||||
|
{
|
||||||
|
return reinterpret_cast< T >(PullSymbol(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Server callbacks.
|
||||||
|
*/
|
||||||
|
static int OnInitServer(void);
|
||||||
|
static void OnShutdownServer(void);
|
||||||
|
static void OnFrame(float delta);
|
||||||
|
static void OnPlayerConnect(int player);
|
||||||
|
static void OnPlayerDisconnect(int player, int reason);
|
||||||
|
static void OnPlayerBeginTyping(int player);
|
||||||
|
static void OnPlayerEndTyping(int player);
|
||||||
|
static int OnPlayerRequestClass(int player, int offset);
|
||||||
|
static int OnPlayerRequestSpawn(int player);
|
||||||
|
static void OnPlayerSpawn(int player);
|
||||||
|
static void OnPlayerDeath(int player, int killer, int reason, int body_part);
|
||||||
|
static void OnPlayerUpdate(int player, int type);
|
||||||
|
static int OnPlayerRequestEnter(int player, int vehicle, int slot);
|
||||||
|
static void OnPlayerEnterVehicle(int player, int vehicle, int slot);
|
||||||
|
static void OnPlayerExitVehicle(int player, int vehicle);
|
||||||
|
static void OnPlayerNameChange(int player, const char * previous, const char * current);
|
||||||
|
static void OnPlayerStateChange(int player, int previous, int current);
|
||||||
|
static void OnPlayerActionChange(int player, int previous, int current);
|
||||||
|
static void OnPlayerOnFireChange(int player, unsigned int state);
|
||||||
|
static void OnPlayerCrouchChange(int player, unsigned int state);
|
||||||
|
static void OnPlayerGameKeysChange(int player, int previous, int current);
|
||||||
|
static int OnPickupClaimPicked(int pickup, int player);
|
||||||
|
static void OnPickupPickedUp(int pickup, int player);
|
||||||
|
static void OnPickupRespawn(int pickup);
|
||||||
|
static void OnVehicleUpdate(int vehicle, int type);
|
||||||
|
static void OnVehicleExplode(int vehicle);
|
||||||
|
static void OnVehicleRespawn(int vehicle);
|
||||||
|
static void OnObjectShot(int object, int player, int weapon);
|
||||||
|
static void OnObjectBump(int object, int player);
|
||||||
|
static int OnPublicMessage(int player, const char * message);
|
||||||
|
static int OnCommandMessage(int player, const char * command);
|
||||||
|
static int OnPrivateMessage(int player, int target, const char * message);
|
||||||
|
static int OnInternalCommand(unsigned int type, const char * text);
|
||||||
|
static int OnLoginAttempt(char * name, const char * passwd, const char * ipaddr);
|
||||||
|
static void OnEntityPoolChange(int type, int entity, unsigned int deleted);
|
||||||
|
static void OnKeyBindDown(int player, int keybind);
|
||||||
|
static void OnKeyBindUp(int player, int keybind);
|
||||||
|
static void OnPlayerAwayChange(int player, unsigned int status);
|
||||||
|
static void OnPlayerSpectate(int player, int target);
|
||||||
|
static void OnPlayerCrashReport(int player, const char * report);
|
||||||
|
static void OnServerPerformanceReport(int count, const char ** description, unsigned long long * millispent);
|
||||||
|
static void OnCheckpointEntered(int checkpoint, int player);
|
||||||
|
static void OnCheckpointExited(int checkpoint, int player);
|
||||||
|
static void OnSphereEntered(int sphere, int player);
|
||||||
|
static void OnSphereExited(int sphere, int player);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Enable or disable a certain server event.
|
||||||
|
*/
|
||||||
|
static void ToggleEvent(Int32 evt, bool toggle);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
|
#endif // _SQTCC_COMMON_HPP_
|
504
modules/tcc/Module.cpp
Normal file
504
modules/tcc/Module.cpp
Normal file
@ -0,0 +1,504 @@
|
|||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
#include "Module.hpp"
|
||||||
|
#include "Common.hpp"
|
||||||
|
#include "State.hpp"
|
||||||
|
#include "Symbol.hpp"
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
#include <sqrat.h>
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstdarg>
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
PluginFuncs* _Func = nullptr;
|
||||||
|
PluginCallbacks* _Clbk = nullptr;
|
||||||
|
PluginInfo* _Info = nullptr;
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
HSQAPI _SqAPI = nullptr;
|
||||||
|
HSQEXPORTS _SqMod = nullptr;
|
||||||
|
HSQUIRRELVM _SqVM = nullptr;
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Bind speciffic functions to certain server events.
|
||||||
|
*/
|
||||||
|
void BindCallbacks();
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Undo changes made with BindCallbacks().
|
||||||
|
*/
|
||||||
|
void UnbindCallbacks();
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Register the module API under the specified virtual machine.
|
||||||
|
*/
|
||||||
|
void RegisterAPI(HSQUIRRELVM vm);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Initialize the plugin by obtaining the API provided by the host plugin.
|
||||||
|
*/
|
||||||
|
void OnSquirrelInitialize()
|
||||||
|
{
|
||||||
|
// Attempt to import the plugin API exported by the host plugin
|
||||||
|
_SqMod = sq_api_import(_Func);
|
||||||
|
// Did we failed to obtain the plugin exports?
|
||||||
|
if(!_SqMod)
|
||||||
|
{
|
||||||
|
OutputError("Failed to attach [%s] on host plugin.", SQTCC_NAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Obtain the Squirrel API
|
||||||
|
_SqAPI = _SqMod->GetSquirrelAPI();
|
||||||
|
// Expand the Squirrel API into global functions
|
||||||
|
sq_api_expand(_SqAPI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Load the module on the virtual machine provided by the host module.
|
||||||
|
*/
|
||||||
|
void OnSquirrelLoad()
|
||||||
|
{
|
||||||
|
// Make sure that we have a valid plugin API
|
||||||
|
if (!_SqMod)
|
||||||
|
{
|
||||||
|
return; /* Unable to proceed. */
|
||||||
|
}
|
||||||
|
// Obtain the Squirrel API and VM
|
||||||
|
_SqVM = _SqMod->GetSquirrelVM();
|
||||||
|
// Make sure that a valid virtual machine exists
|
||||||
|
if (!_SqVM)
|
||||||
|
{
|
||||||
|
return; /* Unable to proceed. */
|
||||||
|
}
|
||||||
|
// Set this as the default database
|
||||||
|
DefaultVM::Set(_SqVM);
|
||||||
|
// Register the module API
|
||||||
|
RegisterAPI(_SqVM);
|
||||||
|
// Notify about the current status
|
||||||
|
OutputMessage("Registered: %s", SQTCC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The virtual machine is about to be terminated and script resources should be released.
|
||||||
|
*/
|
||||||
|
void OnSquirrelTerminate()
|
||||||
|
{
|
||||||
|
OutputMessage("Terminating: %s", SQTCC_NAME);
|
||||||
|
// Release the current database (if any)
|
||||||
|
DefaultVM::Set(nullptr);
|
||||||
|
// Release script resources...
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Validate the module API to make sure we don't run into issues.
|
||||||
|
*/
|
||||||
|
bool CheckAPIVer(CCStr ver)
|
||||||
|
{
|
||||||
|
// Obtain the numeric representation of the API version
|
||||||
|
long vernum = strtol(ver, nullptr, 10);
|
||||||
|
// Check against version mismatch
|
||||||
|
if (vernum == SQMOD_API_VER)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Log the incident
|
||||||
|
OutputError("API version mismatch on %s", SQTCC_NAME);
|
||||||
|
OutputMessage("=> Requested: %ld Have: %ld", vernum, SQMOD_API_VER);
|
||||||
|
// Invoker should not attempt to communicate through the module API
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* React to command sent by other plugins.
|
||||||
|
*/
|
||||||
|
static int OnInternalCommand(unsigned int type, const char * text)
|
||||||
|
{
|
||||||
|
// Forward the call to compiler states
|
||||||
|
int res = StateHnd::OnInternalCommand(type, text);
|
||||||
|
// Now we can process it
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case SQMOD_INITIALIZE_CMD:
|
||||||
|
if (CheckAPIVer(text))
|
||||||
|
{
|
||||||
|
OnSquirrelInitialize();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SQMOD_LOAD_CMD:
|
||||||
|
OnSquirrelLoad();
|
||||||
|
break;
|
||||||
|
case SQMOD_TERMINATE_CMD:
|
||||||
|
OnSquirrelTerminate();
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
// Return the result
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The server was initialized and this plugin was loaded successfully.
|
||||||
|
*/
|
||||||
|
static int OnInitServer()
|
||||||
|
{
|
||||||
|
return StateHnd::OnInitServer();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void OnShutdownServer(void)
|
||||||
|
{
|
||||||
|
// Forward the call to compiler states
|
||||||
|
StateHnd::OnShutdownServer();
|
||||||
|
// The server may still send callbacks
|
||||||
|
UnbindCallbacks();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void BindCallbacks()
|
||||||
|
{
|
||||||
|
_Clbk->OnInitServer = OnInitServer;
|
||||||
|
_Clbk->OnInternalCommand = OnInternalCommand;
|
||||||
|
_Clbk->OnShutdownServer = OnShutdownServer;
|
||||||
|
_Clbk->OnFrame = &StateHnd::OnFrame;
|
||||||
|
_Clbk->OnPlayerConnect = &StateHnd::OnPlayerConnect;
|
||||||
|
_Clbk->OnPlayerDisconnect = &StateHnd::OnPlayerDisconnect;
|
||||||
|
_Clbk->OnPlayerBeginTyping = &StateHnd::OnPlayerBeginTyping;
|
||||||
|
_Clbk->OnPlayerEndTyping = &StateHnd::OnPlayerEndTyping;
|
||||||
|
_Clbk->OnPlayerRequestClass = &StateHnd::OnPlayerRequestClass;
|
||||||
|
_Clbk->OnPlayerRequestSpawn = &StateHnd::OnPlayerRequestSpawn;
|
||||||
|
_Clbk->OnPlayerSpawn = &StateHnd::OnPlayerSpawn;
|
||||||
|
_Clbk->OnPlayerDeath = &StateHnd::OnPlayerDeath;
|
||||||
|
_Clbk->OnPlayerUpdate = &StateHnd::OnPlayerUpdate;
|
||||||
|
_Clbk->OnPlayerRequestEnter = &StateHnd::OnPlayerRequestEnter;
|
||||||
|
_Clbk->OnPlayerEnterVehicle = &StateHnd::OnPlayerEnterVehicle;
|
||||||
|
_Clbk->OnPlayerExitVehicle = &StateHnd::OnPlayerExitVehicle;
|
||||||
|
_Clbk->OnPlayerNameChange = &StateHnd::OnPlayerNameChange;
|
||||||
|
_Clbk->OnPlayerStateChange = &StateHnd::OnPlayerStateChange;
|
||||||
|
_Clbk->OnPlayerActionChange = &StateHnd::OnPlayerActionChange;
|
||||||
|
_Clbk->OnPlayerOnFireChange = &StateHnd::OnPlayerOnFireChange;
|
||||||
|
_Clbk->OnPlayerCrouchChange = &StateHnd::OnPlayerCrouchChange;
|
||||||
|
_Clbk->OnPlayerGameKeysChange = &StateHnd::OnPlayerGameKeysChange;
|
||||||
|
_Clbk->OnPickupClaimPicked = &StateHnd::OnPickupClaimPicked;
|
||||||
|
_Clbk->OnPickupPickedUp = &StateHnd::OnPickupPickedUp;
|
||||||
|
_Clbk->OnPickupRespawn = &StateHnd::OnPickupRespawn;
|
||||||
|
_Clbk->OnVehicleUpdate = &StateHnd::OnVehicleUpdate;
|
||||||
|
_Clbk->OnVehicleExplode = &StateHnd::OnVehicleExplode;
|
||||||
|
_Clbk->OnVehicleRespawn = &StateHnd::OnVehicleRespawn;
|
||||||
|
_Clbk->OnObjectShot = &StateHnd::OnObjectShot;
|
||||||
|
_Clbk->OnObjectBump = &StateHnd::OnObjectBump;
|
||||||
|
_Clbk->OnPublicMessage = &StateHnd::OnPublicMessage;
|
||||||
|
_Clbk->OnCommandMessage = &StateHnd::OnCommandMessage;
|
||||||
|
_Clbk->OnPrivateMessage = &StateHnd::OnPrivateMessage;
|
||||||
|
_Clbk->OnLoginAttempt = &StateHnd::OnLoginAttempt;
|
||||||
|
_Clbk->OnEntityPoolChange = &StateHnd::OnEntityPoolChange;
|
||||||
|
_Clbk->OnKeyBindDown = &StateHnd::OnKeyBindDown;
|
||||||
|
_Clbk->OnKeyBindUp = &StateHnd::OnKeyBindUp;
|
||||||
|
_Clbk->OnPlayerAwayChange = &StateHnd::OnPlayerAwayChange;
|
||||||
|
_Clbk->OnPlayerSpectate = &StateHnd::OnPlayerSpectate;
|
||||||
|
_Clbk->OnPlayerCrashReport = &StateHnd::OnPlayerCrashReport;
|
||||||
|
_Clbk->OnServerPerformanceReport = &StateHnd::OnServerPerformanceReport;
|
||||||
|
_Clbk->OnCheckpointEntered = &StateHnd::OnCheckpointEntered;
|
||||||
|
_Clbk->OnCheckpointExited = &StateHnd::OnCheckpointExited;
|
||||||
|
_Clbk->OnSphereEntered = &StateHnd::OnSphereEntered;
|
||||||
|
_Clbk->OnSphereExited = &StateHnd::OnSphereExited;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void UnbindCallbacks()
|
||||||
|
{
|
||||||
|
_Clbk->OnInitServer = nullptr;
|
||||||
|
_Clbk->OnInternalCommand = nullptr;
|
||||||
|
_Clbk->OnShutdownServer = nullptr;
|
||||||
|
_Clbk->OnFrame = nullptr;
|
||||||
|
_Clbk->OnPlayerConnect = nullptr;
|
||||||
|
_Clbk->OnPlayerDisconnect = nullptr;
|
||||||
|
_Clbk->OnPlayerBeginTyping = nullptr;
|
||||||
|
_Clbk->OnPlayerEndTyping = nullptr;
|
||||||
|
_Clbk->OnPlayerRequestClass = nullptr;
|
||||||
|
_Clbk->OnPlayerRequestSpawn = nullptr;
|
||||||
|
_Clbk->OnPlayerSpawn = nullptr;
|
||||||
|
_Clbk->OnPlayerDeath = nullptr;
|
||||||
|
_Clbk->OnPlayerUpdate = nullptr;
|
||||||
|
_Clbk->OnPlayerRequestEnter = nullptr;
|
||||||
|
_Clbk->OnPlayerEnterVehicle = nullptr;
|
||||||
|
_Clbk->OnPlayerExitVehicle = nullptr;
|
||||||
|
_Clbk->OnPlayerNameChange = nullptr;
|
||||||
|
_Clbk->OnPlayerStateChange = nullptr;
|
||||||
|
_Clbk->OnPlayerActionChange = nullptr;
|
||||||
|
_Clbk->OnPlayerOnFireChange = nullptr;
|
||||||
|
_Clbk->OnPlayerCrouchChange = nullptr;
|
||||||
|
_Clbk->OnPlayerGameKeysChange = nullptr;
|
||||||
|
_Clbk->OnPickupClaimPicked = nullptr;
|
||||||
|
_Clbk->OnPickupPickedUp = nullptr;
|
||||||
|
_Clbk->OnPickupRespawn = nullptr;
|
||||||
|
_Clbk->OnVehicleUpdate = nullptr;
|
||||||
|
_Clbk->OnVehicleExplode = nullptr;
|
||||||
|
_Clbk->OnVehicleRespawn = nullptr;
|
||||||
|
_Clbk->OnObjectShot = nullptr;
|
||||||
|
_Clbk->OnObjectBump = nullptr;
|
||||||
|
_Clbk->OnPublicMessage = nullptr;
|
||||||
|
_Clbk->OnCommandMessage = nullptr;
|
||||||
|
_Clbk->OnPrivateMessage = nullptr;
|
||||||
|
_Clbk->OnLoginAttempt = nullptr;
|
||||||
|
_Clbk->OnEntityPoolChange = nullptr;
|
||||||
|
_Clbk->OnKeyBindDown = nullptr;
|
||||||
|
_Clbk->OnKeyBindUp = nullptr;
|
||||||
|
_Clbk->OnPlayerAwayChange = nullptr;
|
||||||
|
_Clbk->OnPlayerSpectate = nullptr;
|
||||||
|
_Clbk->OnPlayerCrashReport = nullptr;
|
||||||
|
_Clbk->OnServerPerformanceReport = nullptr;
|
||||||
|
_Clbk->OnCheckpointEntered = nullptr;
|
||||||
|
_Clbk->OnCheckpointExited = nullptr;
|
||||||
|
_Clbk->OnSphereEntered = nullptr;
|
||||||
|
_Clbk->OnSphereExited = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void RegisterAPI(HSQUIRRELVM vm)
|
||||||
|
{
|
||||||
|
Table tccns(vm);
|
||||||
|
|
||||||
|
tccns.Bind(_SC("State"), Class< State >(vm, _SC("SqTccState"))
|
||||||
|
// Constructors
|
||||||
|
.Ctor< CSStr >()
|
||||||
|
// Metamethods
|
||||||
|
.Func(_SC("_cmp"), &State::Cmp)
|
||||||
|
.SquirrelFunc(_SC("_typename"), &State::Typename)
|
||||||
|
.Func(_SC("_tostring"), &State::ToString)
|
||||||
|
// Properties
|
||||||
|
.Prop(_SC("Valid"), &State::IsValid)
|
||||||
|
.Prop(_SC("Refs"), &State::GetRefCount)
|
||||||
|
.Prop(_SC("Name"), &State::GetName, &State::SetName)
|
||||||
|
.Prop(_SC("Events"), &State::GetEvents, &State::SetEvents)
|
||||||
|
// Member Methods
|
||||||
|
.Func(_SC("Release"), &State::Release)
|
||||||
|
.Func(_SC("MakeHead"), &State::MakeHead)
|
||||||
|
.Func(_SC("SetOptions"), &State::SetOptions)
|
||||||
|
.Func(_SC("UndefineSymbol"), &State::UndefineSymbol)
|
||||||
|
.Func(_SC("AddIncludePath"), &State::AddIncludePath)
|
||||||
|
.Func(_SC("AddSysIncludePath"), &State::AddSysIncludePath)
|
||||||
|
.Func(_SC("SetLibPath"), &State::SetLibPath)
|
||||||
|
.Func(_SC("AddLibraryPath"), &State::AddLibraryPath)
|
||||||
|
.Func(_SC("AddLibrary"), &State::AddLibrary)
|
||||||
|
.Func(_SC("CompileString"), &State::CompileString)
|
||||||
|
.Func(_SC("AddSource"), &State::AddSource)
|
||||||
|
.Func(_SC("AddBinary"), &State::AddBinary)
|
||||||
|
.Func(_SC("AddAsm"), &State::AddAsm)
|
||||||
|
.Func(_SC("AddAsmPP"), &State::AddAsmPP)
|
||||||
|
.Func(_SC("Relocate"), &State::Relocate)
|
||||||
|
.Func(_SC("GetSymbol"), &State::GetSymbol)
|
||||||
|
// Member Overloads
|
||||||
|
.Overload< void (State::*)(CSStr) const >(_SC("DefineSymbol"), &State::DefineSymbol)
|
||||||
|
.Overload< void (State::*)(CSStr, CSStr) const >(_SC("DefineSymbol"), &State::DefineSymbol)
|
||||||
|
);
|
||||||
|
|
||||||
|
tccns.Bind(_SC("Symbol"), Class< Symbol >(vm, _SC("SqTccSymbol"))
|
||||||
|
// Constructors
|
||||||
|
.Ctor< const State &, CSStr >()
|
||||||
|
// Metamethods
|
||||||
|
.Func(_SC("_cmp"), &Symbol::Cmp)
|
||||||
|
.SquirrelFunc(_SC("_typename"), &Symbol::Typename)
|
||||||
|
.Func(_SC("_tostring"), &Symbol::ToString)
|
||||||
|
// Properties
|
||||||
|
.Prop(_SC("Valid"), &Symbol::IsValid)
|
||||||
|
.Prop(_SC("Refs"), &Symbol::GetRefCount)
|
||||||
|
.Prop(_SC("State"), &Symbol::GetStateRef)
|
||||||
|
// Member Methods
|
||||||
|
.Func(_SC("Release"), &Symbol::Release)
|
||||||
|
// Squirrel Methods
|
||||||
|
.SquirrelFunc(_SC("Forward"), &Symbol::Forward)
|
||||||
|
);
|
||||||
|
|
||||||
|
tccns.Func(_SC("ToggleEvent"), &StateHnd::ToggleEvent);
|
||||||
|
|
||||||
|
RootTable(vm).Bind(_SC("SqTCC"), tccns);
|
||||||
|
|
||||||
|
ConstTable(vm).Enum(_SC("ETccEvent"), Enumeration(vm)
|
||||||
|
.Const(_SC("Frame"), EvOnFrame)
|
||||||
|
.Const(_SC("PlayerConnect"), EvOnPlayerConnect)
|
||||||
|
.Const(_SC("PlayerDisconnect"), EvOnPlayerDisconnect)
|
||||||
|
.Const(_SC("PlayerBeginTyping"), EvOnPlayerBeginTyping)
|
||||||
|
.Const(_SC("PlayerEndTyping"), EvOnPlayerEndTyping)
|
||||||
|
.Const(_SC("PlayerRequestClass"), EvOnPlayerRequestClass)
|
||||||
|
.Const(_SC("PlayerRequestSpawn"), EvOnPlayerRequestSpawn)
|
||||||
|
.Const(_SC("PlayerSpawn"), EvOnPlayerSpawn)
|
||||||
|
.Const(_SC("PlayerDeath"), EvOnPlayerDeath)
|
||||||
|
.Const(_SC("PlayerUpdate"), EvOnPlayerUpdate)
|
||||||
|
.Const(_SC("PlayerRequestEnter"), EvOnPlayerRequestEnter)
|
||||||
|
.Const(_SC("PlayerEnterVehicle"), EvOnPlayerEnterVehicle)
|
||||||
|
.Const(_SC("PlayerExitVehicle"), EvOnPlayerExitVehicle)
|
||||||
|
.Const(_SC("PlayerNameChange"), EvOnPlayerNameChange)
|
||||||
|
.Const(_SC("PlayerStateChange"), EvOnPlayerStateChange)
|
||||||
|
.Const(_SC("PlayerActionChange"), EvOnPlayerActionChange)
|
||||||
|
.Const(_SC("PlayerOnFireChange"), EvOnPlayerOnFireChange)
|
||||||
|
.Const(_SC("PlayerCrouchChange"), EvOnPlayerCrouchChange)
|
||||||
|
.Const(_SC("PlayerGameKeysChange"), EvOnPlayerGameKeysChange)
|
||||||
|
.Const(_SC("PickupClaimPicked"), EvOnPickupClaimPicked)
|
||||||
|
.Const(_SC("PickupPickedUp"), EvOnPickupPickedUp)
|
||||||
|
.Const(_SC("PickupRespawn"), EvOnPickupRespawn)
|
||||||
|
.Const(_SC("VehicleUpdate"), EvOnVehicleUpdate)
|
||||||
|
.Const(_SC("VehicleExplode"), EvOnVehicleExplode)
|
||||||
|
.Const(_SC("VehicleRespawn"), EvOnVehicleRespawn)
|
||||||
|
.Const(_SC("ObjectShot"), EvOnObjectShot)
|
||||||
|
.Const(_SC("ObjectBump"), EvOnObjectBump)
|
||||||
|
.Const(_SC("PublicMessage"), EvOnPublicMessage)
|
||||||
|
.Const(_SC("CommandMessage"), EvOnCommandMessage)
|
||||||
|
.Const(_SC("PrivateMessage"), EvOnPrivateMessage)
|
||||||
|
.Const(_SC("LoginAttempt"), EvOnLoginAttempt)
|
||||||
|
.Const(_SC("EntityPoolChange"), EvOnEntityPoolChange)
|
||||||
|
.Const(_SC("KeyBindDown"), EvOnKeyBindDown)
|
||||||
|
.Const(_SC("KeyBindUp"), EvOnKeyBindUp)
|
||||||
|
.Const(_SC("PlayerAwayChange"), EvOnPlayerAwayChange)
|
||||||
|
.Const(_SC("PlayerSpectate"), EvOnPlayerSpectate)
|
||||||
|
.Const(_SC("PlayerCrashReport"), EvOnPlayerCrashReport)
|
||||||
|
.Const(_SC("ServerPerformanceReport"), EvOnServerPerformanceReport)
|
||||||
|
.Const(_SC("CheckpointEntered"), EvOnCheckpointEntered)
|
||||||
|
.Const(_SC("CheckpointExited"), EvOnCheckpointExited)
|
||||||
|
.Const(_SC("SphereEntered"), EvOnSphereEntered)
|
||||||
|
.Const(_SC("SphereExited"), EvOnSphereExited)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void OutputMessageImpl(const char * msg, va_list args)
|
||||||
|
{
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO csb_before;
|
||||||
|
GetConsoleScreenBufferInfo( hstdout, &csb_before);
|
||||||
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN);
|
||||||
|
printf("[SQMOD] ");
|
||||||
|
|
||||||
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||||
|
vprintf(msg, args);
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
SetConsoleTextAttribute(hstdout, csb_before.wAttributes);
|
||||||
|
#else
|
||||||
|
printf("%c[0;32m[SQMOD]%c[0;37m", 27, 27, msg);
|
||||||
|
vprintf(msg, args);
|
||||||
|
puts("");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void OutputErrorImpl(const char * msg, va_list args)
|
||||||
|
{
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO csb_before;
|
||||||
|
GetConsoleScreenBufferInfo( hstdout, &csb_before);
|
||||||
|
SetConsoleTextAttribute(hstdout, FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||||
|
printf("[SQMOD] ");
|
||||||
|
|
||||||
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||||
|
vprintf(msg, args);
|
||||||
|
puts("");
|
||||||
|
|
||||||
|
SetConsoleTextAttribute(hstdout, csb_before.wAttributes);
|
||||||
|
#else
|
||||||
|
printf("%c[0;32m[SQMOD]%c[0;37m", 27, 27, msg);
|
||||||
|
vprintf(msg, args);
|
||||||
|
puts("");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void OutputDebug(const char * msg, ...)
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
// Initialize the arguments list
|
||||||
|
va_list args;
|
||||||
|
va_start(args, msg);
|
||||||
|
// Call the output function
|
||||||
|
OutputMessageImpl(msg, args);
|
||||||
|
// Finalize the arguments list
|
||||||
|
va_end(args);
|
||||||
|
#else
|
||||||
|
SQMOD_UNUSED_VAR(msg);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void OutputMessage(const char * msg, ...)
|
||||||
|
{
|
||||||
|
// Initialize the arguments list
|
||||||
|
va_list args;
|
||||||
|
va_start(args, msg);
|
||||||
|
// Call the output function
|
||||||
|
OutputMessageImpl(msg, args);
|
||||||
|
// Finalize the arguments list
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
void OutputError(const char * msg, ...)
|
||||||
|
{
|
||||||
|
// Initialize the arguments list
|
||||||
|
va_list args;
|
||||||
|
va_start(args, msg);
|
||||||
|
// Call the output function
|
||||||
|
OutputErrorImpl(msg, args);
|
||||||
|
// Finalize the arguments list
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs* functions, PluginCallbacks* callbacks, PluginInfo* info)
|
||||||
|
{
|
||||||
|
using namespace SqMod;
|
||||||
|
// Output plugin header
|
||||||
|
puts("");
|
||||||
|
OutputMessage("--------------------------------------------------------------------");
|
||||||
|
OutputMessage("Plugin: %s", SQTCC_NAME);
|
||||||
|
OutputMessage("Author: %s", SQTCC_AUTHOR);
|
||||||
|
OutputMessage("Legal: %s", SQTCC_COPYRIGHT);
|
||||||
|
OutputMessage("--------------------------------------------------------------------");
|
||||||
|
puts("");
|
||||||
|
// Attempt to find the host plugin ID
|
||||||
|
int host_plugin_id = functions->FindPlugin((char *)(SQMOD_HOST_NAME));
|
||||||
|
// See if our plugin was loaded after the host plugin
|
||||||
|
if (host_plugin_id < 0)
|
||||||
|
{
|
||||||
|
OutputError("%s could find the host plugin", SQTCC_NAME);
|
||||||
|
// Don't load!
|
||||||
|
return SQMOD_FAILURE;
|
||||||
|
}
|
||||||
|
// Should never reach this point but just in case
|
||||||
|
else if (host_plugin_id > (info->nPluginId))
|
||||||
|
{
|
||||||
|
OutputError("%s loaded after the host plugin", SQTCC_NAME);
|
||||||
|
// Don't load!
|
||||||
|
return SQMOD_FAILURE;
|
||||||
|
}
|
||||||
|
// Store server proxies
|
||||||
|
_Func = functions;
|
||||||
|
_Clbk = callbacks;
|
||||||
|
_Info = info;
|
||||||
|
// Assign plugin information
|
||||||
|
_Info->uPluginVer = SQTCC_VERSION;
|
||||||
|
strcpy(_Info->szName, SQTCC_HOST_NAME);
|
||||||
|
// Bind callbacks
|
||||||
|
BindCallbacks();
|
||||||
|
// Notify that the plugin was successfully loaded
|
||||||
|
OutputMessage("Successfully loaded %s", SQTCC_NAME);
|
||||||
|
// Dummy spacing
|
||||||
|
puts("");
|
||||||
|
// Done!
|
||||||
|
return SQMOD_SUCCESS;
|
||||||
|
}
|
41
modules/tcc/Module.hpp
Normal file
41
modules/tcc/Module.hpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#ifndef _SQTCC_MODULE_HPP_
|
||||||
|
#define _SQTCC_MODULE_HPP_
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "SqMod.h"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Proxies to comunicate with the server.
|
||||||
|
*/
|
||||||
|
extern PluginFuncs* _Func;
|
||||||
|
extern PluginCallbacks* _Clbk;
|
||||||
|
extern PluginInfo* _Info;
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Proxies to comunicate with the Squirrel plugin.
|
||||||
|
*/
|
||||||
|
extern HSQAPI _SqAPI;
|
||||||
|
extern HSQEXPORTS _SqMod;
|
||||||
|
extern HSQUIRRELVM _SqVM;
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Output a message only if the _DEBUG was defined.
|
||||||
|
*/
|
||||||
|
void OutputDebug(const char * msg, ...);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Output a formatted user message to the console.
|
||||||
|
*/
|
||||||
|
void OutputMessage(const char * msg, ...);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Output a formatted error message to the console.
|
||||||
|
*/
|
||||||
|
void OutputError(const char * msg, ...);
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
|
#endif // _SQTCC_MODULE_HPP_
|
55
modules/tcc/State.cpp
Normal file
55
modules/tcc/State.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "State.hpp"
|
||||||
|
#include "Symbol.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <libtcc.h>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
SQInteger State::Typename(HSQUIRRELVM vm)
|
||||||
|
{
|
||||||
|
static SQChar name[] = _SC("SqTccState");
|
||||||
|
sq_pushstring(vm, name, sizeof(name));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void State::AddSource(CSStr filename) const
|
||||||
|
{
|
||||||
|
m_Handle.AddFile(filename, TCC_FILETYPE_C);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void State::AddBinary(CSStr filename) const
|
||||||
|
{
|
||||||
|
m_Handle.AddFile(filename, TCC_FILETYPE_BINARY);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void State::AddAsm(CSStr filename) const
|
||||||
|
{
|
||||||
|
m_Handle.AddFile(filename, TCC_FILETYPE_ASM);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void State::AddAsmPP(CSStr filename) const
|
||||||
|
{
|
||||||
|
m_Handle.AddFile(filename, TCC_FILETYPE_ASM_PP);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Symbol State::GetSymbol(CSStr name) const
|
||||||
|
{
|
||||||
|
// Is the specified name even valid?
|
||||||
|
if (!name || *name == '\0')
|
||||||
|
{
|
||||||
|
STHROWF("Invalid or empty symbol name: null");
|
||||||
|
}
|
||||||
|
// Return the requested symbol
|
||||||
|
return Symbol(m_Handle, name, m_Handle.GetSymbol< Symbol::SymPtr >(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
358
modules/tcc/State.hpp
Normal file
358
modules/tcc/State.hpp
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
#ifndef _SQTCC_STATE_HPP_
|
||||||
|
#define _SQTCC_STATE_HPP_
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "Common.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Class used to manage a TCC compiler state.
|
||||||
|
*/
|
||||||
|
class State
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
StateHnd m_Handle; // The handle to the managed compiler state resource.
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Base constructor.
|
||||||
|
*/
|
||||||
|
State(CSStr name)
|
||||||
|
: m_Handle(name)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Direct handle constructor.
|
||||||
|
*/
|
||||||
|
State(const StateHnd & h)
|
||||||
|
: m_Handle(h)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor.
|
||||||
|
*/
|
||||||
|
State(const State & o)
|
||||||
|
: m_Handle(o.m_Handle)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move constructor.
|
||||||
|
*/
|
||||||
|
State(State && o)
|
||||||
|
: m_Handle(o.m_Handle)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~State()
|
||||||
|
{
|
||||||
|
/* Let the reference manager destroy the state when necessary. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy assignment operator.
|
||||||
|
*/
|
||||||
|
State & operator = (const State & o)
|
||||||
|
{
|
||||||
|
m_Handle = o.m_Handle;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move assignment operator.
|
||||||
|
*/
|
||||||
|
State & operator = (State && o)
|
||||||
|
{
|
||||||
|
m_Handle = o.m_Handle;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an equality comparison between two states.
|
||||||
|
*/
|
||||||
|
bool operator == (const State & o) const
|
||||||
|
{
|
||||||
|
return (m_Handle == o.m_Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an inequality comparison between two states.
|
||||||
|
*/
|
||||||
|
bool operator != (const State & o) const
|
||||||
|
{
|
||||||
|
return (m_Handle != o.m_Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the raw state handle.
|
||||||
|
*/
|
||||||
|
operator TCCState * ()
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the raw state handle.
|
||||||
|
*/
|
||||||
|
operator TCCState * () const
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to compare two instances of this type.
|
||||||
|
*/
|
||||||
|
Int32 Cmp(const State & o) const
|
||||||
|
{
|
||||||
|
if (m_Handle == m_Handle)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (m_Handle.m_Hnd > o.m_Handle.m_Hnd)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to convert an instance of this type to a string.
|
||||||
|
*/
|
||||||
|
CSStr ToString() const
|
||||||
|
{
|
||||||
|
return m_Handle ? m_Handle->mName.c_str() : _SC("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to retrieve the name from instances of this type.
|
||||||
|
*/
|
||||||
|
static SQInteger Typename(HSQUIRRELVM vm);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* See whether this state is valid.
|
||||||
|
*/
|
||||||
|
bool IsValid() const
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated state handle.
|
||||||
|
*/
|
||||||
|
const StateHnd & GetHandle() const
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Return the number of active references to this state handle.
|
||||||
|
*/
|
||||||
|
Uint32 GetRefCount() const
|
||||||
|
{
|
||||||
|
return m_Handle.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Release the reference to the associated database state.
|
||||||
|
*/
|
||||||
|
void Release()
|
||||||
|
{
|
||||||
|
m_Handle.Drop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated state name.
|
||||||
|
*/
|
||||||
|
const String & GetName() const
|
||||||
|
{
|
||||||
|
// Validate the managed state
|
||||||
|
m_Handle.Validate();
|
||||||
|
// Return the requested information
|
||||||
|
return m_Handle->mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the associated state name.
|
||||||
|
*/
|
||||||
|
void SetName(CSStr name)
|
||||||
|
{
|
||||||
|
// Validate the managed state
|
||||||
|
m_Handle.Validate();
|
||||||
|
// Apply the specified value
|
||||||
|
m_Handle->mName.assign(name ? name : _SC(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated state receives events.
|
||||||
|
*/
|
||||||
|
bool GetEvents() const
|
||||||
|
{
|
||||||
|
// Validate the managed state
|
||||||
|
m_Handle.Validate();
|
||||||
|
// Return the requested information
|
||||||
|
return StateHnd::IsListed(m_Handle.m_Hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the associated state receives events.
|
||||||
|
*/
|
||||||
|
void SetEvents(bool toggle)
|
||||||
|
{
|
||||||
|
// Validate the managed state
|
||||||
|
m_Handle.Validate();
|
||||||
|
// Perform the requested operation
|
||||||
|
if (toggle)
|
||||||
|
{
|
||||||
|
StateHnd::Remember(m_Handle.m_Hnd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StateHnd::Forget(m_Handle.m_Hnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move the associated state to the head of the list.
|
||||||
|
*/
|
||||||
|
void MakeHead() const
|
||||||
|
{
|
||||||
|
// Validate the managed state
|
||||||
|
m_Handle.Validate();
|
||||||
|
// Perform the requested operation
|
||||||
|
StateHnd::ToHead(m_Handle.m_Hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set options as from command line (multiple supported).
|
||||||
|
*/
|
||||||
|
void SetOptions(CSStr opt) const
|
||||||
|
{
|
||||||
|
m_Handle.SetOptions(opt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Define preprocessor symbol 'sym' without value.
|
||||||
|
*/
|
||||||
|
void DefineSymbol(CSStr sym) const
|
||||||
|
{
|
||||||
|
m_Handle.DefineSymbol(sym, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Define preprocessor symbol 'sym' with value.
|
||||||
|
*/
|
||||||
|
void DefineSymbol(CSStr sym, CSStr value) const
|
||||||
|
{
|
||||||
|
m_Handle.DefineSymbol(sym, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Undefine preprocess symbol 'sym'.
|
||||||
|
*/
|
||||||
|
void UndefineSymbol(CSStr sym) const
|
||||||
|
{
|
||||||
|
m_Handle.UndefineSymbol(sym);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add include path.
|
||||||
|
*/
|
||||||
|
void AddIncludePath(CSStr path) const
|
||||||
|
{
|
||||||
|
m_Handle.AddIncludePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add in system include path.
|
||||||
|
*/
|
||||||
|
void AddSysIncludePath(CSStr path) const
|
||||||
|
{
|
||||||
|
m_Handle.AddSysIncludePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set CONFIG_TCCDIR at runtime.
|
||||||
|
*/
|
||||||
|
void SetLibPath(CSStr path) const
|
||||||
|
{
|
||||||
|
m_Handle.SetLibPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Equivalent to -Lpath option.
|
||||||
|
*/
|
||||||
|
void AddLibraryPath(CSStr path) const
|
||||||
|
{
|
||||||
|
m_Handle.AddLibraryPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* The library name is the same as the argument of the '-l' option.
|
||||||
|
*/
|
||||||
|
void AddLibrary(CSStr name) const
|
||||||
|
{
|
||||||
|
m_Handle.AddLibrary(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Compile a string containing a C source.
|
||||||
|
*/
|
||||||
|
void CompileString(CSStr str) const
|
||||||
|
{
|
||||||
|
m_Handle.CompileString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a file containing C source.
|
||||||
|
*/
|
||||||
|
void AddSource(CSStr filename) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a binary file DLL, Object, Library etc.
|
||||||
|
*/
|
||||||
|
void AddBinary(CSStr filename) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a file containing assembly code.
|
||||||
|
*/
|
||||||
|
void AddAsm(CSStr filename) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Add a file containing assembly code.
|
||||||
|
*/
|
||||||
|
void AddAsmPP(CSStr filename) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Do all relocations (needed before using tcc_get_symbol())
|
||||||
|
*/
|
||||||
|
void Relocate() const
|
||||||
|
{
|
||||||
|
m_Handle.Relocate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Return symbol from the compiled code.
|
||||||
|
*/
|
||||||
|
Symbol GetSymbol(CSStr name) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
|
#endif // _SQTCC_STATE_HPP_
|
68
modules/tcc/Symbol.cpp
Normal file
68
modules/tcc/Symbol.cpp
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "Symbol.hpp"
|
||||||
|
#include "State.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include <libtcc.h>
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
SQInteger Symbol::Typename(HSQUIRRELVM vm)
|
||||||
|
{
|
||||||
|
static SQChar name[] = _SC("SqTccSymbol");
|
||||||
|
sq_pushstring(vm, name, sizeof(name));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Symbol::Symbol(const State & state, CSStr name)
|
||||||
|
: Symbol(state.GetSymbol(name))
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Symbol::Symbol(const StateHnd & state, CSStr name, SymPtr sym)
|
||||||
|
: m_Handle(sym), m_State(state), m_Name(name ? name : _SC(""))
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
State Symbol::GetStateRef() const
|
||||||
|
{
|
||||||
|
return State(m_State);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
SQInteger Symbol::Forward(HSQUIRRELVM vm)
|
||||||
|
{
|
||||||
|
// The symbol instance
|
||||||
|
Symbol * symbol = nullptr;
|
||||||
|
// Attempt to retrieve the symbol instance
|
||||||
|
try
|
||||||
|
{
|
||||||
|
symbol = Var< Symbol * >(vm, 1).value;
|
||||||
|
}
|
||||||
|
catch (const Sqrat::Exception & e)
|
||||||
|
{
|
||||||
|
// Propagate the error
|
||||||
|
return sq_throwerror(vm, e.Message().c_str());
|
||||||
|
}
|
||||||
|
// Do we have a valid symbol instance?
|
||||||
|
if (!symbol)
|
||||||
|
{
|
||||||
|
return sq_throwerror(vm, "Invalid symbol instance");
|
||||||
|
}
|
||||||
|
// Do we have a valid symbol identifier?
|
||||||
|
else if (!symbol->IsValid())
|
||||||
|
{
|
||||||
|
return sq_throwerror(vm, "Invalid symbol reference");
|
||||||
|
}
|
||||||
|
// Cast the symbol to a squirrel function, forward the call and return the result
|
||||||
|
return reinterpret_cast< SQFUNCTION >((*symbol).m_Handle)(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
215
modules/tcc/Symbol.hpp
Normal file
215
modules/tcc/Symbol.hpp
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
#ifndef _SQTCC_SYMBOL_HPP_
|
||||||
|
#define _SQTCC_SYMBOL_HPP_
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
#include "Common.hpp"
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
namespace SqMod {
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class Symbol
|
||||||
|
{
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
friend class State;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
typedef void * SymPtr; // The type of value that represents a symbol in the compiler state.
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
SymPtr m_Handle; // Pointer to the actual retrieved symbol.
|
||||||
|
StateHnd m_State; // The state from where this symbol was retrieved.
|
||||||
|
String m_Name; // The name of the retrieved symbol.
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Use the specified symbol and name.
|
||||||
|
*/
|
||||||
|
Symbol(const StateHnd & state, CSStr name, SymPtr sym);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Extract the symbol from the specified state.
|
||||||
|
*/
|
||||||
|
Symbol(const State & state, CSStr name);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy constructor.
|
||||||
|
*/
|
||||||
|
Symbol(const Symbol & o)
|
||||||
|
: m_Handle(o.m_Handle)
|
||||||
|
, m_State(o.m_State)
|
||||||
|
, m_Name(o.m_Name)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move constructor.
|
||||||
|
*/
|
||||||
|
Symbol(Symbol && o)
|
||||||
|
: m_Handle(o.m_Handle)
|
||||||
|
, m_State(o.m_State)
|
||||||
|
, m_Name(o.m_Name)
|
||||||
|
{
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
~Symbol()
|
||||||
|
{
|
||||||
|
/* Let the reference manager destroy the state when necessary. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Copy assignment operator.
|
||||||
|
*/
|
||||||
|
Symbol & operator = (const Symbol & o)
|
||||||
|
{
|
||||||
|
m_Handle = o.m_Handle;
|
||||||
|
m_State = o.m_State;
|
||||||
|
m_Name = o.m_Name;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Move assignment operator.
|
||||||
|
*/
|
||||||
|
Symbol & operator = (Symbol && o)
|
||||||
|
{
|
||||||
|
m_Handle = o.m_Handle;
|
||||||
|
m_State = o.m_State;
|
||||||
|
m_Name = o.m_Name;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an equality comparison between two symbols.
|
||||||
|
*/
|
||||||
|
bool operator == (const Symbol & o) const
|
||||||
|
{
|
||||||
|
return (m_Handle == o.m_Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Perform an inequality comparison between two symbols.
|
||||||
|
*/
|
||||||
|
bool operator != (const Symbol & o) const
|
||||||
|
{
|
||||||
|
return (m_Handle != o.m_Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the raw state handle.
|
||||||
|
*/
|
||||||
|
operator TCCState * ()
|
||||||
|
{
|
||||||
|
return m_State;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Implicit conversion to the raw state handle.
|
||||||
|
*/
|
||||||
|
operator TCCState * () const
|
||||||
|
{
|
||||||
|
return m_State;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to compare two instances of this type.
|
||||||
|
*/
|
||||||
|
Int32 Cmp(const Symbol & o) const
|
||||||
|
{
|
||||||
|
if (m_Handle == m_Handle)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (m_Handle > o.m_Handle)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to convert an instance of this type to a string.
|
||||||
|
*/
|
||||||
|
const String & ToString() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Used by the script engine to retrieve the name from instances of this type.
|
||||||
|
*/
|
||||||
|
static SQInteger Typename(HSQUIRRELVM vm);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* See whether this symbol is valid.
|
||||||
|
*/
|
||||||
|
bool IsValid() const
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated symbol handle.
|
||||||
|
*/
|
||||||
|
SymPtr GetHandle() const
|
||||||
|
{
|
||||||
|
return m_Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated state handle.
|
||||||
|
*/
|
||||||
|
const StateHnd & GetState() const
|
||||||
|
{
|
||||||
|
return m_State;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Return the number of active references to this state handle.
|
||||||
|
*/
|
||||||
|
Uint32 GetRefCount() const
|
||||||
|
{
|
||||||
|
return m_State.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Release the reference to the associated database state.
|
||||||
|
*/
|
||||||
|
void Release()
|
||||||
|
{
|
||||||
|
m_Handle = nullptr;
|
||||||
|
m_Name.clear();
|
||||||
|
m_State.Drop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve the associated state as a reference in script.
|
||||||
|
*/
|
||||||
|
State GetStateRef() const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Forward this call to the actual associated symbol.
|
||||||
|
*/
|
||||||
|
static SQInteger Forward(HSQUIRRELVM vm);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
|
#endif // _SQTCC_SYMBOL_HPP_
|
Loading…
Reference in New Issue
Block a user