aboutsummaryrefslogtreecommitdiff
path: root/primedev/vscript/languages/squirrel_re/include/squirrel.h
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2024-09-20 14:24:56 +0200
committerGitHub <noreply@github.com>2024-09-20 14:24:56 +0200
commita4b09bc42d5f79ef86697c893efc9e3b7d966502 (patch)
treed4c7b2b8cc04361ddf7b9c942e5f9462bb55e0b9 /primedev/vscript/languages/squirrel_re/include/squirrel.h
parenta9d2ce8a692f7890f4e4bfc21458332890605a5f (diff)
parent6737a344c012c0f7fd19cd593949dd3dbe5a0cb7 (diff)
downloadNorthstarLauncher-a4b09bc42d5f79ef86697c893efc9e3b7d966502.tar.gz
NorthstarLauncher-a4b09bc42d5f79ef86697c893efc9e3b7d966502.zip
Merge branch 'main' into feat/overhaul-mod-loading-locations
Diffstat (limited to 'primedev/vscript/languages/squirrel_re/include/squirrel.h')
-rw-r--r--primedev/vscript/languages/squirrel_re/include/squirrel.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/primedev/vscript/languages/squirrel_re/include/squirrel.h b/primedev/vscript/languages/squirrel_re/include/squirrel.h
new file mode 100644
index 00000000..b068ff06
--- /dev/null
+++ b/primedev/vscript/languages/squirrel_re/include/squirrel.h
@@ -0,0 +1,95 @@
+#pragma once
+
+class Mod;
+struct SQBufferState;
+class CBaseEntity;
+
+struct SQVM;
+struct SQObject;
+struct SQTable;
+struct SQArray;
+struct SQString;
+struct SQClosure;
+struct SQFunctionProto;
+struct SQStructDef;
+struct SQNativeClosure;
+struct SQStructInstance;
+struct SQUserData;
+struct SQSharedState;
+
+typedef float SQFloat;
+typedef long SQInteger;
+typedef unsigned long SQUnsignedInteger;
+typedef char SQChar;
+typedef SQUnsignedInteger SQBool;
+
+typedef SQVM* HSQUIRRELVM;
+
+enum SQRESULT : SQInteger
+{
+ SQRESULT_ERROR = -1,
+ SQRESULT_NULL = 0,
+ SQRESULT_NOTNULL = 1,
+};
+
+enum class eSQReturnType
+{
+ Float = 0x1,
+ Vector = 0x3,
+ Integer = 0x5,
+ Boolean = 0x6,
+ Entity = 0xD,
+ String = 0x21,
+ Default = 0x20,
+ Arrays = 0x25,
+ Asset = 0x28,
+ Table = 0x26,
+};
+
+struct SQBufferState
+{
+ const SQChar* buffer;
+ const SQChar* bufferPlusLength;
+ const SQChar* bufferAgain;
+
+ SQBufferState(const SQChar* pszCode)
+ {
+ buffer = pszCode;
+ bufferPlusLength = pszCode + strlen(pszCode);
+ bufferAgain = pszCode;
+ }
+};
+
+typedef SQRESULT (*SQFunction)(HSQUIRRELVM sqvm);
+
+struct SQFuncRegistration
+{
+ const char* squirrelFuncName;
+ const char* cppFuncName;
+ const char* helpText;
+ const char* returnTypeString;
+ const char* argTypes;
+ uint32_t unknown1;
+ uint32_t devLevel;
+ const char* shortNameMaybe;
+ uint32_t unknown2;
+ eSQReturnType returnType;
+ uint32_t* externalBufferPointer;
+ uint64_t externalBufferSize;
+ uint64_t unknown3;
+ uint64_t unknown4;
+ SQFunction funcPtr;
+
+ SQFuncRegistration()
+ {
+ memset(this, 0, sizeof(SQFuncRegistration));
+ this->returnType = eSQReturnType::Default;
+ }
+};
+
+struct alignas(8) SQStackInfos
+{
+ char* _name;
+ char* _sourceName;
+ int _line;
+};