From 481cb3cfb042c1fa502eb449db4a2ba3149dbb93 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 27 Dec 2022 08:30:28 -0500 Subject: [PATCH] Remove unnecessary ACSVM files from libs C API and Exec are unused, and ACSVM compiles based on what folders are present. --- libs/ACSVM/include/CAPI/Array.cpp | 126 --- libs/ACSVM/include/CAPI/Array.h | 55 - libs/ACSVM/include/CAPI/BinaryIO.cpp | 100 -- libs/ACSVM/include/CAPI/BinaryIO.h | 96 -- libs/ACSVM/include/CAPI/CMakeLists.txt | 55 - libs/ACSVM/include/CAPI/Code.h | 68 -- libs/ACSVM/include/CAPI/Environment.cpp | 484 --------- libs/ACSVM/include/CAPI/Environment.h | 198 ---- libs/ACSVM/include/CAPI/Floats.cpp | 88 -- libs/ACSVM/include/CAPI/Floats.h | 56 -- libs/ACSVM/include/CAPI/Module.cpp | 68 -- libs/ACSVM/include/CAPI/Module.h | 58 -- libs/ACSVM/include/CAPI/PrintBuf.cpp | 159 --- libs/ACSVM/include/CAPI/PrintBuf.h | 63 -- libs/ACSVM/include/CAPI/Scope.cpp | 363 ------- libs/ACSVM/include/CAPI/Scope.h | 117 --- libs/ACSVM/include/CAPI/Script.h | 52 - libs/ACSVM/include/CAPI/String.cpp | 184 ---- libs/ACSVM/include/CAPI/String.h | 65 -- libs/ACSVM/include/CAPI/Thread.cpp | 373 ------- libs/ACSVM/include/CAPI/Thread.h | 171 ---- libs/ACSVM/include/CAPI/Types.h | 68 -- libs/ACSVM/include/Exec/CMakeLists.txt | 48 - libs/ACSVM/include/Exec/main_exec.cpp | 264 ----- libs/ACSVM/include/Exec/main_execc.c | 231 ----- libs/ACSVM/include/doc/ACSVM.txt | 1212 ----------------------- libs/ACSVM/lib/libacsvm-capi.dll.a | Bin 316702 -> 0 bytes 27 files changed, 4822 deletions(-) delete mode 100644 libs/ACSVM/include/CAPI/Array.cpp delete mode 100644 libs/ACSVM/include/CAPI/Array.h delete mode 100644 libs/ACSVM/include/CAPI/BinaryIO.cpp delete mode 100644 libs/ACSVM/include/CAPI/BinaryIO.h delete mode 100644 libs/ACSVM/include/CAPI/CMakeLists.txt delete mode 100644 libs/ACSVM/include/CAPI/Code.h delete mode 100644 libs/ACSVM/include/CAPI/Environment.cpp delete mode 100644 libs/ACSVM/include/CAPI/Environment.h delete mode 100644 libs/ACSVM/include/CAPI/Floats.cpp delete mode 100644 libs/ACSVM/include/CAPI/Floats.h delete mode 100644 libs/ACSVM/include/CAPI/Module.cpp delete mode 100644 libs/ACSVM/include/CAPI/Module.h delete mode 100644 libs/ACSVM/include/CAPI/PrintBuf.cpp delete mode 100644 libs/ACSVM/include/CAPI/PrintBuf.h delete mode 100644 libs/ACSVM/include/CAPI/Scope.cpp delete mode 100644 libs/ACSVM/include/CAPI/Scope.h delete mode 100644 libs/ACSVM/include/CAPI/Script.h delete mode 100644 libs/ACSVM/include/CAPI/String.cpp delete mode 100644 libs/ACSVM/include/CAPI/String.h delete mode 100644 libs/ACSVM/include/CAPI/Thread.cpp delete mode 100644 libs/ACSVM/include/CAPI/Thread.h delete mode 100644 libs/ACSVM/include/CAPI/Types.h delete mode 100644 libs/ACSVM/include/Exec/CMakeLists.txt delete mode 100644 libs/ACSVM/include/Exec/main_exec.cpp delete mode 100644 libs/ACSVM/include/Exec/main_execc.c delete mode 100644 libs/ACSVM/include/doc/ACSVM.txt delete mode 100644 libs/ACSVM/lib/libacsvm-capi.dll.a diff --git a/libs/ACSVM/include/CAPI/Array.cpp b/libs/ACSVM/include/CAPI/Array.cpp deleted file mode 100644 index dbf45cd97..000000000 --- a/libs/ACSVM/include/CAPI/Array.cpp +++ /dev/null @@ -1,126 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Arrays. -// -//----------------------------------------------------------------------------- - -#include "Array.h" - -#include "Environment.h" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_AllocArray -// -ACSVM_Array *ACSVM_AllocArray(void) -{ - return reinterpret_cast(new(std::nothrow) ACSVM::Array); -} - -// -// ACSVM_FreeArray -// -void ACSVM_FreeArray(ACSVM_Array *arr) -{ - delete reinterpret_cast(arr); -} - -// -// ACSVM_Array_Clear -// -void ACSVM_Array_Clear(ACSVM_Array *arr) -{ - reinterpret_cast(arr)->clear(); -} - -// -// ACSVM_Array_Find -// -ACSVM_Word ACSVM_Array_Find(ACSVM_Array const *arr, ACSVM_Word idx) -{ - return reinterpret_cast(arr)->find(idx); -} - -// -// ACSVM_Array_Get -// -ACSVM_Word *ACSVM_Array_Get(ACSVM_Array *arr, ACSVM_Word idx) -{ - try - { - return &reinterpret_cast(*arr)[idx]; - } - catch(std::bad_alloc const &) - { - return nullptr; - } -} - -// -// ACSVM_Array_LoadState -// -bool ACSVM_Array_LoadState(ACSVM_Array *arr, ACSVM_Serial *in) -{ - try - { - reinterpret_cast(arr)->loadState( - *reinterpret_cast(in)); - - return true; - } - catch(std::bad_alloc const &) - { - return false; - } -} - -// -// ACSVM_Array_LockStrings -// -void ACSVM_Array_LockStrings(ACSVM_Array const *arr, ACSVM_Environment *env) -{ - reinterpret_cast(arr)->lockStrings(env); -} - -// -// ACSVM_Array_RefStrings -// -void ACSVM_Array_RefStrings(ACSVM_Array const *arr, ACSVM_Environment *env) -{ - reinterpret_cast(arr)->refStrings(env); -} - -// -// ACSVM_Array_SaveState -// -void ACSVM_Array_SaveState(ACSVM_Array const *arr, ACSVM_Serial *out) -{ - reinterpret_cast(arr)->saveState( - *reinterpret_cast(out)); -} - -// -// ACSVM_Array_UnlockStrings -// -void ACSVM_Array_UnlockStrings(ACSVM_Array const *arr, ACSVM_Environment *env) -{ - reinterpret_cast(arr)->unlockStrings(env); -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Array.h b/libs/ACSVM/include/CAPI/Array.h deleted file mode 100644 index c035c6350..000000000 --- a/libs/ACSVM/include/CAPI/Array.h +++ /dev/null @@ -1,55 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Arrays. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Array_H__ -#define ACSVM__CAPI__Array_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/Array.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_Array *ACSVM_AllocArray(void); -void ACSVM_FreeArray(ACSVM_Array *arr); - -void ACSVM_Array_Clear(ACSVM_Array *arr); - -ACSVM_Word ACSVM_Array_Find(ACSVM_Array const *arr, ACSVM_Word idx); - -ACSVM_Word *ACSVM_Array_Get(ACSVM_Array *arr, ACSVM_Word idx); - -bool ACSVM_Array_LoadState(ACSVM_Array *arr, ACSVM_Serial *in); - -void ACSVM_Array_LockStrings(ACSVM_Array const *arr, ACSVM_Environment *env); - -void ACSVM_Array_RefStrings(ACSVM_Array const *arr, ACSVM_Environment *env); - -void ACSVM_Array_SaveState(ACSVM_Array const *arr, ACSVM_Serial *out); - -void ACSVM_Array_UnlockStrings(ACSVM_Array const *arr, ACSVM_Environment *env); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Array_H__ - diff --git a/libs/ACSVM/include/CAPI/BinaryIO.cpp b/libs/ACSVM/include/CAPI/BinaryIO.cpp deleted file mode 100644 index 8bfd2047b..000000000 --- a/libs/ACSVM/include/CAPI/BinaryIO.cpp +++ /dev/null @@ -1,100 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Binary data reading/writing. -// -//----------------------------------------------------------------------------- - -#include "BinaryIO.h" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_Buffer constructor -// -ACSVM_Buffer::ACSVM_Buffer(FILE *stream_) : - stream{stream_} -{ -} - -// -// ACSVM_Buffer::overflow -// -int ACSVM_Buffer::overflow(int c) -{ - return std::fputc(c, stream); -} - -// -// ACSVM_Buffer::uflow -// -int ACSVM_Buffer::uflow() -{ - return std::fgetc(stream); -} - -// -// ACSVM_IStream constructor -// -ACSVM_IStream::ACSVM_IStream(FILE *stream) : - buf{stream} -{ -} - -// -// ACSVM_OStream constructor -// -ACSVM_OStream::ACSVM_OStream(FILE *stream) : - buf{stream} -{ -} - -// -// ACSVM_AllocIStream -// -ACSVM_IStream *ACSVM_AllocIStream_File(FILE *stream) -{ - return reinterpret_cast( - static_cast(new(std::nothrow) ACSVM_IStream(stream))); -} - -// -// ACSVM_AllocOStream -// -ACSVM_OStream *ACSVM_AllocOStream_File(FILE *stream) -{ - return reinterpret_cast( - static_cast(new(std::nothrow) ACSVM_OStream(stream))); -} - -// -// ACSVM_ReadVLN -// -uintmax_t ACSVM_ReadVLN(ACSVM_IStream *in) -{ - return ACSVM::ReadVLN(reinterpret_cast(*in)); -} - -// -// ACSVM_WriteVLN -// -void ACSVM_WriteVLN(ACSVM_OStream *out, uintmax_t in) -{ - ACSVM::WriteVLN(reinterpret_cast(*out), in); -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/BinaryIO.h b/libs/ACSVM/include/CAPI/BinaryIO.h deleted file mode 100644 index 2d6efac22..000000000 --- a/libs/ACSVM/include/CAPI/BinaryIO.h +++ /dev/null @@ -1,96 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Binary data reading/writing. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__BinaryIO_H__ -#define ACSVM__CAPI__BinaryIO_H__ - -#include "Types.h" - -#include - -#ifdef __cplusplus -#include "../ACSVM/BinaryIO.hpp" - -#include -#include -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -#ifdef __cplusplus -// -// ACSVM_Buffer -// -struct ACSVM_Buffer : std::streambuf -{ -public: - ACSVM_Buffer(FILE *stream); - - FILE *stream; - -protected: - virtual int overflow(int c); - - virtual int uflow(); -}; - -// -// ACSVM_IStream -// -struct ACSVM_IStream : std::istream -{ -public: - ACSVM_IStream(FILE *stream); - - ACSVM_Buffer buf; -}; - -// -// ACSVM_OStream -// -struct ACSVM_OStream : std::ostream -{ -public: - ACSVM_OStream(FILE *stream); - - ACSVM_Buffer buf; -}; -#endif - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_IStream *ACSVM_AllocIStream_File(FILE *stream); -void ACSVM_FreeIStream(ACSVM_IStream *stream); - -ACSVM_OStream *ACSVM_AllocOStream_File(FILE *stream); -void ACSVM_FreeOStream(ACSVM_OStream *stream); - -uintmax_t ACSVM_ReadVLN(ACSVM_IStream *in); - -void ACSVM_WriteVLN(ACSVM_OStream *out, uintmax_t in); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__BinaryIO_H__ - diff --git a/libs/ACSVM/include/CAPI/CMakeLists.txt b/libs/ACSVM/include/CAPI/CMakeLists.txt deleted file mode 100644 index c57af5088..000000000 --- a/libs/ACSVM/include/CAPI/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -##----------------------------------------------------------------------------- -## -## Copyright (C) 2015 David Hill -## -## See COPYING for license information. -## -##----------------------------------------------------------------------------- -## -## CMake file for acsvm-capi. -## -##----------------------------------------------------------------------------- - - -##----------------------------------------------------------------------------| -## Environment Configuration | -## - -include_directories(.) - - -##----------------------------------------------------------------------------| -## Targets | -## - -## -## acsvm-capi -## -add_library(acsvm-capi ${ACSVM_SHARED_DECL} - Array.cpp - Array.h - BinaryIO.cpp - BinaryIO.h - Environment.cpp - Environment.h - Floats.cpp - Floats.h - Module.cpp - Module.h - PrintBuf.cpp - PrintBuf.h - Scope.cpp - Scope.h - String.cpp - String.h - Thread.cpp - Thread.h - Types.h -) - -target_link_libraries(acsvm-capi acsvm-util) - -ACSVM_INSTALL_LIB(acsvm-capi) - -## EOF - diff --git a/libs/ACSVM/include/CAPI/Code.h b/libs/ACSVM/include/CAPI/Code.h deleted file mode 100644 index 4bac77b76..000000000 --- a/libs/ACSVM/include/CAPI/Code.h +++ /dev/null @@ -1,68 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Codes. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Code_H__ -#define ACSVM__CAPI__Code_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/Code.hpp" -#endif - - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_Code -// -// ACSVM::Code mirror. -// -typedef enum ACSVM_Code -{ - #define ACSVM_CodeList(name, ...) ACSVM_Code_##name, - #include "../ACSVM/CodeList.hpp" - - ACSVM_Code_None -} ACSVM_Code; - -// -// ACSVM_Func -// -// ACSVM::Func mirror. -// -typedef enum ACSVM_Func -{ - #define ACSVM_FuncList(name) ACSVM_Func_##name, - #include "../ACSVM/CodeList.hpp" - - ACSVM_Func_None -} ACSVM_Func; - -// -// ACSVM_KillType -// -// ACSVM::KillType mirror. -// -typedef enum ACSVM_KillType -{ - ACSVM_KillType_None, - ACSVM_KillType_OutOfBounds, - ACSVM_KillType_UnknownCode, - ACSVM_KillType_UnknownFunc, - ACSVM_KillType_BranchLimit, -} ACSVM_KillType; - -#endif//ACSVM__CAPI__Code_H__ - diff --git a/libs/ACSVM/include/CAPI/Environment.cpp b/libs/ACSVM/include/CAPI/Environment.cpp deleted file mode 100644 index a027be641..000000000 --- a/libs/ACSVM/include/CAPI/Environment.cpp +++ /dev/null @@ -1,484 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Environment. -// -//----------------------------------------------------------------------------- - -#include "Environment.h" - -#include "Code.h" -#include "Module.h" -#include "Thread.h" - -#include "ACSVM/CodeData.hpp" -#include "ACSVM/Error.hpp" -#include "ACSVM/Serial.hpp" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_Environment constructor -// -ACSVM_Environment::ACSVM_Environment(ACSVM_EnvironmentFuncs const &funcs_, void *data_) : - funcs{funcs_}, data{data_} -{ - if(funcs.ctor) - funcs.ctor(this); -} - -// -// ACSVM_Environment destructor -// -ACSVM_Environment::~ACSVM_Environment() -{ - if(funcs.dtor) - funcs.dtor(this); -} - -// -// ACSVM_Environment::allocThread -// -ACSVM::Thread *ACSVM_Environment::allocThread() -{ - if(!funcs.allocThread) - return new ACSVM_Thread(this, {}, nullptr); - - if(ACSVM_Thread *thread = funcs.allocThread(this)) - return thread; - - throw std::bad_alloc(); -} - -// -// ACSVM_Environment::callFunc -// -bool ACSVM_Environment::callFunc(ACSVM::Thread *thread, ACSVM::Word func, - ACSVM::Word const *argV, ACSVM::Word argC) -{ - if(func <= static_cast(ACSVM::Func::None)) - return ACSVM::Environment::callFunc(thread, func, argV, argC); - - auto callFunc = callFuncV[func - static_cast(ACSVM::Func::None) - 1]; - return callFunc(static_cast(thread), argV, argC); -} - -// -// ACSVM_Environment::callSpecImpl -// -ACSVM::Word ACSVM_Environment::callSpecImpl(ACSVM::Thread *thread, - ACSVM::Word spec, ACSVM::Word const *argV, ACSVM::Word argC) -{ - if(!funcs.callSpecImpl) - return ACSVM::Environment::callSpecImpl(thread, spec, argV, argC); - - return funcs.callSpecImpl(this, static_cast(thread), spec, argV, argC); -} - -// -// ACSVM_Environment::checkLock -// -bool ACSVM_Environment::checkLock(ACSVM::Thread *thread, ACSVM::Word lock, bool door) -{ - if(!funcs.checkLock) - return ACSVM::Environment::checkLock(thread, lock, door); - - return funcs.checkLock(this, static_cast(thread), lock, door); -} - -// -// ACSVM_Environment::checkTag -// -bool ACSVM_Environment::checkTag(ACSVM::Word type, ACSVM::Word tag) -{ - if(!funcs.checkTag) - return ACSVM::Environment::checkTag(type, tag); - - return funcs.checkTag(this, type, tag); -} - -// -// ACSVM_Environment::getModuleName -// -ACSVM::ModuleName ACSVM_Environment::getModuleName(char const *str, std::size_t len) -{ - if(!funcs.getModuleName) - return ACSVM::Environment::getModuleName(str, len); - - auto name = funcs.getModuleName(this, str, len); - return {reinterpret_cast(name.s), name.p, name.i}; -} - -// -// ACSVM_Environment::loadModule -// -void ACSVM_Environment::loadModule(ACSVM::Module *module) -{ - if(!funcs.loadModule) - throw ACSVM::ReadError(); - - if(!funcs.loadModule(this, reinterpret_cast(module))) - throw ACSVM::ReadError(); -} - -// -// ACSVM_Environment::loadState -// -void ACSVM_Environment::loadState(ACSVM::Serial &in) -{ - ACSVM::Environment::loadState(in); - - if(funcs.loadState) - funcs.loadState(this, reinterpret_cast(&in)); -} - -// -// ACSVM_Environment::printArray -// -void ACSVM_Environment::printArray(ACSVM::PrintBuf &buf, ACSVM::Array const &array, - ACSVM::Word index, ACSVM::Word limit) -{ - if(!funcs.printArray) - return ACSVM::Environment::printArray(buf, array, index, limit); - - funcs.printArray(this, reinterpret_cast(&buf), - reinterpret_cast(&array), index, limit); -} - -// -// ACSVM_Environment::printKill -// -void ACSVM_Environment::printKill(ACSVM::Thread *thread, ACSVM::Word type, ACSVM::Word killData) -{ - if(!funcs.printKill) - return ACSVM::Environment::printKill(thread, type, killData); - - funcs.printKill(this, static_cast(thread), type, killData); -} - -// -// ACSVM_Environment::readModuleName -// -ACSVM::ModuleName ACSVM_Environment::readModuleName(ACSVM::Serial &in) const -{ - if(!funcs.readModuleName) - return ACSVM::Environment::readModuleName(in); - - auto name = funcs.readModuleName(this, reinterpret_cast(&in)); - return {reinterpret_cast(name.s), name.p, name.i}; -} - -// -// ACSVM_Environment::refStrings -// -void ACSVM_Environment::refStrings() -{ - ACSVM::Environment::refStrings(); - - if(funcs.refStrings) - funcs.refStrings(this); -} - -// -// ACSVM_Environment::resetStrings -// -void ACSVM_Environment::resetStrings() -{ - ACSVM::Environment::resetStrings(); - - if(funcs.resetStrings) - funcs.resetStrings(this); -} - -// -// ACSVM_Environment::saveState -// -void ACSVM_Environment::saveState(ACSVM::Serial &out) const -{ - ACSVM::Environment::saveState(out); - - if(funcs.saveState) - funcs.saveState(this, reinterpret_cast(&out)); -} - -// -// ACSVM_Environment::writeModuleName -// -void ACSVM_Environment::writeModuleName(ACSVM::Serial &out, ACSVM::ModuleName const &in) const -{ - if(!funcs.writeModuleName) - return ACSVM::Environment::writeModuleName(out, in); - - funcs.writeModuleName(this, reinterpret_cast(&out), - {reinterpret_cast(in.s), in.p, in.i}); -} - -// -// ACSVM_AllocEnvironment -// -ACSVM_Environment *ACSVM_AllocEnvironment(ACSVM_EnvironmentFuncs const *funcs, void *data) -{ - return new(std::nothrow) ACSVM_Environment(*funcs, data); -} - -// -// ACSVM_FreeEnvironment -// -void ACSVM_FreeEnvironment(ACSVM_Environment *env) -{ - delete env; -} - -// -// ACSVM_Environment_AddCallFunc -// -ACSVM_Word ACSVM_Environment_AddCallFunc(ACSVM_Environment *env, ACSVM_CallFunc func) -{ - env->callFuncV.push_back(func); - return env->callFuncV.size() + static_cast(ACSVM::Func::None); -} - -// -// ACSVM_Environment_AddCodeDataACS0 -// -void ACSVM_Environment_AddCodeDataACS0(ACSVM_Environment *env, ACSVM_Word code, - char const *args, ACSVM_Code transCode_, ACSVM_Word stackArgC, ACSVM_Word transFunc) -{ - try - { - auto transCode = static_cast(transCode_); - env->addCodeDataACS0(code, {args, transCode, stackArgC, transFunc}); - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - } -} - -// -// ACSVM_Environment_AddFuncDataACS0 -// -void ACSVM_Environment_AddFuncDataACS0(ACSVM_Environment *env, ACSVM_Word func, - ACSVM_Word transFunc, ACSVM_Word const *transCodeArgCV, - ACSVM_Code const *transCodeV, size_t transCodeC) -{ - try - { - if(transCodeC) - { - std::unique_ptr transCodes - {new ACSVM::FuncDataACS0::TransCode[transCodeC]}; - - for(std::size_t i = 0; i != transCodeC; ++i) - transCodes[i] = {transCodeArgCV[i], static_cast(transCodeV[i])}; - - env->addFuncDataACS0(func, {transFunc, std::move(transCodes), transCodeC}); - } - else - env->addFuncDataACS0(func, transFunc); - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - } -} - -// -// ACSVM_Environment_CollectStrings -// -void ACSVM_Environment_CollectStrings(ACSVM_Environment *env) -{ - env->collectStrings(); -} - -// -// ACSVM_Environment_Exec -// -void ACSVM_Environment_Exec(ACSVM_Environment *env) -{ - try - { - env->exec(); - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - } -} - -// -// ACSVM_Environment_FreeGlobalScope -// -void ACSVM_Environment_FreeGlobalScope(ACSVM_Environment *env, ACSVM_GlobalScope *scope) -{ - env->freeGlobalScope(reinterpret_cast(scope)); -} - -// -// ACSVM_Environment_FreeModule -// -void ACSVM_Environment_FreeModule(ACSVM_Environment *env, ACSVM_Module *module) -{ - env->freeModule(reinterpret_cast(module)); -} - -// -// ACSVM_Environment_GetBranchLimit -// -ACSVM_Word ACSVM_Environment_GetBranchLimit(ACSVM_Environment const *env) -{ - return env->branchLimit; -} - -// -// ACSVM_Environment_GetData -// -void *ACSVM_Environment_GetData(ACSVM_Environment const *env) -{ - return env->data; -} - -// -// ACSVM_Environment_GetGlobalScope -// -ACSVM_GlobalScope *ACSVM_Environment_GetGlobalScope(ACSVM_Environment *env, ACSVM_Word id) -{ - try - { - return reinterpret_cast(env->getGlobalScope(id)); - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - - return nullptr; - } -} - -// -// ACSVM_Environment_GetModule -// -ACSVM_Module *ACSVM_Environment_GetModule(ACSVM_Environment *env, ACSVM_ModuleName name) -{ - try - { - return reinterpret_cast(env->getModule( - {reinterpret_cast(name.s), name.p, name.i})); - } - catch(ACSVM::ReadError const &e) - { - if(env->funcs.readError) - env->funcs.readError(env, e.what()); - - return nullptr; - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - - return nullptr; - } -} - -// -// ACSVM_Environment_GetScriptLocRegC -// -ACSVM_Word ACSVM_Environment_GetScriptLocRegC(ACSVM_Environment const *env) -{ - return env->scriptLocRegC; -} - -// -// ACSVM_Environment_GetStringTable -// -ACSVM_StringTable *ACSVM_Environment_GetStringTable(ACSVM_Environment *env) -{ - return reinterpret_cast(&env->stringTable); -} - -// -// ACSVM_Environment_HasActiveThread -// -bool ACSVM_Environment_HasActiveThread(ACSVM_Environment const *env) -{ - return env->hasActiveThread(); -} - -// -// ACSVM_Environment_LoadState -// -bool ACSVM_Environment_LoadState(ACSVM_Environment *env, ACSVM_Serial *in) -{ - try - { - env->loadState(*reinterpret_cast(in)); - return true; - } - catch(ACSVM::SerialError const &e) - { - if(env->funcs.serialError) - env->funcs.serialError(env, e.what()); - - return false; - } - catch(std::bad_alloc const &e) - { - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - - return false; - } -} - -// -// ACSVM_Environment_SaveState -// -void ACSVM_Environment_SaveState(ACSVM_Environment *env, ACSVM_Serial *out) -{ - env->saveState(*reinterpret_cast(out)); -} - -// -// ACSVM_Environment_SetBranchLimit -// -void ACSVM_Environment_SetBranchLimit(ACSVM_Environment *env, ACSVM_Word branchLimit) -{ - env->branchLimit = branchLimit; -} - -// -// ACSVM_Environment_SetData -// -void ACSVM_Environment_SetData(ACSVM_Environment *env, void *data) -{ - env->data = data; -} - -// -// ACSVM_Environment_SetScriptLocRegC -// -void ACSVM_Environment_SetScriptLocReg(ACSVM_Environment *env, ACSVM_Word scriptLocRegC) -{ - env->scriptLocRegC = scriptLocRegC; -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Environment.h b/libs/ACSVM/include/CAPI/Environment.h deleted file mode 100644 index 32344c99b..000000000 --- a/libs/ACSVM/include/CAPI/Environment.h +++ /dev/null @@ -1,198 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Environment. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Environment_H__ -#define ACSVM__CAPI__Environment_H__ - -#include "Code.h" - -#ifdef __cplusplus -#include "../ACSVM/Environment.hpp" - -#include -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_EnvironmentFuncs -// -// Overridable virtual functions in ACSVM_Environment. If null, the base -// function is called. If the base function is pure virtual, then the function -// in this structure must not be null. -// -typedef struct ACSVM_EnvironmentFuncs -{ - // Called in the event of a memory allocation failure. This function may - // return normally, but the ACSVM_Environment object must not be used - // afterward, except to be passed to ACSVM_FreeEnvironment. - void (*bad_alloc)(ACSVM_Environment *env, char const *what); - - // Called if an ACSVM::ReadError is caught. This function may return - // normally. - void (*readError)(ACSVM_Environment *env, char const *what); - - // Called if an ACSVM::SerialError is caught. This function may return - // normally, but the VM state is indeterminate. - void (*serialError)(ACSVM_Environment *env, char const *what); - - // public - - void (*ctor)(ACSVM_Environment *env); - void (*dtor)(ACSVM_Environment *env); - - bool (*checkLock)(ACSVM_Environment const *env, ACSVM_Thread *thread, - ACSVM_Word lock, bool door); - - bool (*checkTag)(ACSVM_Environment const *env, ACSVM_Word type, ACSVM_Word tag); - - ACSVM_ModuleName (*getModuleName)(ACSVM_Environment *env, - char const *str, size_t len); - - // Called after base class's. - void (*loadState)(ACSVM_Environment *env, ACSVM_Serial *in); - - void (*printArray)(ACSVM_Environment const *env, ACSVM_PrintBuf *buf, - ACSVM_Array const *array, ACSVM_Word index, ACSVM_Word limit); - - void (*printKill)(ACSVM_Environment const *env, ACSVM_Thread *thread, - ACSVM_Word type, ACSVM_Word data); - - ACSVM_ModuleName (*readModuleName)(ACSVM_Environment const *env, ACSVM_Serial *in); - - // Called after base class's. - void (*refStrings)(ACSVM_Environment *env); - - // Called after base class's. - void (*resetStrings)(ACSVM_Environment *env); - - // Called after base class's. - void (*saveState)(ACSVM_Environment const *env, ACSVM_Serial *out); - - void (*writeModuleName)(ACSVM_Environment const *env, ACSVM_Serial *out, - ACSVM_ModuleName in); - - // protected - - ACSVM_Thread *(*allocThread)(ACSVM_Environment *env); - - ACSVM_Word (*callSpecImpl)(ACSVM_Environment *env, ACSVM_Thread *thread, - ACSVM_Word spec, ACSVM_Word const *argV, ACSVM_Word argC); - - // Return false if load fails. - bool (*loadModule)(ACSVM_Environment *env, ACSVM_Module *module); -} ACSVM_EnvironmentFuncs; - -#ifdef __cplusplus -// -// ACSVM_Environment -// -struct ACSVM_Environment : ACSVM::Environment -{ -public: - ACSVM_Environment(ACSVM_EnvironmentFuncs const &funcs, void *data); - virtual ~ACSVM_Environment(); - - virtual bool callFunc(ACSVM::Thread *thread, ACSVM::Word func, - ACSVM::Word const *argV, ACSVM::Word argC); - - virtual bool checkLock(ACSVM::Thread *thread, ACSVM::Word lock, bool door); - - virtual bool checkTag(ACSVM::Word type, ACSVM::Word tag); - - virtual ACSVM::ModuleName getModuleName(char const *str, size_t len); - - virtual void loadState(ACSVM::Serial &in); - - virtual void printArray(ACSVM::PrintBuf &buf, ACSVM::Array const &array, - ACSVM::Word index, ACSVM::Word limit); - - virtual void printKill(ACSVM::Thread *thread, ACSVM::Word type, ACSVM::Word data); - - virtual ACSVM::ModuleName readModuleName(ACSVM::Serial &in) const; - - virtual void refStrings(); - - virtual void resetStrings(); - - virtual void saveState(ACSVM::Serial &out) const; - - virtual void writeModuleName(ACSVM::Serial &out, ACSVM::ModuleName const &in) const; - - std::vector callFuncV; - ACSVM_EnvironmentFuncs funcs; - void *data; - -protected: - virtual ACSVM::Thread *allocThread(); - - virtual ACSVM::Word callSpecImpl(ACSVM::Thread *thread, ACSVM::Word spec, - ACSVM::Word const *argV, ACSVM::Word argC); - - virtual void loadModule(ACSVM::Module *module); -}; -#endif - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_Environment *ACSVM_AllocEnvironment(ACSVM_EnvironmentFuncs const *funcs, void *data); -void ACSVM_FreeEnvironment(ACSVM_Environment *env); - -ACSVM_Word ACSVM_Environment_AddCallFunc(ACSVM_Environment *env, ACSVM_CallFunc func); - -void ACSVM_Environment_AddCodeDataACS0(ACSVM_Environment *env, ACSVM_Word code, - char const *args, ACSVM_Code transCode, ACSVM_Word stackArgC, ACSVM_Word transFunc); - -void ACSVM_Environment_AddFuncDataACS0(ACSVM_Environment *env, ACSVM_Word func, - ACSVM_Word transFunc, ACSVM_Word const *transCodeArgCV, - ACSVM_Code const *transCodeV, size_t transCodeC); - -void ACSVM_Environment_CollectStrings(ACSVM_Environment *env); - -void ACSVM_Environment_Exec(ACSVM_Environment *env); - -void ACSVM_Environment_FreeGlobalScope(ACSVM_Environment *env, ACSVM_GlobalScope *scope); -void ACSVM_Environment_FreeModule(ACSVM_Environment *env, ACSVM_Module *module); - -ACSVM_Word ACSVM_Environment_GetBranchLimit(ACSVM_Environment const *env); -void *ACSVM_Environment_GetData(ACSVM_Environment const *env); -ACSVM_GlobalScope *ACSVM_Environment_GetGlobalScope(ACSVM_Environment *env, ACSVM_Word id); -ACSVM_Module *ACSVM_Environment_GetModule(ACSVM_Environment *env, ACSVM_ModuleName name); -ACSVM_Word ACSVM_Environment_GetScriptLocRegC(ACSVM_Environment const *env); -ACSVM_StringTable *ACSVM_Environment_GetStringTable(ACSVM_Environment *env); - -bool ACSVM_Environment_HasActiveThread(ACSVM_Environment const *env); - -bool ACSVM_Environment_LoadState(ACSVM_Environment *env, ACSVM_Serial *in); - -void ACSVM_Environment_SaveState(ACSVM_Environment *env, ACSVM_Serial *out); - -void ACSVM_Environment_SetBranchLimit(ACSVM_Environment *env, ACSVM_Word branchLimit); -void ACSVM_Environment_SetData(ACSVM_Environment *env, void *data); -void ACSVM_Environment_SetScriptLocRegC(ACSVM_Environment *env, ACSVM_Word scriptLocRegC); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Environment_H__ - diff --git a/libs/ACSVM/include/CAPI/Floats.cpp b/libs/ACSVM/include/CAPI/Floats.cpp deleted file mode 100644 index 0a7880053..000000000 --- a/libs/ACSVM/include/CAPI/Floats.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//---------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//---------------------------------------------------------------------------- -// -// Floating-point utilities. -// -//---------------------------------------------------------------------------- - -#include "Floats.h" - -#include "Thread.h" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_CF_* -// - -bool ACSVM_CF_AddF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_AddF_W1(thread, argV, argC);} -bool ACSVM_CF_AddF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_AddF_W2(thread, argV, argC);} -bool ACSVM_CF_DivF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_DivF_W1(thread, argV, argC);} -bool ACSVM_CF_DivF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_DivF_W2(thread, argV, argC);} -bool ACSVM_CF_MulF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_MulF_W1(thread, argV, argC);} -bool ACSVM_CF_MulF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_MulF_W2(thread, argV, argC);} -bool ACSVM_CF_SubF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_SubF_W1(thread, argV, argC);} -bool ACSVM_CF_SubF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_SubF_W2(thread, argV, argC);} - -bool ACSVM_CF_PrintDouble(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_PrintDouble(thread, argV, argC);} -bool ACSVM_CF_PrintFloat(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) - {return ACSVM::CF_PrintFloat(thread, argV, argC);} - -// -// ACSVM_DWordToDouble -// -double ACSVM_DWordToDouble(ACSVM_DWord w) -{ - return ACSVM::WordsToFloat( - {{static_cast(w), static_cast(w >> 32)}}); -} - -// -// ACSVM_DoubleToDWord -// -ACSVM_DWord ACSBM_DoubleToDWord(double f) -{ - auto w = ACSVM::FloatToWords<2>(f); - return (static_cast(w[1]) << 32) | w[0]; -} - -// -// ACSVM_FloatToWord -// -ACSVM_Word ACSVM_FloatToWord(float f) -{ - return ACSVM::FloatToWords<1>(f)[0]; -} - -// -// ACSVM_WordToFloat -// -float ACSVM_WordToFloat(ACSVM_Word w) -{ - return ACSVM::WordsToFloat({{w}}); -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Floats.h b/libs/ACSVM/include/CAPI/Floats.h deleted file mode 100644 index 7f02fba9d..000000000 --- a/libs/ACSVM/include/CAPI/Floats.h +++ /dev/null @@ -1,56 +0,0 @@ -//---------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//---------------------------------------------------------------------------- -// -// Floating-point utilities. -// -//---------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Floats_H__ -#define ACSVM__CAPI__Floats_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../Util/Floats.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -bool ACSVM_CF_AddF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_AddF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_DivF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_DivF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_MulF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_MulF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_SubF_W1(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_SubF_W2(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); - -bool ACSVM_CF_PrintDouble(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); -bool ACSVM_CF_PrintFloat(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC); - -double ACSVM_DWordToDouble(ACSVM_DWord w); - -ACSVM_DWord ACSVM_DoubleToDWord(double f); - -ACSVM_Word ACSVM_FloatToWord(float f); - -float ACSVM_WordToFloat(ACSVM_Word w); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Floats_H__ - diff --git a/libs/ACSVM/include/CAPI/Module.cpp b/libs/ACSVM/include/CAPI/Module.cpp deleted file mode 100644 index a270ec3ab..000000000 --- a/libs/ACSVM/include/CAPI/Module.cpp +++ /dev/null @@ -1,68 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Modules. -// -//----------------------------------------------------------------------------- - -#include "Module.h" - -#include "Environment.h" - -#include "ACSVM/Error.hpp" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_Module_GetName -// -ACSVM_ModuleName ACSVM_Module_GetName(ACSVM_Module const *module_) -{ - auto module = reinterpret_cast(module_); - - return {reinterpret_cast(module->name.s), module->name.p, module->name.i}; -} - -// -// ACSVM_Module_ReadBytecode -// -bool ACSVM_Module_ReadBytecode(ACSVM_Module *module_, ACSVM_Byte const *data, size_t size) -{ - auto module = reinterpret_cast(module_); - - try - { - module->readBytecode(data, size); - return true; - } - catch(ACSVM::ReadError const &e) - { - auto env = static_cast(module->env); - if(env->funcs.readError) - env->funcs.readError(env, e.what()); - return false; - } - catch(std::bad_alloc const &e) - { - auto env = static_cast(module->env); - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - return false; - } -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Module.h b/libs/ACSVM/include/CAPI/Module.h deleted file mode 100644 index 618cd49bb..000000000 --- a/libs/ACSVM/include/CAPI/Module.h +++ /dev/null @@ -1,58 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Modules. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Module_H__ -#define ACSVM__CAPI__Module_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/Module.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_ModuleName -// -// ACSVM::ModuleName mirror. -// -struct ACSVM_ModuleName -{ - ACSVM_String *s; - void *p; - size_t i; -}; - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_ModuleName ACSVM_Module_GetName(ACSVM_Module const *module); - -// Returns false if reading fails. -bool ACSVM_Module_ReadBytecode(ACSVM_Module *module, ACSVM_Byte const *data, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Module_H__ - diff --git a/libs/ACSVM/include/CAPI/PrintBuf.cpp b/libs/ACSVM/include/CAPI/PrintBuf.cpp deleted file mode 100644 index e3c4f5d77..000000000 --- a/libs/ACSVM/include/CAPI/PrintBuf.cpp +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// PrintBuf class. -// -//----------------------------------------------------------------------------- - -#include "PrintBuf.h" - -#include - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_AllocPrintBuf -// -ACSVM_PrintBuf *ACSVM_AllocPrintBuf(void) -{ - return reinterpret_cast(new(std::nothrow) ACSVM::PrintBuf); -} - -// -// ACSVM_FreePrintBuf -// -void ACSVM_FreePrintBuf(ACSVM_PrintBuf *buf) -{ - delete reinterpret_cast(buf); -} - -// -// ACSVM_PrintBuf_Clear -// -void ACSVM_PrintBuf_Clear(ACSVM_PrintBuf *buf) -{ - reinterpret_cast(buf)->clear(); -} - -// -// ACSVM_PrintBuf_Drop -// -void ACSVM_PrintBuf_Drop(ACSVM_PrintBuf *buf) -{ - reinterpret_cast(buf)->drop(); -} - -// -// ACSVM_PrintBuf_Format -// -void ACSVM_PrintBuf_Format(ACSVM_PrintBuf *buf, char const *fmt, ...) -{ - va_list arg; - va_start(arg, fmt); - reinterpret_cast(buf)->formatv(fmt, arg); - va_end(arg); -} - -// -// ACSVM_PrintBuf_FormatV -// -void ACSVM_PrintBuf_FormatV(ACSVM_PrintBuf *buf, char const *fmt, va_list arg) -{ - reinterpret_cast(buf)->formatv(fmt, arg); -} - -// -// ACSVM_PrintBuf_GetBuf -// -char *ACSVM_PrintBuf_GetBuf(ACSVM_PrintBuf *buf, size_t count) -{ - return reinterpret_cast(buf)->getBuf(count); -} - -// -// ACSVM_PrintBuf_GetData -// -char const *ACSVM_PrintBuf_GetData(ACSVM_PrintBuf const *buf) -{ - return reinterpret_cast(buf)->data(); -} - -// -// ACSVM_PrintBuf_GetDataFull -// -char const *ACSVM_PrintBuf_GetDataFull(ACSVM_PrintBuf const *buf) -{ - return reinterpret_cast(buf)->dataFull(); -} - -// -// ACSVM_PrintBuf_GetLoadBuf -// -char *ACSVM_PrintBuf_GetLoadBuf(ACSVM_PrintBuf *buf, size_t countFull, size_t count) -{ - return reinterpret_cast(buf)->getLoadBuf(countFull, count); -} - -// -// ACSVM_PrintBuf_Push -// -void ACSVM_PrintBuf_Push(ACSVM_PrintBuf *buf) -{ - reinterpret_cast(buf)->push(); -} - -// -// ACSVM_PrintBuf_PutC -// -void ACSVM_PrintBuf_PutC(ACSVM_PrintBuf *buf, char c) -{ - reinterpret_cast(buf)->put(c); -} - -// -// ACSVM_PrintBuf_PutS -// -void ACSVM_PrintBuf_PutS(ACSVM_PrintBuf *buf, char const *s, size_t n) -{ - reinterpret_cast(buf)->put(s, n); -} - -// -// ACSVM_PrintBuf_Reserve -// -void ACSVM_PrintBuf_Reserve(ACSVM_PrintBuf *buf, size_t count) -{ - reinterpret_cast(buf)->reserve(count); -} - -// -// ACSVM_PrintBuf_Size -// -size_t ACSVM_PrintBuf_Size(ACSVM_PrintBuf const *buf) -{ - return reinterpret_cast(buf)->size(); -} - -// -// ACSVM_PrintBuf_SizeFull -// -size_t ACSVM_PrintBuf_SizeFull(ACSVM_PrintBuf const *buf) -{ - return reinterpret_cast(buf)->sizeFull(); -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/PrintBuf.h b/libs/ACSVM/include/CAPI/PrintBuf.h deleted file mode 100644 index 5cca535d0..000000000 --- a/libs/ACSVM/include/CAPI/PrintBuf.h +++ /dev/null @@ -1,63 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// PrintBuf class. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__PrintBuf_H__ -#define ACSVM__CAPI__PrintBuf_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/PrintBuf.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_PrintBuf *ACSVM_AllocPrintBuf(void); -void ACSVM_FreePrintBuf(ACSVM_PrintBuf *buf); - -void ACSVM_PrintBuf_Clear(ACSVM_PrintBuf *buf); - -void ACSVM_PrintBuf_Drop(ACSVM_PrintBuf *buf); - -void ACSVM_PrintBuf_Format(ACSVM_PrintBuf *buf, char const *fmt, ...); -void ACSVM_PrintBuf_FormatV(ACSVM_PrintBuf *buf, char const *fmt, va_list arg); - -char *ACSVM_PrintBuf_GetBuf(ACSVM_PrintBuf *buf, size_t count); - -char const *ACSVM_PrintBuf_GetData(ACSVM_PrintBuf const *buf); -char const *ACSVM_PrintBuf_GetDataFull(ACSVM_PrintBuf const *buf); - -char *ACSVM_PrintBuf_GetLoadBuf(ACSVM_PrintBuf *buf, size_t countFull, size_t count); - -void ACSVM_PrintBuf_Push(ACSVM_PrintBuf *buf); - -void ACSVM_PrintBuf_PutC(ACSVM_PrintBuf *buf, char c); -void ACSVM_PrintBuf_PutS(ACSVM_PrintBuf *buf, char const *s, size_t n); - -void ACSVM_PrintBuf_Reserve(ACSVM_PrintBuf *buf, size_t count); - -size_t ACSVM_PrintBuf_Size(ACSVM_PrintBuf const *buf); -size_t ACSVM_PrintBuf_SizeFull(ACSVM_PrintBuf const *buf); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__PrintBuf_H__ - diff --git a/libs/ACSVM/include/CAPI/Scope.cpp b/libs/ACSVM/include/CAPI/Scope.cpp deleted file mode 100644 index f903704bd..000000000 --- a/libs/ACSVM/include/CAPI/Scope.cpp +++ /dev/null @@ -1,363 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Scopes. -// -//----------------------------------------------------------------------------- - -#include "Scope.h" - -#include "Environment.h" -#include "Script.h" -#include "Thread.h" - -#include "ACSVM/Action.hpp" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_GlobalScope_FreeHubScope -// -void ACSVM_GlobalScope_FreeHubScope(ACSVM_GlobalScope *scope, ACSVM_HubScope *scopeHub) -{ - reinterpret_cast(scope) - ->freeHubScope(reinterpret_cast(scopeHub)); -} - -// -// ACSVM_GlobalScope_GetGblArr -// -ACSVM_Array *ACSVM_GlobalScope_GetGblArr(ACSVM_GlobalScope *scope, ACSVM_Word idx) -{ - return reinterpret_cast(&reinterpret_cast(scope)->arrV[idx]); -} - -// -// ACSVM_GlobalScope_GetGblArrC -// -ACSVM_Word ACSVM_GlobalScope_GetGblArrC(ACSVM_GlobalScope const *) -{ - return ACSVM::GlobalScope::ArrC; -} - -// -// ACSVM_GlobalScope_GetHubScope -// -ACSVM_HubScope *ACSVM_GlobalScope_GetHubScope(ACSVM_GlobalScope *scope_, ACSVM_Word id) -{ - auto scope = reinterpret_cast(scope_); - - try - { - return reinterpret_cast(scope->getHubScope(id)); - } - catch(std::bad_alloc const &e) - { - auto env = static_cast(scope->env); - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - - return nullptr; - } -} - -// -// ACSVM_GlobalScope_GetGblReg -// -ACSVM_Word ACSVM_GlobalScope_GetGblReg(ACSVM_GlobalScope const *scope, ACSVM_Word idx) -{ - return reinterpret_cast(scope)->regV[idx]; -} - -// -// ACSVM_GlobalScope_GetGblRegC -// -ACSVM_Word ACSVM_GlobalScope_GetGblRegC(ACSVM_GlobalScope const *) -{ - return ACSVM::GlobalScope::RegC; -} - -// -// ACSVM_GlobalScope_SetActive -// -void ACSVM_GlobalScope_SetActive(ACSVM_GlobalScope *scope, bool active) -{ - reinterpret_cast(scope)->active = active; -} - -// -// ACSVM_GlobalScope_SetGblReg -// -void ACSVM_GlobalScope_SetGblReg(ACSVM_GlobalScope *scope, ACSVM_Word idx, ACSVM_Word reg) -{ - reinterpret_cast(scope)->regV[idx] = reg; -} - -// -// ACSVM_HubScope_FreeMapScope -// -void ACSVM_HubScope_FreeMapScope(ACSVM_HubScope *scope, ACSVM_MapScope *scopeMap) -{ - reinterpret_cast(scope) - ->freeMapScope(reinterpret_cast(scopeMap)); -} - -// -// ACSVM_HubScope_GetHubArr -// -ACSVM_Array *ACSVM_HubScope_GetHubArr(ACSVM_HubScope *scope, ACSVM_Word idx) -{ - return reinterpret_cast(&reinterpret_cast(scope)->arrV[idx]); -} - -// -// ACSVM_HubScope_GetHubArrC -// -ACSVM_Word ACSVM_HubScope_GetHubArrC(ACSVM_HubScope const *) -{ - return ACSVM::HubScope::ArrC; -} - -// -// ACSVM_HubScope_GetMapScope -// -ACSVM_MapScope *ACSVM_HubScope_GetMapScope(ACSVM_HubScope *scope_, ACSVM_Word id) -{ - auto scope = reinterpret_cast(scope_); - - try - { - return reinterpret_cast(scope->getMapScope(id)); - } - catch(std::bad_alloc const &e) - { - auto env = static_cast(scope->env); - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - - return nullptr; - } -} - -// -// ACSVM_HubScope_GetHubReg -// -ACSVM_Word ACSVM_HubScope_GetHubReg(ACSVM_HubScope const *scope, ACSVM_Word idx) -{ - return reinterpret_cast(scope)->regV[idx]; -} - -// -// ACSVM_HubScope_GetHubRegC -// -ACSVM_Word ACSVM_HubScope_GetHubRegC(ACSVM_HubScope const *) -{ - return ACSVM::HubScope::RegC; -} - -// -// ACSVM_HubScope_SetActive -// -void ACSVM_HubScope_SetActive(ACSVM_HubScope *scope, bool active) -{ - reinterpret_cast(scope)->active = active; -} - -// -// ACSVM_HubScope_SetHubReg -// -void ACSVM_HubScope_SetHubReg(ACSVM_HubScope *scope, ACSVM_Word idx, ACSVM_Word reg) -{ - reinterpret_cast(scope)->regV[idx] = reg; -} - -// -// ACSVM_MapScope_AddModule -// -void ACSVM_MapScope_AddModules(ACSVM_MapScope *scope_, - ACSVM_Module *const *moduleV, size_t moduleC) -{ - auto scope = reinterpret_cast(scope_); - - try - { - scope->addModules(reinterpret_cast(moduleV), moduleC); - } - catch(std::bad_alloc const &e) - { - auto env = static_cast(scope->env); - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - } -} - -// -// ACSVM_MapScope_GetModuleScope -// -ACSVM_ModuleScope *ACSVM_MapScope_GetModuleScope(ACSVM_MapScope *scope, ACSVM_Module *module) -{ - return reinterpret_cast( - reinterpret_cast(scope)->getModuleScope( - reinterpret_cast(module))); -} - -// -// ACSVM_MapScope_HasModules -// -bool ACSVM_MapScope_HasModules(ACSVM_MapScope const *scope) -{ - return reinterpret_cast(scope)->hasModules(); -} - -// -// ACSVM_MapScope_ScriptPause -// -bool ACSVM_MapScope_ScriptPause(ACSVM_MapScope *scope, - ACSVM_ScriptName name_, ACSVM_ScopeID id) -{ - ACSVM::ScriptName name{reinterpret_cast(name_.s), name_.i}; - return reinterpret_cast(scope) - ->scriptPause(name, {id.global, id.hub, id.map}); -} - -// -// ACSVM_MapScope_ScriptStart -// -bool ACSVM_MapScope_ScriptStart(ACSVM_MapScope *scope, - ACSVM_ScriptName name_, ACSVM_ScopeID id, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)) -{ - ACSVM::ScriptName name{reinterpret_cast(name_.s), name_.i}; - return reinterpret_cast(scope) - ->scriptStart(name, {id.global, id.hub, id.map}, {argV, argC, info, func}); -} - -// -// ACSVM_MapScope_ScriptStartForced -// -bool ACSVM_MapScope_ScriptStartForced(ACSVM_MapScope *scope, - ACSVM_ScriptName name_, ACSVM_ScopeID id, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)) -{ - ACSVM::ScriptName name{reinterpret_cast(name_.s), name_.i}; - return reinterpret_cast(scope) - ->scriptStartForced(name, {id.global, id.hub, id.map}, {argV, argC, info, func}); -} - -// -// ACSVM_MapScope_ScriptStartResult -// -ACSVM_Word ACSVM_MapScope_ScriptStartResult(ACSVM_MapScope *scope, - ACSVM_ScriptName name_, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)) -{ - ACSVM::ScriptName name{reinterpret_cast(name_.s), name_.i}; - return reinterpret_cast(scope) - ->scriptStartResult(name, {argV, argC, info, func}); -} - -// -// ACSVM_MapScope_ScriptStartType -// -ACSVM_Word ACSVM_MapScope_ScriptStartType(ACSVM_MapScope *scope, - ACSVM_Word type, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)) -{ - return reinterpret_cast(scope) - ->scriptStartType(type, {argV, argC, info, func}); -} - -// -// ACSVM_MapScope_ScriptStartTypeForced -// -ACSVM_Word ACSVM_MapScope_ScriptStartTypeForced(ACSVM_MapScope *scope, - ACSVM_Word type, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)) -{ - return reinterpret_cast(scope) - ->scriptStartTypeForced(type, {argV, argC, info, func}); -} - -// -// ACSVM_MapScope_ScriptStop -// -bool ACSVM_MapScope_ScriptStop(ACSVM_MapScope *scope, - ACSVM_ScriptName name_, ACSVM_ScopeID id) -{ - ACSVM::ScriptName name{reinterpret_cast(name_.s), name_.i}; - return reinterpret_cast(scope) - ->scriptStop(name, {id.global, id.hub, id.map}); -} - -// -// ACSVM_MapScope_GetString -// -ACSVM_String *ACSVM_MapScope_GetString(ACSVM_MapScope *scope, ACSVM::Word idx) -{ - return reinterpret_cast( - reinterpret_cast(scope)->getString(idx)); -} - -// -// ACSVM_MapScope_SetActive -// -void ACSVM_MapScope_SetActive(ACSVM_MapScope *scope, bool active) -{ - reinterpret_cast(scope)->active = active; -} - -// -// ACSVM_ModuleScope_GetModArr -// -ACSVM_Array *ACSVM_ModuleScope_GetModArr(ACSVM_ModuleScope *scope, ACSVM_Word idx) -{ - return reinterpret_cast(reinterpret_cast(scope)->arrV[idx]); -} - -// -// ACSVM_ModuleScope_GetModArrC -// -ACSVM_Word ACSVM_ModuleScope_GetModArrC(ACSVM_ModuleScope const *) -{ - return ACSVM::ModuleScope::ArrC; -} - -// -// ACSVM_ModuleScope_SetModReg -// -void ACSVM_ModuleScope_SetModReg(ACSVM_ModuleScope *scope, ACSVM_Word idx, ACSVM_Word reg) -{ - *reinterpret_cast(scope)->regV[idx] = reg; -} - -// -// ACSVM_ModuleScope_GetModReg -// -ACSVM_Word ACSVM_ModuleScope_GetModReg(ACSVM_ModuleScope const *scope, ACSVM_Word idx) -{ - return *reinterpret_cast(scope)->regV[idx]; -} - -// -// ACSVM_ModuleScope_GetModRegC -// -ACSVM_Word ACSVM_ModuleScope_GetModRegC(ACSVM_ModuleScope const *) -{ - return ACSVM::ModuleScope::RegC; -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Scope.h b/libs/ACSVM/include/CAPI/Scope.h deleted file mode 100644 index 683f0388f..000000000 --- a/libs/ACSVM/include/CAPI/Scope.h +++ /dev/null @@ -1,117 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Scopes. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Scope_H__ -#define ACSVM__CAPI__Scope_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/Scope.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_ScopeID -// -struct ACSVM_ScopeID -{ - ACSVM_Word global; - ACSVM_Word hub; - ACSVM_Word map; -}; - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -void ACSVM_GlobalScope_FreeHubScope(ACSVM_GlobalScope *scope, ACSVM_HubScope *scopeHub); - -ACSVM_Array *ACSVM_GlobalScope_GetGblArr (ACSVM_GlobalScope *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_GlobalScope_GetGblArrC (ACSVM_GlobalScope const *scope); -ACSVM_HubScope *ACSVM_GlobalScope_GetHubScope(ACSVM_GlobalScope *scope, ACSVM_Word id); -ACSVM_Word ACSVM_GlobalScope_GetGblReg (ACSVM_GlobalScope const *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_GlobalScope_GetGblRegC (ACSVM_GlobalScope const *scope); - -void ACSVM_GlobalScope_SetActive(ACSVM_GlobalScope *scope, bool active); -void ACSVM_GlobalScope_SetGblReg(ACSVM_GlobalScope *scope, ACSVM_Word idx, ACSVM_Word reg); - -void ACSVM_HubScope_FreeMapScope(ACSVM_HubScope *scope, ACSVM_MapScope *scopeMap); - -ACSVM_Array *ACSVM_HubScope_GetHubArr (ACSVM_HubScope *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_HubScope_GetHubArrC (ACSVM_HubScope const *scope); -ACSVM_MapScope *ACSVM_HubScope_GetMapScope(ACSVM_HubScope *scope, ACSVM_Word id); -ACSVM_Word ACSVM_HubScope_GetHubReg (ACSVM_HubScope const *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_HubScope_GetHubRegC (ACSVM_HubScope const *scope); - -void ACSVM_HubScope_SetActive(ACSVM_HubScope *scope, bool active); -void ACSVM_HubScope_SetHubReg(ACSVM_HubScope *scope, ACSVM_Word idx, ACSVM_Word reg); - -void ACSVM_MapScope_AddModules(ACSVM_MapScope *scope, - ACSVM_Module *const *moduleV, size_t moduleC); - -ACSVM_ModuleScope *ACSVM_MapScope_GetModuleScope(ACSVM_MapScope *scope, ACSVM_Module *module); - -bool ACSVM_MapScope_HasModules(ACSVM_MapScope const *scope); - -bool ACSVM_MapScope_ScriptPause(ACSVM_MapScope *scope, - ACSVM_ScriptName name, ACSVM_ScopeID id); - -bool ACSVM_MapScope_ScriptStart(ACSVM_MapScope *scope, - ACSVM_ScriptName name, ACSVM_ScopeID id, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)); - -bool ACSVM_MapScope_ScriptStartForced(ACSVM_MapScope *scope, - ACSVM_ScriptName name, ACSVM_ScopeID id, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)); - -ACSVM_Word ACSVM_MapScope_ScriptStartResult(ACSVM_MapScope *scope, - ACSVM_ScriptName name, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)); - -ACSVM_Word ACSVM_MapScope_ScriptStartType(ACSVM_MapScope *scope, - ACSVM_Word type, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)); - -ACSVM_Word ACSVM_MapScope_ScriptStartTypeForced(ACSVM_MapScope *scope, - ACSVM_Word type, ACSVM_Word const *argV, ACSVM_Word argC, - ACSVM_ThreadInfo const *info, void (*func)(void *thread)); - -bool ACSVM_MapScope_ScriptStop(ACSVM_MapScope *scope, - ACSVM_ScriptName name, ACSVM_ScopeID id); - -ACSVM_String *ACSVM_MapScope_GetString(ACSVM_MapScope *scope, ACSVM_Word idx); - -void ACSVM_MapScope_SetActive(ACSVM_MapScope *scope, bool active); - -ACSVM_Array *ACSVM_ModuleScope_GetModArr (ACSVM_ModuleScope *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_ModuleScope_GetModArrC(ACSVM_ModuleScope const *scope); -ACSVM_Word ACSVM_ModuleScope_GetModReg (ACSVM_ModuleScope const *scope, ACSVM_Word idx); -ACSVM_Word ACSVM_ModuleScope_GetModRegC(ACSVM_ModuleScope const *scope); - -void ACSVM_ModuleScope_SetModReg(ACSVM_ModuleScope *scope, ACSVM_Word idx, ACSVM_Word reg); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Scope_H__ - diff --git a/libs/ACSVM/include/CAPI/Script.h b/libs/ACSVM/include/CAPI/Script.h deleted file mode 100644 index 6aa843c0e..000000000 --- a/libs/ACSVM/include/CAPI/Script.h +++ /dev/null @@ -1,52 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Scripts. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Script_H__ -#define ACSVM__CAPI__Script_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "ACSVM/Script.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_ScriptName -// -// ACSVM::ScriptName mirror. -// -struct ACSVM_ScriptName -{ - ACSVM_String *s; - ACSVM_Word i; -}; - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Script_H__ - diff --git a/libs/ACSVM/include/CAPI/String.cpp b/libs/ACSVM/include/CAPI/String.cpp deleted file mode 100644 index 471b3675c..000000000 --- a/libs/ACSVM/include/CAPI/String.cpp +++ /dev/null @@ -1,184 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Strings. -// -//----------------------------------------------------------------------------- - -#include "ACS_String.h" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_StrHash -// -size_t ACSVM_StrHash(char const *str, size_t len) -{ - return ACSVM::StrHash(str, len); -} - -// -// ACSVM_String_GetHash -// -size_t ACSVM_String_GetHash(ACSVM_String const *s) -{ - return reinterpret_cast(s)->hash; -} - -// -// ACSVM_String_GetIdx -// -ACSVM_Word ACSVM_String_GetIdx(ACSVM_String const *s) -{ - return reinterpret_cast(s)->idx; -} - -// -// ACSVM_String_GetLen -// -size_t ACSVM_String_GetLen(ACSVM_String const *s) -{ - return reinterpret_cast(s)->len; -} - -// -// ACSVM_String_GetLen0 -// -ACSVM_Word ACSVM_String_GetLen0(ACSVM_String const *s) -{ - return reinterpret_cast(s)->len0; -} - -// -// ACSVM_String_GetLock -// -size_t ACSVM_String_GetLock(ACSVM_String const *s) -{ - return reinterpret_cast(s)->lock; -} - -// -// ACSVM_String_GetStr -// -char const *ACSVM_String_GetStr(ACSVM_String const *s) -{ - return reinterpret_cast(s)->str; -} - -// -// ACSVM_String_SetLock -// -void ACSVM_String_SetLock(ACSVM_String *s, size_t lock) -{ - reinterpret_cast(s)->lock = lock; -} - -// -// ACSVM_String_SetRef -// -void ACSVM_String_SetRef(ACSVM_String *s) -{ - reinterpret_cast(s)->ref = true; -} - -// -// ACSVM_AllocStringTable -// -ACSVM_StringTable *ACSVM_AllocStringTable(void) -{ - return reinterpret_cast(new(std::nothrow) ACSVM::StringTable); -} - -// -// ACSVM_FreeStringTable -// -void ACSVM_FreeStringTable(ACSVM_StringTable *table) -{ - delete reinterpret_cast(table); -} - -// -// ACSVM_StringTable_Clear -// -void ACSVM_StringTable_Clear(ACSVM_StringTable *table) -{ - reinterpret_cast(table)->clear(); -} - -// -// ACSVM_StringTable_CollectBegin -// -void ACSVM_StringTable_CollectBegin(ACSVM_StringTable *table) -{ - reinterpret_cast(table)->collectBegin(); -} - -// -// ACSVM_StringTable_CollectEnd -// -void ACSVM_StringTable_CollectEnd(ACSVM_StringTable *table) -{ - reinterpret_cast(table)->collectEnd(); -} - -// -// ACSVM_StringTable_GetNone -// -ACSVM_String *ACSVM_StringTable_GetNone(ACSVM_StringTable *table) -{ - return reinterpret_cast( - &reinterpret_cast(table)->getNone()); -} - -// -// ACSVM_StringTable_GetStringByData -// -ACSVM_String *ACSVM_StringTable_GetStringByData(ACSVM_StringTable *table, - char const *str, size_t len, size_t hash) -{ - return reinterpret_cast( - &reinterpret_cast(*table)[{str, len, hash}]); -} - -// -// ACSVM_StringTable_GetStringByIdx -// -ACSVM_String *ACSVM_StringTable_GetStringByIdx(ACSVM_StringTable *table, ACSVM::Word idx) -{ - return reinterpret_cast( - &reinterpret_cast(*table)[idx]); -} - -// -// ACSVM_StringTable_LoadState -// -void ACSVM_StringTable_LoadState(ACSVM_StringTable *table, ACSVM_IStream *in) -{ - reinterpret_cast(table)->loadState( - reinterpret_cast(*in)); -} - -// -// ACSVM_StringTable_SaveState -// -void ACSVM_StringTable_SaveState(ACSVM_StringTable *table, ACSVM_OStream *out) -{ - reinterpret_cast(table)->saveState( - reinterpret_cast(*out)); -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/String.h b/libs/ACSVM/include/CAPI/String.h deleted file mode 100644 index cbf4b7a6f..000000000 --- a/libs/ACSVM/include/CAPI/String.h +++ /dev/null @@ -1,65 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Strings. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__String_H__ -#define ACSVM__CAPI__String_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/String.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -size_t ACSVM_StrHash(char const *str, size_t len); - -size_t ACSVM_String_GetHash(ACSVM_String const *s); -ACSVM_Word ACSVM_String_GetIdx (ACSVM_String const *s); -size_t ACSVM_String_GetLen (ACSVM_String const *s); -ACSVM_Word ACSVM_String_GetLen0(ACSVM_String const *s); -size_t ACSVM_String_GetLock(ACSVM_String const *s); -char const *ACSVM_String_GetStr (ACSVM_String const *s); - -void ACSVM_String_SetLock(ACSVM_String *s, size_t lock); -void ACSVM_String_SetRef (ACSVM_String *s); - -ACSVM_StringTable *ACSVM_AllocStringTable(void); -void ACSVM_FreeStringTable(ACSVM_StringTable *table); - -void ACSVM_StringTable_Clear(ACSVM_StringTable *table); - -void ACSVM_StringTable_CollectBegin(ACSVM_StringTable *table); -void ACSVM_StringTable_CollectEnd(ACSVM_StringTable *table); - -ACSVM_String *ACSVM_StringTable_GetNone(ACSVM_StringTable *table); -ACSVM_String *ACSVM_StringTable_GetStringByData(ACSVM_StringTable *table, - char const *str, size_t len, size_t hash); -ACSVM_String *ACSVM_StringTable_GetStringByIdx(ACSVM_StringTable *table, ACSVM_Word idx); - -void ACSVM_StringTable_LoadState(ACSVM_StringTable *table, ACSVM_IStream *in); - -void ACSVM_StringTable_SaveState(ACSVM_StringTable *table, ACSVM_OStream *out); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__String_H__ - diff --git a/libs/ACSVM/include/CAPI/Thread.cpp b/libs/ACSVM/include/CAPI/Thread.cpp deleted file mode 100644 index 7047128ac..000000000 --- a/libs/ACSVM/include/CAPI/Thread.cpp +++ /dev/null @@ -1,373 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Threads. -// -//----------------------------------------------------------------------------- - -#include "Thread.h" - -#include "Array.h" -#include "Environment.h" - - -extern "C" -{ - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// ACSVM_ThreadInfo constructor -// -ACSVM_ThreadInfo::ACSVM_ThreadInfo(void *data_) : - data{data_} -{ -} - -// -// ACSVM_ThreadInfo destructor -// -ACSVM_ThreadInfo::~ACSVM_ThreadInfo() -{ -} - -// -// ACSVM_Thread constructor -// -ACSVM_Thread::ACSVM_Thread(ACSVM_Environment *env_, ACSVM_ThreadFuncs const &funcs_, void *data_) : - ACSVM::Thread{env_}, funcs{funcs_}, info{data_} -{ - if(funcs.ctor) - funcs.ctor(this); -} - -// -// ACSVM_Thread destructor -// -ACSVM_Thread::~ACSVM_Thread() -{ - if(funcs.dtor) - funcs.dtor(this); -} - -// -// ACSVM_Thread::getInfo -// -ACSVM::ThreadInfo const *ACSVM_Thread::getInfo() const -{ - return &info; -} - -// -// ACSVM_Thread::loadState -// -void ACSVM_Thread::loadState(ACSVM::Serial &in) -{ - ACSVM::Thread::loadState(in); - - if(funcs.loadState) - funcs.loadState(this, reinterpret_cast(&in)); -} - -// -// ACSVM_Thread::lockStrings -// -void ACSVM_Thread::lockStrings() const -{ - ACSVM::Thread::lockStrings(); - - if(funcs.lockStrings) - funcs.lockStrings(this); -} - -// -// ACSVM_Thread::refStrings -// -void ACSVM_Thread::refStrings() const -{ - ACSVM::Thread::refStrings(); - - if(funcs.refStrings) - funcs.refStrings(this); -} - -// -// ACSVM_Thread::saveState -// -void ACSVM_Thread::saveState(ACSVM::Serial &out) const -{ - ACSVM::Thread::saveState(out); - - if(funcs.saveState) - funcs.saveState(this, reinterpret_cast(&out)); -} - -// -// ACSVM_Thread::start -// -void ACSVM_Thread::start(ACSVM::Script *script, ACSVM::MapScope *map, - ACSVM::ThreadInfo const *infoPtr, ACSVM::Word const *argV, ACSVM::Word argC) -{ - ACSVM::Thread::start(script, map, infoPtr, argV, argC); - - if(funcs.start) - { - auto infoDer = dynamic_cast(infoPtr); - funcs.start(this, infoDer ? infoDer->data : nullptr); - } -} - -// -// ACSVM_Thread::stop -// -void ACSVM_Thread::stop() -{ - ACSVM::Thread::stop(); - - if(funcs.stop) - funcs.stop(this); -} - -// -// ACSVM_Thread::unlockStrings -// -void ACSVM_Thread::unlockStrings() const -{ - ACSVM::Thread::unlockStrings(); - - if(funcs.unlockStrings) - funcs.unlockStrings(this); -} - -// -// ACSVM_AllocThread -// -ACSVM_Thread *ACSVM_AllocThread(ACSVM_Environment *env, - ACSVM_ThreadFuncs const *funcs, void *data) -{ - return new(std::nothrow) ACSVM_Thread(env, *funcs, data); -} - -// -// ACSVM_AllocThreadInfo -// -ACSVM_ThreadInfo *ACSVM_AllocThreadInfo(void *data) -{ - return new(std::nothrow) ACSVM_ThreadInfo(data); -} - -// -// ACSVM_ThreadFromVoid -// -ACSVM_Thread *ACSVM_ThreadFromVoid(void *thread) -{ - return static_cast(static_cast(thread)); -} - -// -// ACSVM_Thread_Exec -// -void ACSVM_Thread_Exec(ACSVM_Thread *thread) -{ - try - { - thread->exec(); - } - catch(std::bad_alloc const &e) - { - auto env = static_cast(thread->env); - if(env->funcs.bad_alloc) - env->funcs.bad_alloc(env, e.what()); - } -} - -// -// ACSVM_Thread_GetCodePtr -// -ACSVM_Word const *ACSVM_Thread_GetCodePtr(ACSVM_Thread const *thread) -{ - return thread->codePtr; -} - -// -// ACSVM_Thread_GetDelay -// -ACSVM_Word ACSVM_Thread_GetDelay(ACSVM_Thread const *thread) -{ - return thread->delay; -} - -// -// ACSVM_Thread_GetEnv -// -ACSVM_Environment *ACSVM_Thread_GetEnv(ACSVM_Thread const *thread) -{ - return static_cast(thread->env); -} - -// -// ACSVM_Thread_GetInfo -// -void *ACSVM_Thread_GetInfo(ACSVM_Thread const *thread) -{ - return thread->info.data; -} - -// -// ACSVM_Thread_GetLocalArr -// -ACSVM_Array *ACSVM_Thread_GetLocalArr(ACSVM_Thread *thread, ACSVM_Word idx) -{ - if(idx < thread->localArr.size()) - return reinterpret_cast(&thread->localArr[idx]); - else - return nullptr; -} - -// -// ACSVM_Thread_GetLocalReg -// -ACSVM_Word *ACSVM_Thread_GetLocalReg(ACSVM_Thread *thread, ACSVM_Word idx) -{ - if(idx < thread->localReg.size()) - return &thread->localReg[idx]; - else - return nullptr; -} - -// -// ACSVM_Thread_GetModule -// -ACSVM_Module *ACSVM_Thread_GetModule(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->module); -} - -// -// ACSVM_Thread_GetPrintBuf -// -ACSVM_PrintBuf *ACSVM_Thread_GetPrintBuf(ACSVM_Thread *thread) -{ - return reinterpret_cast(&thread->printBuf); -} - -// -// ACSVM_Thread_GetResult -// -ACSVM_Word ACSVM_Thread_GetResult(ACSVM_Thread const *thread) -{ - return thread->result; -} - -// -// ACSVM_Thread_GetScopeGbl -// -ACSVM_GlobalScope *ACSVM_Thread_GetScopeGbl(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->scopeGbl); -} - -// -// ACSVM_Thread_GetScopeHub -// -ACSVM_HubScope *ACSVM_Thread_GetScopeHub(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->scopeHub); -} - -// -// ACSVM_Thread_GetScopeMap -// -ACSVM_MapScope *ACSVM_Thread_GetScopeMap(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->scopeMap); -} - -// -// ACSVM_Thread_GetScopeMod -// -ACSVM_ModuleScope *ACSVM_Thread_GetScopeMod(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->scopeMod); -} - -// -// ACSVM_Thread_GetScript -// -ACSVM_Script *ACSVM_Thread_GetScript(ACSVM_Thread const *thread) -{ - return reinterpret_cast(thread->script); -} - -// -// ACSVM_Thread_GetState -// -ACSVM_ThreadState ACSVM_Thread_GetState(ACSVM_Thread const *thread) -{ - return - { - static_cast(thread->state.state), - thread->state.data, thread->state.type - }; -} - -// -// ACSVM_Thread_DatakStk_Push -// -void ACSVM_Thread_DataStk_Push(ACSVM_Thread *thread, ACSVM_Word data) -{ - thread->dataStk.push(data); -} - -// -// ACSVM_Thread_SetCodePtr -// -void ACSVM_Thread_SetCodePtr(ACSVM_Thread *thread, ACSVM_Word const *codePtr) -{ - thread->codePtr = codePtr; -} - -// -// ACSVM_Thread_SetDelay -// -void ACSVM_Thread_SetDelay(ACSVM_Thread *thread, ACSVM_Word delay) -{ - thread->delay = delay; -} - -// -// ACSVM_Thread_SetInfo -// -void ACSVM_Thread_SetInfo(ACSVM_Thread *thread, void *info) -{ - thread->info.data = info; -} - -// -// ACSVM_Thread_SetResult -// -void ACSVM_Thread_SetResult(ACSVM_Thread *thread, ACSVM_Word result) -{ - thread->result = result; -} - -// -// ACSVM_Thread_SetState -// -void ACSVM_Thread_SetState(ACSVM_Thread *thread, ACSVM_ThreadState state) -{ - thread->state = - {static_cast(state.state), state.data, state.type}; -} - -} - -// EOF - diff --git a/libs/ACSVM/include/CAPI/Thread.h b/libs/ACSVM/include/CAPI/Thread.h deleted file mode 100644 index 192aacc80..000000000 --- a/libs/ACSVM/include/CAPI/Thread.h +++ /dev/null @@ -1,171 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Threads. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Thread_H__ -#define ACSVM__CAPI__Thread_H__ - -#include "Types.h" - -#ifdef __cplusplus -#include "../ACSVM/Thread.hpp" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -// -// ACSVM_ThreadStateEnum -// -typedef enum ACSVM_ThreadStateEnum -{ - ACSVM_ThreadState_Inactive, // Inactive thread. - ACSVM_ThreadState_Running, // Running. - ACSVM_ThreadState_Stopped, // Will go inactive on next exec. - ACSVM_ThreadState_Paused, // Paused by instruction. - ACSVM_ThreadState_WaitScrI, // Waiting on a numbered script. - ACSVM_ThreadState_WaitScrS, // Waiting on a named script. - ACSVM_ThreadState_WaitTag, // Waiting on tagged object. -} ACSVM_ThreadStateEnum; - -// -// ACSVM_ThreadFuncs -// -// ACSVM_Thread functions. If non-null, these get called after the base class. -// -typedef struct ACSVM_ThreadFuncs -{ - // public - - void (*ctor)(ACSVM_Thread *env); - void (*dtor)(ACSVM_Thread *env); - - void (*loadState)(ACSVM_Thread *thread, ACSVM_Serial *in); - - void (*lockStrings)(ACSVM_Thread const *thread); - - void (*refStrings)(ACSVM_Thread const *thread); - - void (*saveState)(ACSVM_Thread const *thread, ACSVM_Serial *out); - - void (*start)(ACSVM_Thread *thread, void *data); - - void (*stop)(ACSVM_Thread *thread); - - void (*unlockStrings)(ACSVM_Thread const *thread); -} ACSVM_ThreadFuncs; - -// -// ACSVM_ThreadState -// -// ACSVM::ThreadState mirror. -// -struct ACSVM_ThreadState -{ - ACSVM_ThreadStateEnum state; - ACSVM_Word data; - ACSVM_Word type; -}; - -#ifdef __cplusplus -// -// ACSVM_ThreadInfo -// -struct ACSVM_ThreadInfo : ACSVM::ThreadInfo -{ -public: - explicit ACSVM_ThreadInfo(void *data); - virtual ~ACSVM_ThreadInfo(); - - void *data; -}; - -// -// ACSVM_Thread -// -struct ACSVM_Thread : ACSVM::Thread -{ -public: - ACSVM_Thread(ACSVM_Environment *env, ACSVM_ThreadFuncs const &funcs, void *data); - virtual ~ACSVM_Thread(); - - virtual ACSVM::ThreadInfo const *getInfo() const; - - virtual void loadState(ACSVM::Serial &in); - - virtual void lockStrings() const; - - virtual void refStrings() const; - - virtual void saveState(ACSVM::Serial &out) const; - - virtual void start(ACSVM::Script *script, ACSVM::MapScope *map, - ACSVM::ThreadInfo const *info, ACSVM::Word const *argV, ACSVM::Word argC); - - virtual void stop(); - - virtual void unlockStrings() const; - - ACSVM_ThreadFuncs funcs; - ACSVM_ThreadInfo info; -}; -#endif - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -ACSVM_Thread *ACSVM_AllocThread(ACSVM_Environment *env, - ACSVM_ThreadFuncs const *funcs, void *data); - -ACSVM_ThreadInfo *ACSVM_AllocThreadInfo(void *data); - -ACSVM_Thread *ACSVM_ThreadFromVoid(void *thread); - -void ACSVM_Thread_Exec(ACSVM_Thread *thread); - -ACSVM_Word const *ACSVM_Thread_GetCodePtr (ACSVM_Thread const *thread); -ACSVM_Word ACSVM_Thread_GetDelay (ACSVM_Thread const *thread); -ACSVM_Environment *ACSVM_Thread_GetEnv (ACSVM_Thread const *thread); -void *ACSVM_Thread_GetInfo (ACSVM_Thread const *thread); -ACSVM_Array *ACSVM_Thread_GetLocalArr(ACSVM_Thread *thread, ACSVM_Word idx); -ACSVM_Word *ACSVM_Thread_GetLocalReg(ACSVM_Thread *thread, ACSVM_Word idx); -ACSVM_Module *ACSVM_Thread_GetModule (ACSVM_Thread const *thread); -ACSVM_PrintBuf *ACSVM_Thread_GetPrintBuf(ACSVM_Thread *thread); -ACSVM_Word ACSVM_Thread_GetResult (ACSVM_Thread const *thread); -ACSVM_GlobalScope *ACSVM_Thread_GetScopeGbl(ACSVM_Thread const *thread); -ACSVM_HubScope *ACSVM_Thread_GetScopeHub(ACSVM_Thread const *thread); -ACSVM_MapScope *ACSVM_Thread_GetScopeMap(ACSVM_Thread const *thread); -ACSVM_ModuleScope *ACSVM_Thread_GetScopeMod(ACSVM_Thread const *thread); -ACSVM_Script *ACSVM_Thread_GetScript (ACSVM_Thread const *thread); -ACSVM_ThreadState ACSVM_Thread_GetState (ACSVM_Thread const *thread); - -void ACSVM_Thread_DataStk_Push(ACSVM_Thread *thread, ACSVM_Word data); - -void ACSVM_Thread_SetCodePtr(ACSVM_Thread *thread, ACSVM_Word const *codePtr); -void ACSVM_Thread_SetDelay (ACSVM_Thread *thread, ACSVM_Word delay); -void ACSVM_Thread_SetInfo (ACSVM_Thread *thread, void *info); -void ACSVM_Thread_SetResult (ACSVM_Thread *thread, ACSVM_Word result); -void ACSVM_Thread_SetState (ACSVM_Thread *thread, ACSVM_ThreadState state); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Thread_H__ - diff --git a/libs/ACSVM/include/CAPI/Types.h b/libs/ACSVM/include/CAPI/Types.h deleted file mode 100644 index 86c5e9279..000000000 --- a/libs/ACSVM/include/CAPI/Types.h +++ /dev/null @@ -1,68 +0,0 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) 2015 David Hill -// -// See COPYING for license information. -// -//----------------------------------------------------------------------------- -// -// Common typedefs and struct declarations. -// -//----------------------------------------------------------------------------- - -#ifndef ACSVM__CAPI__Types_H__ -#define ACSVM__CAPI__Types_H__ - -#ifdef __cplusplus -#include "../ACSVM/Types.hpp" -#endif - -#include -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------| -// Types | -// - -typedef unsigned char ACSVM_Byte; -typedef uint64_t ACSVM_DWord; -typedef int64_t ACSVM_SDWord; -typedef int32_t ACSVM_SWord; -typedef uint32_t ACSVM_Word; - -typedef struct ACSVM_Array ACSVM_Array; -typedef struct ACSVM_Environment ACSVM_Environment; -typedef struct ACSVM_GlobalScope ACSVM_GlobalScope; -typedef struct ACSVM_HubScope ACSVM_HubScope; -typedef struct ACSVM_IStream ACSVM_IStream; -typedef struct ACSVM_MapScope ACSVM_MapScope; -typedef struct ACSVM_Module ACSVM_Module; -typedef struct ACSVM_ModuleName ACSVM_ModuleName; -typedef struct ACSVM_ModuleScope ACSVM_ModuleScope; -typedef struct ACSVM_OStream ACSVM_OStream; -typedef struct ACSVM_PrintBuf ACSVM_PrintBuf; -typedef struct ACSVM_ScopeID ACSVM_ScopeID; -typedef struct ACSVM_Script ACSVM_Script; -typedef struct ACSVM_ScriptName ACSVM_ScriptName; -typedef struct ACSVM_Serial ACSVM_Serial; -typedef struct ACSVM_String ACSVM_String; -typedef struct ACSVM_StringTable ACSVM_StringTable; -typedef struct ACSVM_Thread ACSVM_Thread; -typedef struct ACSVM_ThreadInfo ACSVM_ThreadInfo; -typedef struct ACSVM_ThreadState ACSVM_ThreadState; - -typedef bool (*ACSVM_CallFunc)(ACSVM_Thread *, ACSVM_Word const *, ACSVM_Word); - -#ifdef __cplusplus -} -#endif - -#endif//ACSVM__CAPI__Types_H__ - diff --git a/libs/ACSVM/include/Exec/CMakeLists.txt b/libs/ACSVM/include/Exec/CMakeLists.txt deleted file mode 100644 index f0c929f61..000000000 --- a/libs/ACSVM/include/Exec/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -##----------------------------------------------------------------------------- -## -## Copyright (C) 2015 David Hill -## -## See COPYING for license information. -## -##----------------------------------------------------------------------------- -## -## CMake file for acsvm-exec. -## -##----------------------------------------------------------------------------- - - -##----------------------------------------------------------------------------| -## Environment Configuration | -## - -include_directories(.) - - -##----------------------------------------------------------------------------| -## Targets | -## - -## -## acsvm-exec -## -add_executable(acsvm-exec - main_exec.cpp -) - -target_link_libraries(acsvm-exec acsvm-util) - -## -## acsvm-execc -## -## Used to test the C API. -## -if(EXISTS "${CMAKE_SOURCE_DIR}/CAPI") - add_executable(acsvm-execc - main_execc.c - ) - - target_link_libraries(acsvm-execc acsvm-capi) -endif() - -## EOF - diff --git a/libs/ACSVM/include/Exec/main_exec.cpp b/libs/ACSVM/include/Exec/main_exec.cpp deleted file mode 100644 index 3e84140e7..000000000 --- a/libs/ACSVM/include/Exec/main_exec.cpp +++ /dev/null @@ -1,264 +0,0 @@ -//---------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//---------------------------------------------------------------------------- -// -// Program entry point. -// -//---------------------------------------------------------------------------- - -#include "ACSVM/Code.hpp" -#include "ACSVM/CodeData.hpp" -#include "ACSVM/Environment.hpp" -#include "ACSVM/Error.hpp" -#include "ACSVM/Module.hpp" -#include "ACSVM/Scope.hpp" -#include "ACSVM/Script.hpp" -#include "ACSVM/Serial.hpp" -#include "ACSVM/Thread.hpp" - -#include "Util/Floats.hpp" - -#include -#include -#include -#include -#include -#include - - -//----------------------------------------------------------------------------| -// Types | -// - -// -// Environment -// -class Environment : public ACSVM::Environment -{ -public: - Environment(); - - virtual void exec() {++timer; ACSVM::Environment::exec();} - - ACSVM::Word timer; - -protected: - virtual void loadModule(ACSVM::Module *module); -}; - - -//----------------------------------------------------------------------------| -// Static Objects | -// - -static bool NeedExit = false; -static bool NeedTestSaveEnv = false; - - -//----------------------------------------------------------------------------| -// Static Functions | -// - -// -// CF_CollectStrings -// -static bool CF_CollectStrings(ACSVM::Thread *thread, ACSVM::Word const *, ACSVM::Word) -{ - std::size_t countOld = thread->env->stringTable.size(); - thread->env->collectStrings(); - std::size_t countNew = thread->env->stringTable.size(); - thread->dataStk.push(countOld - countNew); - return false; -} - -// -// CF_DumpLocals -// -static bool CF_DumpLocals(ACSVM::Thread *thread, ACSVM::Word const *, ACSVM::Word) -{ - // LocReg store info. - std::cout << "LocReg=" - << thread->localReg.begin() << '+' << thread->localReg.size() << " / " - << thread->localReg.beginFull() << '+' << thread->localReg.sizeFull() << "\n"; - - // LocReg values for current function. - for(std::size_t i = 0, e = thread->localReg.size(); i != e; ++i) - std::cout << " [" << i << "]=" << thread->localReg[i] << '\n'; - - return false; -} - -// -// CF_EndPrint -// -static bool CF_EndPrint(ACSVM::Thread *thread, ACSVM::Word const *, ACSVM::Word) -{ - std::cout << thread->printBuf.data() << '\n'; - thread->printBuf.drop(); - return false; -} - -// -// CF_Exit -// -static bool CF_Exit(ACSVM::Thread *thread, ACSVM::Word const *, ACSVM::Word) -{ - NeedExit = true; - thread->state = ACSVM::ThreadState::Stopped; - return true; -} - -// -// CF_TestSave -// -static bool CF_TestSave(ACSVM::Thread *, ACSVM::Word const *, ACSVM::Word) -{ - NeedTestSaveEnv = true; - return false; -} - -// -// CF_Timer -// -static bool CF_Timer(ACSVM::Thread *thread, ACSVM::Word const *, ACSVM::Word) -{ - thread->dataStk.push(static_cast(thread->env)->timer); - return false; -} - -// -// LoadModules -// -static void LoadModules(Environment &env, char const *const *argv, std::size_t argc) -{ - // Load modules. - std::vector modules; - for(std::size_t i = 1; i < argc; ++i) - modules.push_back(env.getModule(env.getModuleName(argv[i]))); - - // Create and activate scopes. - ACSVM::GlobalScope *global = env.getGlobalScope(0); global->active = true; - ACSVM::HubScope *hub = global->getHubScope(0); hub ->active = true; - ACSVM::MapScope *map = hub->getMapScope(0); map ->active = true; - - // Register modules with map scope. - map->addModules(modules.data(), modules.size()); - - // Start Open scripts. - map->scriptStartType(1, {}); -} - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// Environment constructor -// -Environment::Environment() : - timer{0} -{ - ACSVM::Word funcCollectStrings = addCallFunc(CF_CollectStrings); - ACSVM::Word funcDumpLocals = addCallFunc(CF_DumpLocals); - ACSVM::Word funcEndPrint = addCallFunc(CF_EndPrint); - ACSVM::Word funcExit = addCallFunc(CF_Exit); - ACSVM::Word funcTestSave = addCallFunc(CF_TestSave); - ACSVM::Word funcTimer = addCallFunc(CF_Timer); - - addCodeDataACS0( 86, {"", 0, funcEndPrint}); - addCodeDataACS0( 93, {"", 0, funcTimer}); - addCodeDataACS0(270, {"", 0, funcEndPrint}); - - addFuncDataACS0(0x10000, funcTestSave); - addFuncDataACS0(0x10001, funcCollectStrings); - addFuncDataACS0(0x10002, funcDumpLocals); - addFuncDataACS0(0x10003, funcExit); - - addFuncDataACS0(0x10100, addCallFunc(ACSVM::CF_AddF_W1)); - addFuncDataACS0(0x10101, addCallFunc(ACSVM::CF_DivF_W1)); - addFuncDataACS0(0x10102, addCallFunc(ACSVM::CF_MulF_W1)); - addFuncDataACS0(0x10103, addCallFunc(ACSVM::CF_SubF_W1)); - addFuncDataACS0(0x10104, addCallFunc(ACSVM::CF_AddF_W2)); - addFuncDataACS0(0x10105, addCallFunc(ACSVM::CF_DivF_W2)); - addFuncDataACS0(0x10106, addCallFunc(ACSVM::CF_MulF_W2)); - addFuncDataACS0(0x10107, addCallFunc(ACSVM::CF_SubF_W2)); - addFuncDataACS0(0x10108, addCallFunc(ACSVM::CF_PrintFloat)); - addFuncDataACS0(0x10109, addCallFunc(ACSVM::CF_PrintDouble)); -} - -// -// Environment::loadModule -// -void Environment::loadModule(ACSVM::Module *module) -{ - std::ifstream in{module->name.s->str, std::ios_base::in | std::ios_base::binary}; - - if(!in) throw ACSVM::ReadError("file open failure"); - - std::vector data; - - for(int c; c = in.get(), in;) - data.push_back(c); - - module->readBytecode(data.data(), data.size()); -} - -// -// main -// -int main(int argc, char *argv[]) -{ - Environment env; - - // Load modules. - try - { - LoadModules(env, argv, argc); - } - catch(ACSVM::ReadError &e) - { - std::cerr << "Error loading modules: " << e.what() << std::endl; - return EXIT_FAILURE; - } - - // Execute until all threads terminate. - while(!NeedExit && env.hasActiveThread()) - { - std::chrono::duration rate{1.0 / 35}; - auto time = std::chrono::steady_clock::now() + rate; - - env.exec(); - - if(NeedTestSaveEnv) - { - std::stringstream buf; - - { - ACSVM::Serial out{static_cast(buf)}; - out.signs = true; - out.saveHead(); - env.saveState(out); - out.saveTail(); - } - - { - ACSVM::Serial in{static_cast(buf)}; - in.loadHead(); - env.loadState(in); - in.loadTail(); - } - - NeedTestSaveEnv = false; - } - - std::this_thread::sleep_until(time); - } -} - -// EOF - diff --git a/libs/ACSVM/include/Exec/main_execc.c b/libs/ACSVM/include/Exec/main_execc.c deleted file mode 100644 index ccd8c9533..000000000 --- a/libs/ACSVM/include/Exec/main_execc.c +++ /dev/null @@ -1,231 +0,0 @@ -//---------------------------------------------------------------------------- -// -// Copyright (C) 2015-2017 David Hill -// -// See COPYING for license information. -// -//---------------------------------------------------------------------------- -// -// Program entry point. -// -//---------------------------------------------------------------------------- - -#include "CAPI/BinaryIO.h" -#include "CAPI/Environment.h" -#include "CAPI/Module.h" -#include "CAPI/PrintBuf.h" -#include "CAPI/Scope.h" -#include "CAPI/ACS_String.h" -#include "CAPI/Thread.h" - -#include -#include -#include -#include - - -//----------------------------------------------------------------------------| -// Static Objects | -// - -static ACSVM_Word ExecTime = 0; - - -//----------------------------------------------------------------------------| -// Static Functions | -// - -// -// CF_EndPrint -// -static bool CF_EndPrint(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) -{ - (void)argV; (void)argC; - - ACSVM_PrintBuf *buf = ACSVM_Thread_GetPrintBuf(thread); - - printf("%s\n", ACSVM_PrintBuf_GetData(buf)); - ACSVM_PrintBuf_Drop(buf); - - return false; -} - -// -// CF_Timer -// -static bool CF_Timer(ACSVM_Thread *thread, ACSVM_Word const *argV, ACSVM_Word argC) -{ - (void)argV; (void)argC; - - ACSVM_Thread_DataStk_Push(thread, ExecTime); - return false; -} - -// -// Environment_BadAlloc -// -static void Environment_BadAlloc(ACSVM_Environment *env, char const *what) -{ - (void)env; - - fprintf(stderr, "bad_alloc: %s\n", what); - exit(EXIT_FAILURE); -} - -// -// Environment_Construct -// -static void Environment_Construct(ACSVM_Environment *env) -{ - ACSVM_Word funcEndPrint = ACSVM_Environment_AddCallFunc(env, CF_EndPrint); - ACSVM_Word funcTimer = ACSVM_Environment_AddCallFunc(env, CF_Timer); - - ACSVM_Environment_AddCodeDataACS0(env, 86, "", ACSVM_Code_CallFunc, 0, funcEndPrint); - ACSVM_Environment_AddCodeDataACS0(env, 93, "", ACSVM_Code_CallFunc, 0, funcTimer); - ACSVM_Environment_AddCodeDataACS0(env, 270, "", ACSVM_Code_CallFunc, 0, funcEndPrint); -} - -// -// Environment_LoadModule -// -static bool Environment_LoadModule(ACSVM_Environment *env, ACSVM_Module *module) -{ - (void)env; - - ACSVM_ModuleName name = ACSVM_Module_GetName(module); - - FILE *stream = fopen(ACSVM_String_GetStr(name.s), "rb"); - if(!stream) - { - fprintf(stderr, "failed to fopen: %s\n", strerror(errno)); - exit(EXIT_FAILURE); - } - - ACSVM_Byte *data = NULL; - size_t size = 0; - size_t alloc = 0; - - for(int c; (c = fgetc(stream)) != EOF;) - { - if(size == alloc) - { - alloc = alloc + alloc / 2 + 256; - data = realloc(data, alloc); - if(!data) - { - fprintf(stderr, "failed to allocate %zu\n", alloc); - exit(EXIT_FAILURE); - } - } - - data[size++] = c; - } - - fclose(stream); - - bool res = ACSVM_Module_ReadBytecode(module, data, size); - - free(data); - - return res; -} - -// -// Environment_ReadError -// -static void Environment_ReadError(ACSVM_Environment *env, char const *what) -{ - (void)env; - - fprintf(stderr, "ReadError: %s\n", what); - exit(EXIT_FAILURE); -} - -// -// LoadModules -// -static void LoadModules(ACSVM_Environment *env, char **argv, int argc) -{ - ACSVM_StringTable *strTab = ACSVM_Environment_GetStringTable(env); - - // Create and activate scopes. - ACSVM_GlobalScope *global = ACSVM_Environment_GetGlobalScope(env, 0); - ACSVM_GlobalScope_SetActive(global, true); - ACSVM_HubScope *hub = ACSVM_GlobalScope_GetHubScope(global, 0); - ACSVM_HubScope_SetActive(hub, true); - ACSVM_MapScope *map = ACSVM_HubScope_GetMapScope(hub, 0); - ACSVM_MapScope_SetActive(map, true); - - // Load modules. - - size_t moduleC = argc - 1; - ACSVM_Module **moduleV = malloc(sizeof(ACSVM_Module *) * moduleC); - if(!moduleV) - { - fprintf(stderr, "failed to alloc moduleV[%zu]\n", moduleC); - exit(EXIT_FAILURE); - } - - for(int argi = 1; argi < argc; ++argi) - { - char const *arg = argv[argi]; - size_t len = strlen(arg); - size_t hash = ACSVM_StrHash(arg, len); - ACSVM_ModuleName name = - {ACSVM_StringTable_GetStringByData(strTab, arg, len, hash), NULL, 0}; - - moduleV[argi - 1] = ACSVM_Environment_GetModule(env, name); - } - - // Register modules with map scope. - ACSVM_MapScope_AddModules(map, moduleV, moduleC); - - // Start Open scripts. - ACSVM_MapScope_ScriptStartType(map, 1, NULL, 0, NULL, NULL); -} - - -//----------------------------------------------------------------------------| -// Extern Functions | -// - -// -// main -// -int main(int argc, char *argv[]) -{ - ACSVM_Environment *env = ACSVM_AllocEnvironment( - &(ACSVM_EnvironmentFuncs) - { - .bad_alloc = Environment_BadAlloc, - .readError = Environment_ReadError, - - .ctor = Environment_Construct, - - .loadModule = Environment_LoadModule, - }, - NULL); - - if(!env) - { - fprintf(stderr, "failed to allocate environment\n"); - return EXIT_FAILURE; - } - - LoadModules(env, argv, argc); - - while(ACSVM_Environment_HasActiveThread(env)) - { - ++ExecTime; - ACSVM_Environment_Exec(env); - - // TODO: Sleep. - } - - ACSVM_FreeEnvironment(env); - - return EXIT_SUCCESS; -} - -// EOF - diff --git a/libs/ACSVM/include/doc/ACSVM.txt b/libs/ACSVM/include/doc/ACSVM.txt deleted file mode 100644 index 17837859b..000000000 --- a/libs/ACSVM/include/doc/ACSVM.txt +++ /dev/null @@ -1,1212 +0,0 @@ -############################################################################### -ACSVM Library Specification -############################################################################### - -=============================================================================== -Types -=============================================================================== - -Synopsis: - using Byte = unsigned char; - - using DWord = std::uint64_t; - using SDWord = std::int64_t; - using SWord = std::int32_t; - using Word = std::uint32_t; - - using CallFunc = bool (*)(Thread *thread, Word const *argv, Word argc); - -=============================================================================== -Deferred Actions -=============================================================================== - -=========================================================== -ACSVM::ScopeID -=========================================================== - -Synopsis: - #include - class ScopeID - { - public: - ScopeID() = default; - ScopeID(Word global, Word hub, Word map); - - bool operator == (ScopeID const &id) const; - bool operator != (ScopeID const &id) const; - - Word global; - Word hub; - Word map; - }; - -=============================================================================== -Arrays -=============================================================================== - -=========================================================== -ACSVM::Array -=========================================================== - -Synopsis: - #include - class Array - { - public: - Array(); - Array(Array const &) = delete; - Array(Array &&array); - ~Array(); - - Word &operator [] (Word idx); - - void clear(); - - Word find(Word idx) const; - - void lockStrings(Environment *env) const; - - void unlockStrings(Environment *env) const; - }; - -=============================================================================== -Codes -=============================================================================== - -=========================================================== -ACSVM::Code -=========================================================== - -Synopsis: - #include - enum class Code - { - /* ... */ - None - }; - -=========================================================== -ACSVM::Func -=========================================================== - -Synopsis: - #include - enum class Func - { - /* ... */ - None - }; - -=========================================================== -ACSVM::KillType -=========================================================== - -Synopsis: - #include - enum class KillType - { - None, - OutOfBounds, - UnknownCode, - UnknownFunc, - BranchLimit, - }; - -=============================================================================== -Code Data -=============================================================================== - -=========================================================== -ACSVM::CodeDataACS0 -=========================================================== - -Synopsis: - #include - class CodeDataACS0 - { - public: - CodeDataACS0(char const *args, Code transCode, Word stackArgC, - Word transFunc = 0); - CodeDataACS0(char const *args, Word stackArgC, Word transFunc); - - char const *args; - std::size_t argc; - - Word stackArgC; - - Code transCode; - - Word transFunc; - }; - -=========================================================== -ACSVM::FuncDataACS0 -=========================================================== - -Synopsis: - #include - class FuncDataACS0 - { - public: - using TransCode = std::pair; - - - FuncDataACS0(FuncDataACS0 const &data); - FuncDataACS0(FuncDataACS0 &&data); - FuncDataACS0(Word transFunc); - FuncDataACS0(Word transFunc, std::initializer_list transCodes); - ~FuncDataACS0(); - - FuncDataACS0 &operator = (FuncDataACS0 const &) = delete; - FuncDataACS0 &operator = (FuncDataACS0 &&data); - - Word transFunc; - }; - -=============================================================================== -Environment -=============================================================================== - -=========================================================== -ACSVM::Environment -=========================================================== - -Synopsis: - #include - class Environment - { - public: - Environment(); - virtual ~Environment(); - - Word addCallFunc(CallFunc func); - - void addCodeDataACS0(Word code, CodeDataACS0 &&data); - - void addFuncDataACS0(Word func, FuncDataACS0 &&data); - - virtual bool checkLock(Thread *thread, Word lock, bool door); - - virtual bool checkTag(Word type, Word tag); - - void collectStrings(); - - virtual void exec(); - - void freeGlobalScope(GlobalScope *scope); - - void freeModule(Module *module); - - GlobalScope *getGlobalScope(Word id); - - Module *getModule(ModuleName const &name); - - ModuleName getModuleName(char const *str); - virtual ModuleName getModuleName(char const *str, std::size_t len); - - String *getString(Word idx); - String *getString(char const *first, char const *last); - String *getString(char const *str); - String *getString(char const *str, std::size_t len); - String *getString(StringData const *data); - - bool hasActiveThread() const; - - virtual void loadState(Serial &in); - - virtual void printArray(PrintBuf &buf, Array const &array, Word index, - Word limit); - - virtual void printKill(Thread *thread, Word type, Word data); - - virtual ModuleName readModuleName(Serial &in) const; - - String *readString(Serial &in) const; - - virtual void refStrings(); - - virtual void resetStrings(); - - virtual void saveState(Serial &out) const; - - virtual void writeModuleName(Serial &out, ModuleName const &name) const; - - void writeString(Serial &out, String const *in) const; - - StringTable stringTable; - - Word scriptLocRegC; - - - static void PrintArrayChar(PrintBuf &buf, Array const &array, Word index, - Word limit); - - static void PrintArrayUTF8(PrintBuf &buf, Array const &array, Word index, - Word limit); - - static constexpr Word ScriptLocRegCDefault; - - protected: - virtual Thread *allocThread(); - - virtual Word callSpecImpl(Thread *thread, Word spec, Word const *argV, - Word argC); - - virtual void loadModule(Module *module) = 0; - }; - -Description: - Represents an execution environment. - ------------------------------------------------------------ -ACSVM::Environment::Environment ------------------------------------------------------------ - -Synopsis: - Environment(); - -Description: - Constructs the Environment object. - ------------------------------------------------------------ -ACSVM::Environment::~Environment ------------------------------------------------------------ - -Synopsis: - ~Environment(); - -Description: - Destructs the Environment object. - ------------------------------------------------------------ -ACSVM::Environment::addCallFunc ------------------------------------------------------------ - -Synopsis: - Word addCallFunc(CallFunc func); - -Description: - Adds a function callback for scripts and returns its index. - -Returns: - Added function's index. - ------------------------------------------------------------ -ACSVM::Environment::addCodeDataACS0 ------------------------------------------------------------ - -Synopsis: - void addCodeDataACS0(Word code, CodeDataACS0 &&data); - -Description: - Adds a translation from instruction code for ACS0 and derived bytecode. - ------------------------------------------------------------ -ACSVM::Environment::addFuncDataACS0 ------------------------------------------------------------ - -Synopsis: - void addFuncDataACS0(Word func, FuncDataACS0 &&data); - -Description: - Adds a translation from callfunc func for ACS0 and derived bytecode. - ------------------------------------------------------------ -ACSVM::Environment::checkLock ------------------------------------------------------------ - -Synopsis: - virtual bool checkLock(Thread *thread, Word lock, bool door); - -Description: - Called to check if a given lock number can be used from a given thread. The - lock number has no internal semantics, and is passed from the user source - unaltered. - - The base implementation always return false. - -Returns: - True if the lock is open for that thread, false otherwise. - ------------------------------------------------------------ -ACSVM::Environment::checkTag ------------------------------------------------------------ - -Synopsis: - virtual bool checkTag(Word type, Word tag); - -Description: - Called to check if a given tag is inactive. The tag type and number both have - no internal semantics, and are passed from the user source unaltered. - - The base implementation always returns false. - -Returns: - True if the tag is inactive, false otherwise. - ------------------------------------------------------------ -ACSVM::Environment::collectStrings ------------------------------------------------------------ - -Synopsis: - void collectStrings(); - -Description: - Performs a full scan of the environment and frees strings that are no longer - in use. - ------------------------------------------------------------ -ACSVM::Environment::exec ------------------------------------------------------------ - -Synopsis: - virtual void exec(); - -Description: - Performs a single execution cycle. Deferred script actions will be applied, - and active threads will execute until they terminate or enter a wait state. - ------------------------------------------------------------ -ACSVM::Environment::freeGlobalScope ------------------------------------------------------------ - -Synopsis: - void freeGlobalScope(GlobalScope *scope); - -Description: - Destructs and deallocates a contained GlobalScope object. - ------------------------------------------------------------ -ACSVM::Environment::freeModule ------------------------------------------------------------ - -Synopsis: - void freeModule(Module *module); - -Description: - Destructs and deallocates a contained Module object. - - If any other modules reference the freed module, they must also be freed. - ------------------------------------------------------------ -ACSVM::Environment::getGlobalScope ------------------------------------------------------------ - -Synopsis: - GlobalScope *getGlobalScope(Word id); - -Description: - Retrieves a GlobalScope object by its identifier number. If it does not - exist, it will be created. - -Returns: - GlobalScope object with given id. - ------------------------------------------------------------ -ACSVM::Environment::getModule ------------------------------------------------------------ - -Synopsis: - Module *getModule(ModuleName const &name); - -Description: - Retrieves a Module object by name. If it does not exist or is not loaded, it - will be created and loaded as needed. - -Returns: - Module object with given name. - ------------------------------------------------------------ -ACSVM::Environment::getModuleName ------------------------------------------------------------ - -Synopsis: - ModuleName getModuleName(char const *str); - virtual ModuleName getModuleName(char const *str, std::size_t len); - -Description: - Generates a ModuleName from an input string. The first form calls the second, - using the null-terminated length of the input string. - - The base implementation converts the input string into a String object for - ModuleName::s, leaving the other ModuleName fields set to 0. - -Returns: - ModuleName object formed from input string. - ------------------------------------------------------------ -ACSVM::Environment::getScriptType ------------------------------------------------------------ - -Synopsis: - virtual std::pair getScriptTypeACS0(Word name); - virtual Word getScriptTypeACSE(Word type); - -Description: - Translates a bytecode script type into an internal type. - - First form takes the script number and must return the type and name. - - The base implementation of the first form translates by dividing by 1000. The - second form returns the type unaltered. - -Returns: - Translated script type or (type, name) pair. - ------------------------------------------------------------ -ACSVM::Environment::getString ------------------------------------------------------------ - -Synopsis: - String *getString(Word idx); - String *getString(char const *first, char const *last); - String *getString(char const *str); - String *getString(char const *str, std::size_t len); - String *getString(StringData const *data); - -Description: - First form returns a String object as if by calling (&stringTable[~idx]). - - Second, third, and fourth forms create a StringData from input to find or - create an entry in stringTable. - - Fifth form uses the supplied StringData object to find or create an entry in - stringTable. If data is null, null is returned. This is intended primarily - for resetting strings after deserialization. - -Returns: - First form returns the String object with the given index. All other forms - return a String object with the same data as the input. - - Fifth form will return null if input is null, and non-null otherwise. All - other forms never return null. - ------------------------------------------------------------ -ACSVM::Environment::hasActiveThread ------------------------------------------------------------ - -Synopsis: - bool hasActiveThread() const; - -Description: - Checks for any active threads. A thread is considered active if it has any - state other than ThreadState::Inactive. So this will include threads that are - delayed, waiting for a condition (script or tag), or set to stop during the - next execution cycle. - -Returns: - True if there are any active threads, false otherwise. - ------------------------------------------------------------ -ACSVM::Environment::loadState ------------------------------------------------------------ - -Synopsis: - virtual void loadState(Serial &in); - -Description: - Restores the environment state from a previously serialized instance. If in - does not contain a byte stream generated by a previous call to saveState, the - behavior is undefined. - ------------------------------------------------------------ -ACSVM::Environment::printArray ------------------------------------------------------------ - -Synopsis: - virtual void printArray(PrintBuf &buf, Array const &array, Word index, - Word limit); - -Description: - Called to write a null-terminated character subsequence from an Array object - to a print buffer. - - The base implementation calls PrintArrayChar. - ------------------------------------------------------------ -ACSVM::Environment::printKill ------------------------------------------------------------ - -Synopsis: - virtual void printKill(Thread *thread, Word type, Word data); - -Description: - Called when a thread encounters an error and must terminate. This includes - executing Code::Kill or calling Func::Kill. When calling by ACSVM itself, the - type parameter has a value from the KillType enumeration. - - This function is expected to return normally, and the caller will handle - thread termination. - - The base implementation prints kill information to std::cerr. - ------------------------------------------------------------ -ACSVM::Environment::readModuleName ------------------------------------------------------------ - -Synopsis: - virtual ModuleName readModuleName(Serial &in) const; - -Description: - Called to read a ModuleName from a serialized environment. - - The base implementation reads the s and i members, leaving the p member null. - -Returns: - Deserialized ModuleName. - ------------------------------------------------------------ -ACSVM::Environment::readString ------------------------------------------------------------ - -Synopsis: - String *readString(Serial &in) const; - -Description: - Reads a String by index from a serialized Environment. If the written String - pointer was null, this function returns a null pointer. - -Returns: - Deserialized String. - ------------------------------------------------------------ -ACSVM::Environment::refStrings ------------------------------------------------------------ - -Synopsis: - virtual void refStrings(); - -Description: - Called by collectStrings to mark contained strings as referenced. - - The base implementation marks strings of all contained objects, as well as - performs an exhaustive scan of VM memory for string indexes. - ------------------------------------------------------------ -ACSVM::Environment::resetStrings ------------------------------------------------------------ - -Synopsis: - virtual void resetStrings(); - -Description: - Called by loadState after reading the new StringTable to reset any String - pointers to the corresponding entry in the read table. - - The base implementation resets strings of all contained objects. - ------------------------------------------------------------ -ACSVM::Environment::saveState ------------------------------------------------------------ - -Synopsis: - virtual void saveState(Serial &out) const; - -Description: - Serializes the environment state, which can be restored with a call to - loadState. - ------------------------------------------------------------ -ACSVM::Environment::writeModuleName ------------------------------------------------------------ - -Synopsis: - virtual void writeModuleName(Serial &out, - ModuleName const &name) const; - -Description: - Called to write a ModuleName. - - The base implementation writes the s and i members. - ------------------------------------------------------------ -ACSVM::Environment::writeString ------------------------------------------------------------ - -Synopsis: - void writeString(Serial &out, String const *in) const; - -Description: - Writes a String by index. If in is null, a null pointer will be returned by - the corresponding call to readString. - -=============================================================================== -Errors -=============================================================================== - -=========================================================== -ACSVM::ReadError -=========================================================== - -Synopsis: - #include - class ReadError : public std::exception - { - public: - ReadError(char const *msg = "ACSVM::ReadError"); - - virtual char const *what() const noexcept; - }; - -=============================================================================== -Modules -=============================================================================== - -=========================================================== -ACSVM::ModuleName -=========================================================== - -Synopsis: - #include - class ModuleName - { - public: - ModuleName(String *s, void *p, std::size_t i); - - bool operator == (ModuleName const &name) const; - bool operator != (ModuleName const &name) const; - - std::size_t hash() const; - - String *s; - void *p; - std::size_t i; - }; - -=========================================================== -ACSVM::Module -=========================================================== - -Synopsis: - #include - class Module - { - public: - void readBytecode(Byte const *data, std::size_t size); - - Environment *env; - ModuleName name; - - bool isACS0; - bool loaded; - - - static constexpr std::uint32_t ChunkID(char c0, char c1, char c2, char c3); - - static constexpr std::uint32_t ChunkID(char const (&s)[5]); - }; - -=============================================================================== -Print Buffers -=============================================================================== - -=========================================================== -ACSVM::PrintBuf -=========================================================== - -Synopsis: - #include - class PrintBuf - { - public: - PrintBuf(); - ~PrintBuf(); - - void clear(); - - char const *data() const; - char const *dataFull() const; - - void drop(); - - void format(char const *fmt, ...); - void formatv(char const *fmt, std::va_list arg); - - char *getBuf(std::size_t count); - - char *getLoadBuf(std::size_t countFull, std::size_t count); - - void push(); - - void put(char c); - void put(char const *s); - void put(char const *s, std::size_t n); - - void reserve(std::size_t count); - - std::size_t size() const; - std::size_t sizeFull() const; - }; - -=============================================================================== -Scopes -=============================================================================== - -=========================================================== -ACSVM::GlobalScope -=========================================================== - -Synopsis: - #include - class GlobalScope - { - public: - static constexpr std::size_t ArrC = 256; - static constexpr std::size_t RegC = 256; - - - void freeHubScope(HubScope *scope); - - HubScope *getHubScope(Word id); - - bool hasActiveThread() const; - - void lockStrings() const; - - void reset(); - - void unlockStrings() const; - - Environment *const env; - Word const id; - - Array arrV[ArrC]; - Word regV[RegC]; - - bool active; - }; - -=========================================================== -ACSVM::HubScope -=========================================================== - -Synopsis: - #include - class HubScope - { - public: - static constexpr std::size_t ArrC = 256; - static constexpr std::size_t RegC = 256; - - - void freeMapScope(MapScope *scope); - - MapScope *getMapScope(Word id); - - bool hasActiveThread() const; - - void lockStrings() const; - - void reset(); - - void unlockStrings() const; - - Environment *const env; - GlobalScope *const global; - Word const id; - - Array arrV[ArrC]; - Word regV[RegC]; - - bool active; - }; - -=========================================================== -ACSVM::MapScope -=========================================================== - -Synopsis: - #include - class MapScope - { - public: - using ScriptStartFunc = void (*)(Thread *); - using ScriptStartFuncC = MapScope_ScriptStartFuncC; - - class ScriptStartInfo; - - - void addModules(Module *const *moduleV, std::size_t moduleC); - - Script *findScript(ScriptName name); - - ModuleScope *getModuleScope(Module *module); - - String *getString(Word idx) const; - - bool hasActiveThread() const; - - bool hasModules() const; - - bool isScriptActive(Script *script); - - void loadState(Serial &in); - - void lockStrings() const; - - void reset(); - - void saveState(Serial &out) const; - - bool scriptPause(Script *script); - bool scriptPause(ScriptName name, ScopeID scope); - bool scriptStart(Script *script, ScriptStartInfo const &info); - bool scriptStart(ScriptName name, ScopeID scope, - ScriptStartInfo const &info); - bool scriptStartForced(Script *script, ScriptStartInfo const &info); - bool scriptStartForced(ScriptName name, ScopeID scope, - ScriptStartInfo const &info); - Word scriptStartResult(Script *script, ScriptStartInfo const &info); - Word scriptStartResult(ScriptName name, ScriptStartInfo const &info); - Word scriptStartType(Word type, ScriptStartInfo const &info); - Word scriptStartTypeForced(Word type, ScriptStartInfo const &info); - bool scriptStop(Script *script); - bool scriptStop(ScriptName name, ScopeID scope); - - void unlockStrings() const; - - Environment *const env; - HubScope *const hub; - Word const id; - - bool active; - bool clampCallSpec; - }; - -=========================================================== -ACSVM::MapScope::ScriptStartInfo -=========================================================== - -Synopsis: - #include - class ScriptStartInfo - { - public: - ScriptStartInfo(); - ScriptStartInfo(Word const *argV, std::size_t argC, - ThreadInfo const *info = nullptr, ScriptStartFunc func = nullptr); - ScriptStartInfo(Word const *argV, std::size_t argC, - ThreadInfo const *info, ScriptStartFuncC func); - - Word const *argV; - ScriptStartFunc func; - ScriptStartFuncC funcc; - ThreadInfo const *info; - std::size_t argC; - }; - -=========================================================== -ACSVM::ModuleScope -=========================================================== - -Synopsis: - #include - class ModuleScope - { - public: - static constexpr std::size_t ArrC = 256; - static constexpr std::size_t RegC = 256; - - - void lockStrings() const; - - void unlockStrings() const; - - Environment *const env; - MapScope *const map; - Module *const module; - - Array *arrV[ArrC]; - Word *regV[RegC]; - }; - -=============================================================================== -Scripts -=============================================================================== - -=========================================================== -ACSVM::ScriptName -=========================================================== - -Synopsis: - #include - class ScriptName - { - public: - ScriptName(); - ScriptName(String *s); - ScriptName(String *s, Word i); - ScriptName(Word i); - - String *s; - Word i; - }; - -=========================================================== -ACSVM::Script -=========================================================== - -Synopsis: - #include - class Script - { - public: - explicit Script(Module *module); - ~Script(); - - Module *const module; - - ScriptName name; - - Word argC; - Word codeIdx; - Word flags; - Word locArrC; - Word locRegC; - Word type; - - bool flagClient : 1; - bool flagNet : 1; - }; - -=============================================================================== -Stacks -=============================================================================== - -=========================================================== -ACSVM::Stack -=========================================================== - -Synopsis: - #include - template - class Stack - { - public: - Stack(); - ~Stack(); - - T &operator [] (std::size_t idx); - - T *begin(); - T const *begin() const; - - void clear(); - - void drop(); - void drop(std::size_t n); - - bool empty() const; - - T *end(); - T const *end() const; - - void push(T const &value); - void push(T &&value); - - void reserve(std::size_t count); - - std::size_t size() const; - }; - -=============================================================================== -Locals Storage -=============================================================================== - -=========================================================== -ACSVM::Store -=========================================================== - -Synopsis: - #include - template - class Store - { - public: - Store(); - ~Store(); - - T &operator [] (std::size_t idx); - - void alloc(std::size_t count); - - void allocLoad(std::size_t countFull, std::size_t count); - - T *begin(); - T const *begin() const; - - T *beginFull(); - T const *beginFull() const; - - void clear(); - - T const *dataFull() const; - - T *end(); - T const *end() const; - - void free(std::size_t count); - - std::size_t size() const; - - std::size_t sizeFull() const; - }; - -=============================================================================== -Strings -=============================================================================== - -=========================================================== -ACSVM::StringData -=========================================================== - -Synopsis: - #include - class StringData - { - public: - StringData(char const *first, char const *last); - StringData(char const *str, std::size_t len); - StringData(char const *str, std::size_t len, std::size_t hash); - - bool operator == (StringData const &r) const; - - char const *const str; - std::size_t const len; - std::size_t const hash; - }; - -=========================================================== -ACSVM::String -=========================================================== - -Synopsis: - #include - class String : public StringData - { - public: - std::size_t lock; - - Word const idx; - Word const len0; - - bool ref; - - char get(std::size_t i) const; - }; - -=========================================================== -ACSVM::StringTable -=========================================================== - -Synopsis: - #include - class StringTable - { - public: - StringTable(); - StringTable(StringTable &&table); - ~StringTable(); - - String &operator [] (Word idx) const; - String &operator [] (StringData const &data); - - void clear(); - - void collectBegin(); - void collectEnd(); - - String &getNone(); - - std::size_t size() const; - }; - -=============================================================================== -Threads -=============================================================================== - -=========================================================== -ACSVM::ThreadState -=========================================================== - -Synopsis: - #include - class ThreadState - { - public: - enum State - { - Inactive, - Running, - Stopped, - Paused, - WaitScrI, - WaitScrS, - WaitTag, - }; - - - ThreadState(); - ThreadState(State state); - ThreadState(State state, Word data); - ThreadState(State state, Word data, Word type); - - bool operator == (State s) const; - bool operator != (State s) const; - - State state; - Word data; - Word type; - }; - -=========================================================== -ACSVM::ThreadInfo -=========================================================== - -Synopsis: - #include - class ThreadInfo - { - public: - virtual ~ThreadInfo() {} - }; - -=========================================================== -ACSVM::Thread -=========================================================== - -Synopsis: - #include - class Thread - { - public: - virtual ThreadInfo const *getInfo() const; - - virtual void lockStrings() const; - - virtual void unlockStrings() const; - - Environment *const env; - - Stack callStk; - Stack dataStk; - Store localArr; - Store localReg; - PrintBuf printBuf; - ThreadState state; - - Word const *codePtr; - Module *module; - GlobalScope *scopeGbl; - HubScope *scopeHub; - MapScope *scopeMap; - ModuleScope *scopeMod; - Script *script; - Word delay; - Word result; - }; - -############################################################################### -EOF -############################################################################### - diff --git a/libs/ACSVM/lib/libacsvm-capi.dll.a b/libs/ACSVM/lib/libacsvm-capi.dll.a deleted file mode 100644 index e76867d99ecc92087d8835494fc2f7839430d041..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 316702 zcmeFa51b`ORWIIqcOfx9Pp3a~y6<$Is;;X3)~QqHR8?Pdb7wez?v^WV+M7IF>0kC+KJVRIZq#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