47 #ifdef AS_USE_NAMESPACE 48 #define BEGIN_AS_NAMESPACE namespace AngelScript { 49 #define END_AS_NAMESPACE } 50 #define AS_NAMESPACE_QUALIFIER AngelScript:: 52 #define BEGIN_AS_NAMESPACE 53 #define END_AS_NAMESPACE 54 #define AS_NAMESPACE_QUALIFIER :: 61 #define ANGELSCRIPT_VERSION 23500 62 #define ANGELSCRIPT_VERSION_STRING "2.35.0" 85 asCONTEXT_ACTIVE = -2,
86 asCONTEXT_NOT_FINISHED = -3,
87 asCONTEXT_NOT_PREPARED = -4,
93 asINVALID_DECLARATION = -10,
94 asINVALID_OBJECT = -11,
96 asALREADY_REGISTERED = -13,
97 asMULTIPLE_FUNCTIONS = -14,
99 asNO_GLOBAL_VAR = -16,
100 asINVALID_CONFIGURATION = -17,
101 asINVALID_INTERFACE = -18,
102 asCANT_BIND_ALL_FUNCTIONS = -19,
103 asLOWER_ARRAY_DIMENSION_NOT_REGISTERED = -20,
104 asWRONG_CONFIG_GROUP = -21,
105 asCONFIG_GROUP_IS_IN_USE = -22,
106 asILLEGAL_BEHAVIOUR_FOR_TYPE = -23,
107 asWRONG_CALLING_CONV = -24,
108 asBUILD_IN_PROGRESS = -25,
109 asINIT_GLOBAL_VARS_FAILED = -26,
110 asOUT_OF_MEMORY = -27,
111 asMODULE_IS_IN_USE = -28
116 asEP_ALLOW_UNSAFE_REFERENCES = 1,
117 asEP_OPTIMIZE_BYTECODE = 2,
118 asEP_COPY_SCRIPT_SECTIONS = 3,
119 asEP_MAX_STACK_SIZE = 4,
120 asEP_USE_CHARACTER_LITERALS = 5,
121 asEP_ALLOW_MULTILINE_STRINGS = 6,
122 asEP_ALLOW_IMPLICIT_HANDLE_TYPES = 7,
123 asEP_BUILD_WITHOUT_LINE_CUES = 8,
124 asEP_INIT_GLOBAL_VARS_AFTER_BUILD = 9,
125 asEP_REQUIRE_ENUM_SCOPE = 10,
126 asEP_SCRIPT_SCANNER = 11,
127 asEP_INCLUDE_JIT_INSTRUCTIONS = 12,
128 asEP_STRING_ENCODING = 13,
129 asEP_PROPERTY_ACCESSOR_MODE = 14,
130 asEP_EXPAND_DEF_ARRAY_TO_TMPL = 15,
131 asEP_AUTO_GARBAGE_COLLECT = 16,
132 asEP_DISALLOW_GLOBAL_VARS = 17,
133 asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT = 18,
134 asEP_COMPILER_WARNINGS = 19,
135 asEP_DISALLOW_VALUE_ASSIGN_FOR_REF_TYPE = 20,
136 asEP_ALTER_SYNTAX_NAMED_ARGS = 21,
137 asEP_DISABLE_INTEGER_DIVISION = 22,
138 asEP_DISALLOW_EMPTY_LIST_ELEMENTS = 23,
139 asEP_PRIVATE_PROP_AS_PROTECTED = 24,
140 asEP_ALLOW_UNICODE_IDENTIFIERS = 25,
141 asEP_HEREDOC_TRIM_MODE = 26,
142 asEP_MAX_NESTED_CALLS = 27,
143 asEP_GENERIC_CALL_MODE = 28,
144 asEP_INIT_STACK_SIZE = 29,
145 asEP_INIT_CALL_STACK_SIZE = 30,
146 asEP_MAX_CALL_STACK_SIZE = 31,
152 enum asECallConvTypes {
155 asCALL_THISCALL_ASGLOBAL = 2,
157 asCALL_CDECL_OBJLAST = 4,
158 asCALL_CDECL_OBJFIRST = 5,
160 asCALL_THISCALL_OBJLAST = 7,
161 asCALL_THISCALL_OBJFIRST = 8
165 enum asEObjTypeFlags :
unsigned int {
167 asOBJ_REF = (1 << 0),
168 asOBJ_VALUE = (1 << 1),
170 asOBJ_POD = (1 << 3),
171 asOBJ_NOHANDLE = (1 << 4),
172 asOBJ_SCOPED = (1 << 5),
173 asOBJ_TEMPLATE = (1 << 6),
174 asOBJ_ASHANDLE = (1 << 7),
175 asOBJ_APP_CLASS = (1 << 8),
176 asOBJ_APP_CLASS_CONSTRUCTOR = (1 << 9),
177 asOBJ_APP_CLASS_DESTRUCTOR = (1 << 10),
178 asOBJ_APP_CLASS_ASSIGNMENT = (1 << 11),
179 asOBJ_APP_CLASS_COPY_CONSTRUCTOR = (1 << 12),
180 asOBJ_APP_CLASS_C = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR),
181 asOBJ_APP_CLASS_CD = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_DESTRUCTOR),
182 asOBJ_APP_CLASS_CA = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT),
183 asOBJ_APP_CLASS_CK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
184 asOBJ_APP_CLASS_CDA = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT),
185 asOBJ_APP_CLASS_CDK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
186 asOBJ_APP_CLASS_CAK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
187 asOBJ_APP_CLASS_CDAK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_CONSTRUCTOR + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
188 asOBJ_APP_CLASS_D = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_DESTRUCTOR),
189 asOBJ_APP_CLASS_DA = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT),
190 asOBJ_APP_CLASS_DK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
191 asOBJ_APP_CLASS_DAK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_DESTRUCTOR + asOBJ_APP_CLASS_ASSIGNMENT + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
192 asOBJ_APP_CLASS_A = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_ASSIGNMENT),
193 asOBJ_APP_CLASS_AK = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_ASSIGNMENT + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
194 asOBJ_APP_CLASS_K = (asOBJ_APP_CLASS + asOBJ_APP_CLASS_COPY_CONSTRUCTOR),
195 asOBJ_APP_CLASS_MORE_CONSTRUCTORS = (1u << 31),
196 asOBJ_APP_PRIMITIVE = (1 << 13),
197 asOBJ_APP_FLOAT = (1 << 14),
198 asOBJ_APP_ARRAY = (1 << 15),
199 asOBJ_APP_CLASS_ALLINTS = (1 << 16),
200 asOBJ_APP_CLASS_ALLFLOATS = (1 << 17),
201 asOBJ_NOCOUNT = (1 << 18),
202 asOBJ_APP_CLASS_ALIGN8 = (1 << 19),
203 asOBJ_IMPLICIT_HANDLE = (1 << 20),
204 asOBJ_MASK_VALID_FLAGS = 0x801FFFFFu,
206 asOBJ_SCRIPT_OBJECT = (1 << 21),
207 asOBJ_SHARED = (1 << 22),
208 asOBJ_NOINHERIT = (1 << 23),
209 asOBJ_FUNCDEF = (1 << 24),
210 asOBJ_LIST_PATTERN = (1 << 25),
211 asOBJ_ENUM = (1 << 26),
212 asOBJ_TEMPLATE_SUBTYPE = (1 << 27),
213 asOBJ_TYPEDEF = (1 << 28),
214 asOBJ_ABSTRACT = (1 << 29),
215 asOBJ_APP_ALIGN16 = (1 << 30)
222 asBEHAVE_LIST_CONSTRUCT,
227 asBEHAVE_LIST_FACTORY,
230 asBEHAVE_GET_WEAKREF_FLAG,
233 asBEHAVE_TEMPLATE_CALLBACK,
237 asBEHAVE_GETREFCOUNT = asBEHAVE_FIRST_GC,
241 asBEHAVE_RELEASEREFS,
242 asBEHAVE_LAST_GC = asBEHAVE_RELEASEREFS,
248 enum asEContextState {
249 asEXECUTION_FINISHED = 0,
250 asEXECUTION_SUSPENDED = 1,
251 asEXECUTION_ABORTED = 2,
252 asEXECUTION_EXCEPTION = 3,
253 asEXECUTION_PREPARED = 4,
254 asEXECUTION_UNINITIALIZED = 5,
255 asEXECUTION_ACTIVE = 6,
256 asEXECUTION_ERROR = 7
262 asMSGTYPE_WARNING = 1,
263 asMSGTYPE_INFORMATION = 2
270 asGC_DESTROY_GARBAGE = 4,
271 asGC_DETECT_GARBAGE = 8
285 enum asETypeIdFlags {
297 asTYPEID_DOUBLE = 11,
298 asTYPEID_OBJHANDLE = 0x40000000,
299 asTYPEID_HANDLETOCONST = 0x20000000,
300 asTYPEID_MASK_OBJECT = 0x1C000000,
301 asTYPEID_APPOBJECT = 0x04000000,
302 asTYPEID_SCRIPTOBJECT = 0x08000000,
303 asTYPEID_TEMPLATE = 0x10000000,
304 asTYPEID_MASK_SEQNBR = 0x03FFFFFF
308 enum asETypeModifiers {
318 asGM_ONLY_IF_EXISTS = 0,
319 asGM_CREATE_IF_NOT_EXISTS = 1,
320 asGM_ALWAYS_CREATE = 2
324 enum asECompileFlags {
325 asCOMP_ADD_TO_MODULE = 1
333 asFUNC_INTERFACE = 2,
347 typedef signed char asINT8;
348 typedef signed short asINT16;
349 typedef unsigned char asBYTE;
350 typedef unsigned short asWORD;
351 typedef unsigned int asUINT;
352 #if (defined(_MSC_VER) && _MSC_VER <= 1200) || defined(__S3E__) || (defined(_MSC_VER) && defined(__clang__)) 356 typedef size_t asPWORD;
358 typedef uintptr_t asPWORD;
361 typedef unsigned int asDWORD;
362 typedef unsigned long asQWORD;
363 typedef long asINT64;
365 typedef unsigned long asDWORD;
366 #if !defined(_MSC_VER) && (defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_CC) || defined(__psp2__)) 367 typedef uint64_t asQWORD;
368 typedef int64_t asINT64;
370 typedef unsigned __int64 asQWORD;
371 typedef __int64 asINT64;
376 #if defined(__LP64__) || defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) 382 typedef void (*asFUNCTION_t)();
384 typedef void *(*asALLOCFUNC_t)(size_t);
385 typedef void (*asFREEFUNC_t)(
void *);
390 typedef void (*asCLEANTYPEINFOFUNC_t)(
asITypeInfo *);
393 typedef void (*asRETURNCONTEXTFUNC_t)(asIScriptEngine *,
asIScriptContext *,
void *);
394 typedef void (*asCIRCULARREFFUNC_t)(
asITypeInfo *,
const void *,
void *);
396 #if 0 // diasbled for compatibility 398 #if !defined(_MSC_VER) || _MSC_VER >= 1700 // MSVC 2012 399 #if !defined(__GNUC__) || defined(__clang__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) // gnuc 4.7 or clang 400 #if !(defined(__GNUC__) && defined(__cplusplus) && __cplusplus < 201103L) // gnuc and clang require compiler flag -std=c++11 401 #if !defined(__SUNPRO_CC) // Oracle Solaris Studio 402 #define AS_CAN_USE_CPP11 1 411 #define asOFFSET(s,m) ((int)(size_t)(&reinterpret_cast<s*>(100000)->m)-100000) 413 #define asFUNCTION(f) asFunctionPtr(f) 414 #if (defined(_MSC_VER) && _MSC_VER <= 1200) || (defined(__BORLANDC__) && __BORLANDC__ < 0x590) 419 #define asFUNCTIONPR(f,p,r) asFunctionPtr((void (*)())((r (*)p)(f))) 421 #define asFUNCTIONPR(f,p,r) asFunctionPtr(reinterpret_cast<void (*)()>(static_cast<r (*)p>(f))) 424 #ifndef AS_NO_CLASS_METHODS 426 class asCUnknownClass;
427 typedef void (asCUnknownClass::*asMETHOD_t)();
431 for (
size_t n = 0; n <
sizeof(ptr.dummy); n++)
436 void CopyMethodPtr(
const void *mthdPtr,
size_t size) {
437 for (
size_t n = 0; n < size; n++)
438 ptr.dummy[n] = reinterpret_cast<const char *>(mthdPtr)[n];
448 char dummy[25 -
sizeof(asMETHOD_t)];
452 char dummy[25 -
sizeof(asFUNCTION_t)];
458 #if defined(__BORLANDC__) 462 #if __BORLANDC__ < 0x590 466 #define AS_METHOD_AMBIGUITY_CAST(t) (t) 468 template <
typename T>
469 T _implicit_cast(T val) {
472 #define AS_METHOD_AMBIGUITY_CAST(t) AS_NAMESPACE_QUALIFIER _implicit_cast<t > 475 #define AS_METHOD_AMBIGUITY_CAST(t) static_cast<t > 478 #define asMETHOD(c,m) asSMethodPtr<sizeof(void (c::*)())>::Convert((void (c::*)())(&c::m)) 479 #define asMETHODPR(c,m,p,r) asSMethodPtr<sizeof(void (c::*)())>::Convert(AS_METHOD_AMBIGUITY_CAST(r (c::*)p)(&c::m)) 481 #else // Class methods are disabled 485 for (
size_t n = 0; n <
sizeof(ptr.dummy); n++)
494 char dummy[25 -
sizeof(asFUNCTION_t)];
519 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) 520 #if defined(ANGELSCRIPT_EXPORT) 521 #define AS_API __declspec(dllexport) 522 #elif defined(ANGELSCRIPT_DLL_LIBRARY_IMPORT) 523 #define AS_API __declspec(dllimport) 524 #else // statically linked library 527 #elif defined(__GNUC__) 528 #if defined(ANGELSCRIPT_EXPORT) 529 #define AS_API __attribute__((visibility ("default"))) 537 #ifndef ANGELSCRIPT_DLL_MANUAL_IMPORT 541 AS_API asIScriptEngine *asCreateScriptEngine(asDWORD version = ANGELSCRIPT_VERSION);
542 AS_API
const char *asGetLibraryVersion();
543 AS_API
const char *asGetLibraryOptions();
546 AS_API asIScriptContext *asGetActiveContext();
550 AS_API
void asUnprepareMultithread();
552 AS_API
void asAcquireExclusiveLock();
553 AS_API
void asReleaseExclusiveLock();
554 AS_API
void asAcquireSharedLock();
555 AS_API
void asReleaseSharedLock();
556 AS_API
int asAtomicInc(
int &value);
557 AS_API
int asAtomicDec(
int &value);
558 AS_API
int asThreadCleanup();
561 AS_API
int asSetGlobalMemoryFunctions(asALLOCFUNC_t allocFunc, asFREEFUNC_t freeFunc);
562 AS_API
int asResetGlobalMemoryFunctions();
563 AS_API
void *asAllocMem(
size_t size);
564 AS_API
void asFreeMem(
void *mem);
569 #endif // ANGELSCRIPT_DLL_MANUAL_IMPORT 573 #ifdef AS_CAN_USE_CPP11 576 #include <type_traits> 580 asUINT asGetTypeTraits() {
581 #if defined(_MSC_VER) || defined(_LIBCPP_TYPE_TRAITS) || (__GNUC__ >= 5) || defined(__clang__) 584 bool hasConstructor = std::is_default_constructible<T>::value && !std::is_trivially_default_constructible<T>::value;
585 bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
586 bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::is_trivially_copy_assignable<T>::value;
587 bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::is_trivially_copy_constructible<T>::value;
588 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) 590 bool hasConstructor = std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
591 bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
592 bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
593 bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
600 bool hasConstructor = std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
601 bool hasDestructor = std::is_destructible<T>::value && !std::has_trivial_destructor<T>::value;
602 bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
603 bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
605 bool isFloat = std::is_floating_point<T>::value;
606 bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
607 bool isClass = std::is_class<T>::value;
608 bool isArray = std::is_array<T>::value;
611 return asOBJ_APP_FLOAT;
613 return asOBJ_APP_PRIMITIVE;
616 asDWORD flags = asOBJ_APP_CLASS;
618 flags |= asOBJ_APP_CLASS_CONSTRUCTOR;
620 flags |= asOBJ_APP_CLASS_DESTRUCTOR;
621 if (hasAssignmentOperator)
622 flags |= asOBJ_APP_CLASS_ASSIGNMENT;
623 if (hasCopyConstructor)
624 flags |= asOBJ_APP_CLASS_COPY_CONSTRUCTOR;
629 return asOBJ_APP_ARRAY;
639 class asIScriptEngine {
642 virtual int AddRef()
const = 0;
643 virtual int Release()
const = 0;
644 virtual int ShutDownAndRelease() = 0;
647 virtual int SetEngineProperty(asEEngineProp property, asPWORD value) = 0;
648 virtual asPWORD GetEngineProperty(asEEngineProp property)
const = 0;
651 virtual int SetMessageCallback(
const asSFuncPtr &callback,
void *obj, asDWORD callConv) = 0;
652 virtual int ClearMessageCallback() = 0;
653 virtual int WriteMessage(
const char *section,
int row,
int col, asEMsgType type,
const char *message) = 0;
660 virtual int RegisterGlobalFunction(
const char *declaration,
const asSFuncPtr &funcPointer, asDWORD callConv,
void *auxiliary = 0) = 0;
661 virtual asUINT GetGlobalFunctionCount()
const = 0;
663 virtual asIScriptFunction *GetGlobalFunctionByDecl(
const char *declaration)
const = 0;
666 virtual int RegisterGlobalProperty(
const char *declaration,
void *pointer) = 0;
667 virtual asUINT GetGlobalPropertyCount()
const = 0;
668 virtual int GetGlobalPropertyByIndex(asUINT index,
const char **name,
const char **nameSpace = 0,
int *typeId = 0,
bool *isConst = 0,
const char **configGroup = 0,
void **pointer = 0, asDWORD *accessMask = 0)
const = 0;
669 virtual int GetGlobalPropertyIndexByName(
const char *name)
const = 0;
670 virtual int GetGlobalPropertyIndexByDecl(
const char *decl)
const = 0;
673 virtual int RegisterObjectType(
const char *obj,
int byteSize, asDWORD flags) = 0;
674 virtual int RegisterObjectProperty(
const char *obj,
const char *declaration,
int byteOffset,
int compositeOffset = 0,
bool isCompositeIndirect =
false) = 0;
675 virtual int RegisterObjectMethod(
const char *obj,
const char *declaration,
const asSFuncPtr &funcPointer, asDWORD callConv,
void *auxiliary = 0,
int compositeOffset = 0,
bool isCompositeIndirect =
false) = 0;
676 virtual int RegisterObjectBehaviour(
const char *obj, asEBehaviours behaviour,
const char *declaration,
const asSFuncPtr &funcPointer, asDWORD callConv,
void *auxiliary = 0,
int compositeOffset = 0,
bool isCompositeIndirect =
false) = 0;
677 virtual int RegisterInterface(
const char *name) = 0;
678 virtual int RegisterInterfaceMethod(
const char *intf,
const char *declaration) = 0;
679 virtual asUINT GetObjectTypeCount()
const = 0;
680 virtual asITypeInfo *GetObjectTypeByIndex(asUINT index)
const = 0;
683 virtual int RegisterStringFactory(
const char *datatype,
asIStringFactory *factory) = 0;
684 virtual int GetStringFactoryReturnTypeId(asDWORD *flags = 0)
const = 0;
687 virtual int RegisterDefaultArrayType(
const char *type) = 0;
688 virtual int GetDefaultArrayTypeId()
const = 0;
691 virtual int RegisterEnum(
const char *type) = 0;
692 virtual int RegisterEnumValue(
const char *type,
const char *name,
int value) = 0;
693 virtual asUINT GetEnumCount()
const = 0;
694 virtual asITypeInfo *GetEnumByIndex(asUINT index)
const = 0;
697 virtual int RegisterFuncdef(
const char *decl) = 0;
698 virtual asUINT GetFuncdefCount()
const = 0;
699 virtual asITypeInfo *GetFuncdefByIndex(asUINT index)
const = 0;
702 virtual int RegisterTypedef(
const char *type,
const char *decl) = 0;
703 virtual asUINT GetTypedefCount()
const = 0;
704 virtual asITypeInfo *GetTypedefByIndex(asUINT index)
const = 0;
707 virtual int BeginConfigGroup(
const char *groupName) = 0;
708 virtual int EndConfigGroup() = 0;
709 virtual int RemoveConfigGroup(
const char *groupName) = 0;
710 virtual asDWORD SetDefaultAccessMask(asDWORD defaultMask) = 0;
711 virtual int SetDefaultNamespace(
const char *nameSpace) = 0;
712 virtual const char *GetDefaultNamespace()
const = 0;
715 virtual asIScriptModule *GetModule(
const char *module, asEGMFlags flag = asGM_ONLY_IF_EXISTS) = 0;
716 virtual int DiscardModule(
const char *module) = 0;
717 virtual asUINT GetModuleCount()
const = 0;
724 virtual int GetTypeIdByDecl(
const char *decl)
const = 0;
725 virtual const char *GetTypeDeclaration(
int typeId,
bool includeNamespace =
false)
const = 0;
726 virtual int GetSizeOfPrimitiveType(
int typeId)
const = 0;
727 virtual asITypeInfo *GetTypeInfoById(
int typeId)
const = 0;
728 virtual asITypeInfo *GetTypeInfoByName(
const char *name)
const = 0;
729 virtual asITypeInfo *GetTypeInfoByDecl(
const char *decl)
const = 0;
732 virtual asIScriptContext *CreateContext() = 0;
733 virtual void *CreateScriptObject(
const asITypeInfo *type) = 0;
734 virtual void *CreateScriptObjectCopy(
void *obj,
const asITypeInfo *type) = 0;
735 virtual void *CreateUninitializedScriptObject(
const asITypeInfo *type) = 0;
737 virtual int AssignScriptObject(
void *dstObj,
void *srcObj,
const asITypeInfo *type) = 0;
738 virtual void ReleaseScriptObject(
void *obj,
const asITypeInfo *type) = 0;
739 virtual void AddRefScriptObject(
void *obj,
const asITypeInfo *type) = 0;
740 virtual int RefCastObject(
void *obj, asITypeInfo *fromType, asITypeInfo *toType,
void **newPtr,
bool useOnlyImplicitCast =
false) = 0;
741 virtual asILockableSharedBool *GetWeakRefFlagOfScriptObject(
void *obj,
const asITypeInfo *type)
const = 0;
744 virtual asIScriptContext *RequestContext() = 0;
745 virtual void ReturnContext(asIScriptContext *ctx) = 0;
746 virtual int SetContextCallbacks(asREQUESTCONTEXTFUNC_t requestCtx, asRETURNCONTEXTFUNC_t returnCtx,
void *param = 0) = 0;
749 virtual asETokenClass ParseToken(
const char *
string,
size_t stringLength = 0, asUINT *tokenLength = 0)
const = 0;
752 virtual int GarbageCollect(asDWORD flags = asGC_FULL_CYCLE, asUINT numIterations = 1) = 0;
753 virtual void GetGCStatistics(asUINT *currentSize, asUINT *totalDestroyed = 0, asUINT *totalDetected = 0, asUINT *newObjects = 0, asUINT *totalNewDestroyed = 0)
const = 0;
754 virtual int NotifyGarbageCollectorOfNewObject(
void *obj, asITypeInfo *type) = 0;
755 virtual int GetObjectInGC(asUINT idx, asUINT *seqNbr = 0,
void **obj = 0, asITypeInfo **type = 0) = 0;
756 virtual void GCEnumCallback(
void *reference) = 0;
757 virtual void ForwardGCEnumReferences(
void *ref, asITypeInfo *type) = 0;
758 virtual void ForwardGCReleaseReferences(
void *ref, asITypeInfo *type) = 0;
759 virtual void SetCircularRefDetectedCallback(asCIRCULARREFFUNC_t callback,
void *param = 0) = 0;
762 virtual void *SetUserData(
void *data, asPWORD type = 0) = 0;
763 virtual void *GetUserData(asPWORD type = 0)
const = 0;
764 virtual void SetEngineUserDataCleanupCallback(asCLEANENGINEFUNC_t callback, asPWORD type = 0) = 0;
765 virtual void SetModuleUserDataCleanupCallback(asCLEANMODULEFUNC_t callback, asPWORD type = 0) = 0;
766 virtual void SetContextUserDataCleanupCallback(asCLEANCONTEXTFUNC_t callback, asPWORD type = 0) = 0;
767 virtual void SetFunctionUserDataCleanupCallback(asCLEANFUNCTIONFUNC_t callback, asPWORD type = 0) = 0;
768 virtual void SetTypeInfoUserDataCleanupCallback(asCLEANTYPEINFOFUNC_t callback, asPWORD type = 0) = 0;
769 virtual void SetScriptObjectUserDataCleanupCallback(asCLEANSCRIPTOBJECTFUNC_t callback, asPWORD type = 0) = 0;
772 virtual int SetTranslateAppExceptionCallback(
asSFuncPtr callback,
void *param,
int callConv) = 0;
775 virtual ~asIScriptEngine() {}
780 virtual const void *GetStringConstant(
const char *data, asUINT length) = 0;
781 virtual int ReleaseStringConstant(
const void *str) = 0;
782 virtual int GetRawStringData(
const void *str,
char *data, asUINT *length)
const = 0;
795 virtual asIScriptEngine *GetEngine()
const = 0;
796 virtual void SetName(
const char *name) = 0;
797 virtual const char *GetName()
const = 0;
798 virtual void Discard() = 0;
801 virtual int AddScriptSection(
const char *name,
const char *code,
size_t codeLength = 0,
int lineOffset = 0) = 0;
802 virtual int Build() = 0;
803 virtual int CompileFunction(
const char *sectionName,
const char *code,
int lineOffset, asDWORD compileFlags,
asIScriptFunction **outFunc) = 0;
804 virtual int CompileGlobalVar(
const char *sectionName,
const char *code,
int lineOffset) = 0;
805 virtual asDWORD SetAccessMask(asDWORD accessMask) = 0;
806 virtual int SetDefaultNamespace(
const char *nameSpace) = 0;
807 virtual const char *GetDefaultNamespace()
const = 0;
810 virtual asUINT GetFunctionCount()
const = 0;
817 virtual int ResetGlobalVars(asIScriptContext *ctx = 0) = 0;
818 virtual asUINT GetGlobalVarCount()
const = 0;
819 virtual int GetGlobalVarIndexByName(
const char *name)
const = 0;
820 virtual int GetGlobalVarIndexByDecl(
const char *decl)
const = 0;
821 virtual const char *GetGlobalVarDeclaration(asUINT index,
bool includeNamespace =
false)
const = 0;
822 virtual int GetGlobalVar(asUINT index,
const char **name,
const char **nameSpace = 0,
int *typeId = 0,
bool *isConst = 0)
const = 0;
823 virtual void *GetAddressOfGlobalVar(asUINT index) = 0;
824 virtual int RemoveGlobalVar(asUINT index) = 0;
827 virtual asUINT GetObjectTypeCount()
const = 0;
828 virtual asITypeInfo *GetObjectTypeByIndex(asUINT index)
const = 0;
829 virtual int GetTypeIdByDecl(
const char *decl)
const = 0;
830 virtual asITypeInfo *GetTypeInfoByName(
const char *name)
const = 0;
831 virtual asITypeInfo *GetTypeInfoByDecl(
const char *decl)
const = 0;
834 virtual asUINT GetEnumCount()
const = 0;
835 virtual asITypeInfo *GetEnumByIndex(asUINT index)
const = 0;
838 virtual asUINT GetTypedefCount()
const = 0;
839 virtual asITypeInfo *GetTypedefByIndex(asUINT index)
const = 0;
842 virtual asUINT GetImportedFunctionCount()
const = 0;
843 virtual int GetImportedFunctionIndexByDecl(
const char *decl)
const = 0;
844 virtual const char *GetImportedFunctionDeclaration(asUINT importIndex)
const = 0;
845 virtual const char *GetImportedFunctionSourceModule(asUINT importIndex)
const = 0;
846 virtual int BindImportedFunction(asUINT importIndex,
asIScriptFunction *func) = 0;
847 virtual int UnbindImportedFunction(asUINT importIndex) = 0;
848 virtual int BindAllImportedFunctions() = 0;
849 virtual int UnbindAllImportedFunctions() = 0;
852 virtual int SaveByteCode(
asIBinaryStream *out,
bool stripDebugInfo =
false)
const = 0;
853 virtual int LoadByteCode(
asIBinaryStream *in,
bool *wasDebugInfoStripped = 0) = 0;
856 virtual void *SetUserData(
void *data, asPWORD type = 0) = 0;
857 virtual void *GetUserData(asPWORD type = 0)
const = 0;
863 class asIScriptContext {
866 virtual int AddRef()
const = 0;
867 virtual int Release()
const = 0;
870 virtual asIScriptEngine *GetEngine()
const = 0;
874 virtual int Unprepare() = 0;
875 virtual int Execute() = 0;
876 virtual int Abort() = 0;
877 virtual int Suspend() = 0;
878 virtual asEContextState GetState()
const = 0;
879 virtual int PushState() = 0;
880 virtual int PopState() = 0;
881 virtual bool IsNested(asUINT *nestCount = 0)
const = 0;
884 virtual int SetObject(
void *obj) = 0;
887 virtual int SetArgByte(asUINT arg, asBYTE value) = 0;
888 virtual int SetArgWord(asUINT arg, asWORD value) = 0;
889 virtual int SetArgDWord(asUINT arg, asDWORD value) = 0;
890 virtual int SetArgQWord(asUINT arg, asQWORD value) = 0;
891 virtual int SetArgFloat(asUINT arg,
float value) = 0;
892 virtual int SetArgDouble(asUINT arg,
double value) = 0;
893 virtual int SetArgAddress(asUINT arg,
void *addr) = 0;
894 virtual int SetArgObject(asUINT arg,
void *obj) = 0;
895 virtual int SetArgVarType(asUINT arg,
void *ptr,
int typeId) = 0;
896 virtual void *GetAddressOfArg(asUINT arg) = 0;
899 virtual asBYTE GetReturnByte() = 0;
900 virtual asWORD GetReturnWord() = 0;
901 virtual asDWORD GetReturnDWord() = 0;
902 virtual asQWORD GetReturnQWord() = 0;
903 virtual float GetReturnFloat() = 0;
904 virtual double GetReturnDouble() = 0;
905 virtual void *GetReturnAddress() = 0;
906 virtual void *GetReturnObject() = 0;
907 virtual void *GetAddressOfReturnValue() = 0;
910 virtual int SetException(
const char *info,
bool allowCatch =
true) = 0;
911 virtual int GetExceptionLineNumber(
int *column = 0,
const char **sectionName = 0) = 0;
913 virtual const char *GetExceptionString() = 0;
914 virtual bool WillExceptionBeCaught() = 0;
915 virtual int SetExceptionCallback(
asSFuncPtr callback,
void *obj,
int callConv) = 0;
916 virtual void ClearExceptionCallback() = 0;
919 virtual int SetLineCallback(
asSFuncPtr callback,
void *obj,
int callConv) = 0;
920 virtual void ClearLineCallback() = 0;
921 virtual asUINT GetCallstackSize()
const = 0;
923 virtual int GetLineNumber(asUINT stackLevel = 0,
int *column = 0,
const char **sectionName = 0) = 0;
924 virtual int GetVarCount(asUINT stackLevel = 0) = 0;
925 virtual const char *GetVarName(asUINT varIndex, asUINT stackLevel = 0) = 0;
926 virtual const char *GetVarDeclaration(asUINT varIndex, asUINT stackLevel = 0,
bool includeNamespace =
false) = 0;
927 virtual int GetVarTypeId(asUINT varIndex, asUINT stackLevel = 0) = 0;
928 virtual void *GetAddressOfVar(asUINT varIndex, asUINT stackLevel = 0) = 0;
929 virtual bool IsVarInScope(asUINT varIndex, asUINT stackLevel = 0) = 0;
930 virtual int GetThisTypeId(asUINT stackLevel = 0) = 0;
931 virtual void *GetThisPointer(asUINT stackLevel = 0) = 0;
935 virtual void *SetUserData(
void *data, asPWORD type = 0) = 0;
936 virtual void *GetUserData(asPWORD type = 0)
const = 0;
939 virtual ~asIScriptContext() {}
945 virtual asIScriptEngine *GetEngine()
const = 0;
947 virtual void *GetAuxiliary()
const = 0;
950 virtual void *GetObject() = 0;
951 virtual int GetObjectTypeId()
const = 0;
954 virtual int GetArgCount()
const = 0;
955 virtual int GetArgTypeId(asUINT arg, asDWORD *flags = 0)
const = 0;
956 virtual asBYTE GetArgByte(asUINT arg) = 0;
957 virtual asWORD GetArgWord(asUINT arg) = 0;
958 virtual asDWORD GetArgDWord(asUINT arg) = 0;
959 virtual asQWORD GetArgQWord(asUINT arg) = 0;
960 virtual float GetArgFloat(asUINT arg) = 0;
961 virtual double GetArgDouble(asUINT arg) = 0;
962 virtual void *GetArgAddress(asUINT arg) = 0;
963 virtual void *GetArgObject(asUINT arg) = 0;
964 virtual void *GetAddressOfArg(asUINT arg) = 0;
967 virtual int GetReturnTypeId(asDWORD *flags = 0)
const = 0;
968 virtual int SetReturnByte(asBYTE val) = 0;
969 virtual int SetReturnWord(asWORD val) = 0;
970 virtual int SetReturnDWord(asDWORD val) = 0;
971 virtual int SetReturnQWord(asQWORD val) = 0;
972 virtual int SetReturnFloat(
float val) = 0;
973 virtual int SetReturnDouble(
double val) = 0;
974 virtual int SetReturnAddress(
void *addr) = 0;
975 virtual int SetReturnObject(
void *obj) = 0;
976 virtual void *GetAddressOfReturnLocation() = 0;
985 virtual int AddRef()
const = 0;
986 virtual int Release()
const = 0;
990 virtual int GetTypeId()
const = 0;
991 virtual asITypeInfo *GetObjectType()
const = 0;
994 virtual asUINT GetPropertyCount()
const = 0;
995 virtual int GetPropertyTypeId(asUINT prop)
const = 0;
996 virtual const char *GetPropertyName(asUINT prop)
const = 0;
997 virtual void *GetAddressOfProperty(asUINT prop) = 0;
1000 virtual asIScriptEngine *GetEngine()
const = 0;
1004 virtual void *SetUserData(
void *data, asPWORD type = 0) = 0;
1005 virtual void *GetUserData(asPWORD type = 0)
const = 0;
1014 virtual asIScriptEngine *GetEngine()
const = 0;
1015 virtual const char *GetConfigGroup()
const = 0;
1016 virtual asDWORD GetAccessMask()
const = 0;
1020 virtual int AddRef()
const = 0;
1021 virtual int Release()
const = 0;
1024 virtual const char *GetName()
const = 0;
1025 virtual const char *GetNamespace()
const = 0;
1026 virtual asITypeInfo *GetBaseType()
const = 0;
1027 virtual bool DerivesFrom(
const asITypeInfo *objType)
const = 0;
1028 virtual asDWORD GetFlags()
const = 0;
1029 virtual asUINT GetSize()
const = 0;
1030 virtual int GetTypeId()
const = 0;
1031 virtual int GetSubTypeId(asUINT subTypeIndex = 0)
const = 0;
1032 virtual asITypeInfo *GetSubType(asUINT subTypeIndex = 0)
const = 0;
1033 virtual asUINT GetSubTypeCount()
const = 0;
1036 virtual asUINT GetInterfaceCount()
const = 0;
1037 virtual asITypeInfo *GetInterface(asUINT index)
const = 0;
1038 virtual bool Implements(
const asITypeInfo *objType)
const = 0;
1041 virtual asUINT GetFactoryCount()
const = 0;
1046 virtual asUINT GetMethodCount()
const = 0;
1047 virtual asIScriptFunction *GetMethodByIndex(asUINT index,
bool getVirtual =
true)
const = 0;
1048 virtual asIScriptFunction *GetMethodByName(
const char *name,
bool getVirtual =
true)
const = 0;
1049 virtual asIScriptFunction *GetMethodByDecl(
const char *decl,
bool getVirtual =
true)
const = 0;
1052 virtual asUINT GetPropertyCount()
const = 0;
1053 virtual int GetProperty(asUINT index,
const char **name,
int *typeId = 0,
bool *isPrivate = 0,
bool *isProtected = 0,
int *offset = 0,
bool *isReference = 0, asDWORD *accessMask = 0,
int *compositeOffset = 0,
bool *isCompositeIndirect = 0)
const = 0;
1054 virtual const char *GetPropertyDeclaration(asUINT index,
bool includeNamespace =
false)
const = 0;
1057 virtual asUINT GetBehaviourCount()
const = 0;
1058 virtual asIScriptFunction *GetBehaviourByIndex(asUINT index, asEBehaviours *outBehaviour)
const = 0;
1061 virtual asUINT GetChildFuncdefCount()
const = 0;
1062 virtual asITypeInfo *GetChildFuncdef(asUINT index)
const = 0;
1063 virtual asITypeInfo *GetParentType()
const = 0;
1066 virtual asUINT GetEnumValueCount()
const = 0;
1067 virtual const char *GetEnumValueByIndex(asUINT index,
int *outValue)
const = 0;
1070 virtual int GetTypedefTypeId()
const = 0;
1076 virtual void *SetUserData(
void *data, asPWORD type = 0) = 0;
1077 virtual void *GetUserData(asPWORD type = 0)
const = 0;
1080 virtual ~asITypeInfo() {}
1085 virtual asIScriptEngine *GetEngine()
const = 0;
1088 virtual int AddRef()
const = 0;
1089 virtual int Release()
const = 0;
1092 virtual int GetId()
const = 0;
1093 virtual asEFuncType GetFuncType()
const = 0;
1094 virtual const char *GetModuleName()
const = 0;
1096 virtual const char *GetScriptSectionName()
const = 0;
1097 virtual const char *GetConfigGroup()
const = 0;
1098 virtual asDWORD GetAccessMask()
const = 0;
1099 virtual void *GetAuxiliary()
const = 0;
1102 virtual asITypeInfo *GetObjectType()
const = 0;
1103 virtual const char *GetObjectName()
const = 0;
1104 virtual const char *GetName()
const = 0;
1105 virtual const char *GetNamespace()
const = 0;
1106 virtual const char *GetDeclaration(
bool includeObjectName =
true,
bool includeNamespace =
false,
bool includeParamNames =
false)
const = 0;
1107 virtual bool IsReadOnly()
const = 0;
1108 virtual bool IsPrivate()
const = 0;
1109 virtual bool IsProtected()
const = 0;
1110 virtual bool IsFinal()
const = 0;
1111 virtual bool IsOverride()
const = 0;
1112 virtual bool IsShared()
const = 0;
1113 virtual bool IsExplicit()
const = 0;
1114 virtual bool IsProperty()
const = 0;
1115 virtual asUINT GetParamCount()
const = 0;
1116 virtual int GetParam(asUINT index,
int *typeId, asDWORD *flags = 0,
const char **name = 0,
const char **defaultArg = 0)
const = 0;
1117 virtual int GetReturnTypeId(asDWORD *flags = 0)
const = 0;
1120 virtual int GetTypeId()
const = 0;
1121 virtual bool IsCompatibleWithTypeId(
int typeId)
const = 0;
1124 virtual void *GetDelegateObject()
const = 0;
1125 virtual asITypeInfo *GetDelegateObjectType()
const = 0;
1129 virtual asUINT GetVarCount()
const = 0;
1130 virtual int GetVar(asUINT index,
const char **name,
int *typeId = 0)
const = 0;
1131 virtual const char *GetVarDecl(asUINT index,
bool includeNamespace =
false)
const = 0;
1132 virtual int FindNextLineWithCode(
int line)
const = 0;
1135 virtual asDWORD *GetByteCode(asUINT *length = 0) = 0;
1138 virtual void *SetUserData(
void *userData, asPWORD type = 0) = 0;
1139 virtual void *GetUserData(asPWORD type = 0)
const = 0;
1147 virtual int Read(
void *ptr, asUINT size) = 0;
1148 virtual int Write(
const void *ptr, asUINT size) = 0;
1157 virtual int AddRef()
const = 0;
1158 virtual int Release()
const = 0;
1161 virtual bool Get()
const = 0;
1162 virtual void Set(
bool val) = 0;
1165 virtual void Lock()
const = 0;
1166 virtual void Unlock()
const = 0;
1185 p.ptr.f.func =
reinterpret_cast<asFUNCTION_t
>(size_t(func));
1189 p.ptr.f.func =
reinterpret_cast<asFUNCTION_t
>(func);
1197 inline asSFuncPtr asFunctionPtr<asGENFUNC_t>(asGENFUNC_t func) {
1200 p.ptr.f.func =
reinterpret_cast<asFUNCTION_t
>(func);
1204 #ifndef AS_NO_CLASS_METHODS 1211 const int SINGLE_PTR_SIZE =
sizeof(asSIMPLEMETHOD_t);
1221 int ERROR_UnsupportedMethodPtr[N - 100];
1235 p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE);
1240 #if defined(_MSC_VER) && !defined(__MWERKS__) 1244 struct asSMethodPtr < SINGLE_PTR_SIZE + 1 *
sizeof(int) > {
1249 p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE +
sizeof(
int));
1255 struct asSMethodPtr < SINGLE_PTR_SIZE + 2 *
sizeof(int) > {
1263 p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE + 2 *
sizeof(
int));
1268 #if defined(_MSC_VER) && !defined(AS_64BIT_PTR) 1286 *(
reinterpret_cast<asDWORD *
>(&p) + 3) = *(
reinterpret_cast<asDWORD *
>(&p) + 2);
1294 struct asSMethodPtr < SINGLE_PTR_SIZE + 3 *
sizeof(int) > {
1299 p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE + 3 *
sizeof(
int));
1305 struct asSMethodPtr < SINGLE_PTR_SIZE + 4 *
sizeof(int) > {
1313 p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE + 4 *
sizeof(
int));
1320 #endif // AS_NO_CLASS_METHODS 1326 asDWORD *programPointer;
1327 asDWORD *stackFramePointer;
1328 asDWORD *stackPointer;
1329 asQWORD valueRegister;
1330 void *objectRegister;
1331 asITypeInfo *objectType;
1332 bool doProcessSuspend;
1333 asIScriptContext *ctx;
1336 typedef void (*asJITFunction)(
asSVMRegisters *registers, asPWORD jitArg);
1340 virtual int CompileFunction(
asIScriptFunction *
function, asJITFunction *output) = 0;
1341 virtual void ReleaseJITFunction(asJITFunction func) = 0;
1419 asBC_GETOBJREF = 71,
1486 asBC_ChkNullV = 138,
1487 asBC_CALLINTF = 139,
1521 asBC_ChkNullS = 173,
1523 asBC_JitEntry = 175,
1526 asBC_LoadThisR = 178,
1532 asBC_LoadRObjR = 184,
1533 asBC_LoadVObjR = 185,
1537 asBC_AllocMem = 189,
1538 asBC_SetListSize = 190,
1539 asBC_PshListElmnt = 191,
1540 asBC_SetListType = 192,
1548 asBC_Thiscall1 = 200,
1549 asBC_MAXBYTECODE = 201,
1552 asBC_TryBlock = 250,
1563 asBCTYPE_NO_ARG = 1,
1565 asBCTYPE_wW_ARG = 3,
1566 asBCTYPE_DW_ARG = 4,
1567 asBCTYPE_rW_DW_ARG = 5,
1568 asBCTYPE_QW_ARG = 6,
1569 asBCTYPE_DW_DW_ARG = 7,
1570 asBCTYPE_wW_rW_rW_ARG = 8,
1571 asBCTYPE_wW_QW_ARG = 9,
1572 asBCTYPE_wW_rW_ARG = 10,
1573 asBCTYPE_rW_ARG = 11,
1574 asBCTYPE_wW_DW_ARG = 12,
1575 asBCTYPE_wW_rW_DW_ARG = 13,
1576 asBCTYPE_rW_rW_ARG = 14,
1577 asBCTYPE_wW_W_ARG = 15,
1578 asBCTYPE_QW_DW_ARG = 16,
1579 asBCTYPE_rW_QW_ARG = 17,
1580 asBCTYPE_W_DW_ARG = 18,
1581 asBCTYPE_rW_W_DW_ARG = 19,
1582 asBCTYPE_rW_DW_DW_ARG = 20
1586 const int asBCTypeSize[21] = {
1618 #ifndef AS_64BIT_PTR 1619 #define asBCTYPE_PTR_ARG asBCTYPE_DW_ARG 1620 #define asBCTYPE_PTR_DW_ARG asBCTYPE_DW_DW_ARG 1621 #define asBCTYPE_wW_PTR_ARG asBCTYPE_wW_DW_ARG 1622 #define asBCTYPE_rW_PTR_ARG asBCTYPE_rW_DW_ARG 1624 #define AS_PTR_SIZE 1 1627 #define asBCTYPE_PTR_ARG asBCTYPE_QW_ARG 1628 #define asBCTYPE_PTR_DW_ARG asBCTYPE_QW_DW_ARG 1629 #define asBCTYPE_wW_PTR_ARG asBCTYPE_wW_QW_ARG 1630 #define asBCTYPE_rW_PTR_ARG asBCTYPE_rW_QW_ARG 1632 #define AS_PTR_SIZE 2 1636 #define asBCINFO(b,t,s) {asBC_##b, asBCTYPE_##t, s, #b} 1637 #define asBCINFO_DUMMY(b) {asBC_MAXBYTECODE, asBCTYPE_INFO, 0, "BC_" #b} 1640 asBCINFO(PopPtr, NO_ARG, -AS_PTR_SIZE),
1641 asBCINFO(PshGPtr, PTR_ARG, AS_PTR_SIZE),
1642 asBCINFO(PshC4, DW_ARG, 1),
1643 asBCINFO(PshV4, rW_ARG, 1),
1644 asBCINFO(PSF, rW_ARG, AS_PTR_SIZE),
1645 asBCINFO(SwapPtr, NO_ARG, 0),
1646 asBCINFO(NOT, rW_ARG, 0),
1647 asBCINFO(PshG4, PTR_ARG, 1),
1648 asBCINFO(LdGRdR4, wW_PTR_ARG, 0),
1649 asBCINFO(CALL, DW_ARG, 0xFFFF),
1650 asBCINFO(RET, W_ARG, 0xFFFF),
1651 asBCINFO(JMP, DW_ARG, 0),
1652 asBCINFO(JZ, DW_ARG, 0),
1653 asBCINFO(JNZ, DW_ARG, 0),
1654 asBCINFO(JS, DW_ARG, 0),
1655 asBCINFO(JNS, DW_ARG, 0),
1656 asBCINFO(JP, DW_ARG, 0),
1657 asBCINFO(JNP, DW_ARG, 0),
1658 asBCINFO(TZ, NO_ARG, 0),
1659 asBCINFO(TNZ, NO_ARG, 0),
1660 asBCINFO(TS, NO_ARG, 0),
1661 asBCINFO(TNS, NO_ARG, 0),
1662 asBCINFO(TP, NO_ARG, 0),
1663 asBCINFO(TNP, NO_ARG, 0),
1664 asBCINFO(NEGi, rW_ARG, 0),
1665 asBCINFO(NEGf, rW_ARG, 0),
1666 asBCINFO(NEGd, rW_ARG, 0),
1667 asBCINFO(INCi16, NO_ARG, 0),
1668 asBCINFO(INCi8, NO_ARG, 0),
1669 asBCINFO(DECi16, NO_ARG, 0),
1670 asBCINFO(DECi8, NO_ARG, 0),
1671 asBCINFO(INCi, NO_ARG, 0),
1672 asBCINFO(DECi, NO_ARG, 0),
1673 asBCINFO(INCf, NO_ARG, 0),
1674 asBCINFO(DECf, NO_ARG, 0),
1675 asBCINFO(INCd, NO_ARG, 0),
1676 asBCINFO(DECd, NO_ARG, 0),
1677 asBCINFO(IncVi, rW_ARG, 0),
1678 asBCINFO(DecVi, rW_ARG, 0),
1679 asBCINFO(BNOT, rW_ARG, 0),
1680 asBCINFO(BAND, wW_rW_rW_ARG, 0),
1681 asBCINFO(BOR, wW_rW_rW_ARG, 0),
1682 asBCINFO(BXOR, wW_rW_rW_ARG, 0),
1683 asBCINFO(BSLL, wW_rW_rW_ARG, 0),
1684 asBCINFO(BSRL, wW_rW_rW_ARG, 0),
1685 asBCINFO(BSRA, wW_rW_rW_ARG, 0),
1686 asBCINFO(COPY, W_DW_ARG, -AS_PTR_SIZE),
1687 asBCINFO(PshC8, QW_ARG, 2),
1688 asBCINFO(PshVPtr, rW_ARG, AS_PTR_SIZE),
1689 asBCINFO(RDSPtr, NO_ARG, 0),
1690 asBCINFO(CMPd, rW_rW_ARG, 0),
1691 asBCINFO(CMPu, rW_rW_ARG, 0),
1692 asBCINFO(CMPf, rW_rW_ARG, 0),
1693 asBCINFO(CMPi, rW_rW_ARG, 0),
1694 asBCINFO(CMPIi, rW_DW_ARG, 0),
1695 asBCINFO(CMPIf, rW_DW_ARG, 0),
1696 asBCINFO(CMPIu, rW_DW_ARG, 0),
1697 asBCINFO(JMPP, rW_ARG, 0),
1698 asBCINFO(PopRPtr, NO_ARG, -AS_PTR_SIZE),
1699 asBCINFO(PshRPtr, NO_ARG, AS_PTR_SIZE),
1700 asBCINFO(STR, W_ARG, 1 + AS_PTR_SIZE),
1701 asBCINFO(CALLSYS, DW_ARG, 0xFFFF),
1702 asBCINFO(CALLBND, DW_ARG, 0xFFFF),
1703 asBCINFO(SUSPEND, NO_ARG, 0),
1704 asBCINFO(ALLOC, PTR_DW_ARG, 0xFFFF),
1705 asBCINFO(FREE, wW_PTR_ARG, 0),
1706 asBCINFO(LOADOBJ, rW_ARG, 0),
1707 asBCINFO(STOREOBJ, wW_ARG, 0),
1708 asBCINFO(GETOBJ, W_ARG, 0),
1709 asBCINFO(REFCPY, PTR_ARG, -AS_PTR_SIZE),
1710 asBCINFO(CHKREF, NO_ARG, 0),
1711 asBCINFO(GETOBJREF, W_ARG, 0),
1712 asBCINFO(GETREF, W_ARG, 0),
1713 asBCINFO(PshNull, NO_ARG, AS_PTR_SIZE),
1714 asBCINFO(ClrVPtr, wW_ARG, 0),
1715 asBCINFO(OBJTYPE, PTR_ARG, AS_PTR_SIZE),
1716 asBCINFO(TYPEID, DW_ARG, 1),
1717 asBCINFO(SetV4, wW_DW_ARG, 0),
1718 asBCINFO(SetV8, wW_QW_ARG, 0),
1719 asBCINFO(ADDSi, W_DW_ARG, 0),
1720 asBCINFO(CpyVtoV4, wW_rW_ARG, 0),
1721 asBCINFO(CpyVtoV8, wW_rW_ARG, 0),
1722 asBCINFO(CpyVtoR4, rW_ARG, 0),
1723 asBCINFO(CpyVtoR8, rW_ARG, 0),
1724 asBCINFO(CpyVtoG4, rW_PTR_ARG, 0),
1725 asBCINFO(CpyRtoV4, wW_ARG, 0),
1726 asBCINFO(CpyRtoV8, wW_ARG, 0),
1727 asBCINFO(CpyGtoV4, wW_PTR_ARG, 0),
1728 asBCINFO(WRTV1, rW_ARG, 0),
1729 asBCINFO(WRTV2, rW_ARG, 0),
1730 asBCINFO(WRTV4, rW_ARG, 0),
1731 asBCINFO(WRTV8, rW_ARG, 0),
1732 asBCINFO(RDR1, wW_ARG, 0),
1733 asBCINFO(RDR2, wW_ARG, 0),
1734 asBCINFO(RDR4, wW_ARG, 0),
1735 asBCINFO(RDR8, wW_ARG, 0),
1736 asBCINFO(LDG, PTR_ARG, 0),
1737 asBCINFO(LDV, rW_ARG, 0),
1738 asBCINFO(PGA, PTR_ARG, AS_PTR_SIZE),
1739 asBCINFO(CmpPtr, rW_rW_ARG, 0),
1740 asBCINFO(VAR, rW_ARG, AS_PTR_SIZE),
1741 asBCINFO(iTOf, rW_ARG, 0),
1742 asBCINFO(fTOi, rW_ARG, 0),
1743 asBCINFO(uTOf, rW_ARG, 0),
1744 asBCINFO(fTOu, rW_ARG, 0),
1745 asBCINFO(sbTOi, rW_ARG, 0),
1746 asBCINFO(swTOi, rW_ARG, 0),
1747 asBCINFO(ubTOi, rW_ARG, 0),
1748 asBCINFO(uwTOi, rW_ARG, 0),
1749 asBCINFO(dTOi, wW_rW_ARG, 0),
1750 asBCINFO(dTOu, wW_rW_ARG, 0),
1751 asBCINFO(dTOf, wW_rW_ARG, 0),
1752 asBCINFO(iTOd, wW_rW_ARG, 0),
1753 asBCINFO(uTOd, wW_rW_ARG, 0),
1754 asBCINFO(fTOd, wW_rW_ARG, 0),
1755 asBCINFO(ADDi, wW_rW_rW_ARG, 0),
1756 asBCINFO(SUBi, wW_rW_rW_ARG, 0),
1757 asBCINFO(MULi, wW_rW_rW_ARG, 0),
1758 asBCINFO(DIVi, wW_rW_rW_ARG, 0),
1759 asBCINFO(MODi, wW_rW_rW_ARG, 0),
1760 asBCINFO(ADDf, wW_rW_rW_ARG, 0),
1761 asBCINFO(SUBf, wW_rW_rW_ARG, 0),
1762 asBCINFO(MULf, wW_rW_rW_ARG, 0),
1763 asBCINFO(DIVf, wW_rW_rW_ARG, 0),
1764 asBCINFO(MODf, wW_rW_rW_ARG, 0),
1765 asBCINFO(ADDd, wW_rW_rW_ARG, 0),
1766 asBCINFO(SUBd, wW_rW_rW_ARG, 0),
1767 asBCINFO(MULd, wW_rW_rW_ARG, 0),
1768 asBCINFO(DIVd, wW_rW_rW_ARG, 0),
1769 asBCINFO(MODd, wW_rW_rW_ARG, 0),
1770 asBCINFO(ADDIi, wW_rW_DW_ARG, 0),
1771 asBCINFO(SUBIi, wW_rW_DW_ARG, 0),
1772 asBCINFO(MULIi, wW_rW_DW_ARG, 0),
1773 asBCINFO(ADDIf, wW_rW_DW_ARG, 0),
1774 asBCINFO(SUBIf, wW_rW_DW_ARG, 0),
1775 asBCINFO(MULIf, wW_rW_DW_ARG, 0),
1776 asBCINFO(SetG4, PTR_DW_ARG, 0),
1777 asBCINFO(ChkRefS, NO_ARG, 0),
1778 asBCINFO(ChkNullV, rW_ARG, 0),
1779 asBCINFO(CALLINTF, DW_ARG, 0xFFFF),
1780 asBCINFO(iTOb, rW_ARG, 0),
1781 asBCINFO(iTOw, rW_ARG, 0),
1782 asBCINFO(SetV1, wW_DW_ARG, 0),
1783 asBCINFO(SetV2, wW_DW_ARG, 0),
1784 asBCINFO(Cast, DW_ARG, -AS_PTR_SIZE),
1785 asBCINFO(i64TOi, wW_rW_ARG, 0),
1786 asBCINFO(uTOi64, wW_rW_ARG, 0),
1787 asBCINFO(iTOi64, wW_rW_ARG, 0),
1788 asBCINFO(fTOi64, wW_rW_ARG, 0),
1789 asBCINFO(dTOi64, rW_ARG, 0),
1790 asBCINFO(fTOu64, wW_rW_ARG, 0),
1791 asBCINFO(dTOu64, rW_ARG, 0),
1792 asBCINFO(i64TOf, wW_rW_ARG, 0),
1793 asBCINFO(u64TOf, wW_rW_ARG, 0),
1794 asBCINFO(i64TOd, rW_ARG, 0),
1795 asBCINFO(u64TOd, rW_ARG, 0),
1796 asBCINFO(NEGi64, rW_ARG, 0),
1797 asBCINFO(INCi64, NO_ARG, 0),
1798 asBCINFO(DECi64, NO_ARG, 0),
1799 asBCINFO(BNOT64, rW_ARG, 0),
1800 asBCINFO(ADDi64, wW_rW_rW_ARG, 0),
1801 asBCINFO(SUBi64, wW_rW_rW_ARG, 0),
1802 asBCINFO(MULi64, wW_rW_rW_ARG, 0),
1803 asBCINFO(DIVi64, wW_rW_rW_ARG, 0),
1804 asBCINFO(MODi64, wW_rW_rW_ARG, 0),
1805 asBCINFO(BAND64, wW_rW_rW_ARG, 0),
1806 asBCINFO(BOR64, wW_rW_rW_ARG, 0),
1807 asBCINFO(BXOR64, wW_rW_rW_ARG, 0),
1808 asBCINFO(BSLL64, wW_rW_rW_ARG, 0),
1809 asBCINFO(BSRL64, wW_rW_rW_ARG, 0),
1810 asBCINFO(BSRA64, wW_rW_rW_ARG, 0),
1811 asBCINFO(CMPi64, rW_rW_ARG, 0),
1812 asBCINFO(CMPu64, rW_rW_ARG, 0),
1813 asBCINFO(ChkNullS, W_ARG, 0),
1814 asBCINFO(ClrHi, NO_ARG, 0),
1815 asBCINFO(JitEntry, PTR_ARG, 0),
1816 asBCINFO(CallPtr, rW_ARG, 0xFFFF),
1817 asBCINFO(FuncPtr, PTR_ARG, AS_PTR_SIZE),
1818 asBCINFO(LoadThisR, W_DW_ARG, 0),
1819 asBCINFO(PshV8, rW_ARG, 2),
1820 asBCINFO(DIVu, wW_rW_rW_ARG, 0),
1821 asBCINFO(MODu, wW_rW_rW_ARG, 0),
1822 asBCINFO(DIVu64, wW_rW_rW_ARG, 0),
1823 asBCINFO(MODu64, wW_rW_rW_ARG, 0),
1824 asBCINFO(LoadRObjR, rW_W_DW_ARG, 0),
1825 asBCINFO(LoadVObjR, rW_W_DW_ARG, 0),
1826 asBCINFO(RefCpyV, wW_PTR_ARG, 0),
1827 asBCINFO(JLowZ, DW_ARG, 0),
1828 asBCINFO(JLowNZ, DW_ARG, 0),
1829 asBCINFO(AllocMem, wW_DW_ARG, 0),
1830 asBCINFO(SetListSize, rW_DW_DW_ARG, 0),
1831 asBCINFO(PshListElmnt, rW_DW_ARG, AS_PTR_SIZE),
1832 asBCINFO(SetListType, rW_DW_DW_ARG, 0),
1833 asBCINFO(POWi, wW_rW_rW_ARG, 0),
1834 asBCINFO(POWu, wW_rW_rW_ARG, 0),
1835 asBCINFO(POWf, wW_rW_rW_ARG, 0),
1836 asBCINFO(POWd, wW_rW_rW_ARG, 0),
1837 asBCINFO(POWdi, wW_rW_rW_ARG, 0),
1838 asBCINFO(POWi64, wW_rW_rW_ARG, 0),
1839 asBCINFO(POWu64, wW_rW_rW_ARG, 0),
1840 asBCINFO(Thiscall1, DW_ARG, -AS_PTR_SIZE - 1),
1842 asBCINFO_DUMMY(201),
1843 asBCINFO_DUMMY(202),
1844 asBCINFO_DUMMY(203),
1845 asBCINFO_DUMMY(204),
1846 asBCINFO_DUMMY(205),
1847 asBCINFO_DUMMY(206),
1848 asBCINFO_DUMMY(207),
1849 asBCINFO_DUMMY(208),
1850 asBCINFO_DUMMY(209),
1851 asBCINFO_DUMMY(210),
1852 asBCINFO_DUMMY(211),
1853 asBCINFO_DUMMY(212),
1854 asBCINFO_DUMMY(213),
1855 asBCINFO_DUMMY(214),
1856 asBCINFO_DUMMY(215),
1857 asBCINFO_DUMMY(216),
1858 asBCINFO_DUMMY(217),
1859 asBCINFO_DUMMY(218),
1860 asBCINFO_DUMMY(219),
1861 asBCINFO_DUMMY(220),
1862 asBCINFO_DUMMY(221),
1863 asBCINFO_DUMMY(222),
1864 asBCINFO_DUMMY(223),
1865 asBCINFO_DUMMY(224),
1866 asBCINFO_DUMMY(225),
1867 asBCINFO_DUMMY(226),
1868 asBCINFO_DUMMY(227),
1869 asBCINFO_DUMMY(228),
1870 asBCINFO_DUMMY(229),
1871 asBCINFO_DUMMY(230),
1872 asBCINFO_DUMMY(231),
1873 asBCINFO_DUMMY(232),
1874 asBCINFO_DUMMY(233),
1875 asBCINFO_DUMMY(234),
1876 asBCINFO_DUMMY(235),
1877 asBCINFO_DUMMY(236),
1878 asBCINFO_DUMMY(237),
1879 asBCINFO_DUMMY(238),
1880 asBCINFO_DUMMY(239),
1881 asBCINFO_DUMMY(240),
1882 asBCINFO_DUMMY(241),
1883 asBCINFO_DUMMY(242),
1884 asBCINFO_DUMMY(243),
1885 asBCINFO_DUMMY(244),
1886 asBCINFO_DUMMY(245),
1887 asBCINFO_DUMMY(246),
1888 asBCINFO_DUMMY(247),
1889 asBCINFO_DUMMY(248),
1890 asBCINFO_DUMMY(249),
1892 asBCINFO(TryBlock, DW_ARG, 0),
1893 asBCINFO(VarDecl, W_ARG, 0),
1894 asBCINFO(Block, INFO, 0),
1895 asBCINFO(ObjInfo, rW_DW_ARG, 0),
1896 asBCINFO(LINE, INFO, 0),
1897 asBCINFO(LABEL, INFO, 0)
1901 #define asBC_DWORDARG(x) (*(((asDWORD*)x)+1)) 1902 #define asBC_INTARG(x) (*(int*)(((asDWORD*)x)+1)) 1903 #define asBC_QWORDARG(x) (*(asQWORD*)(((asDWORD*)x)+1)) 1904 #define asBC_FLOATARG(x) (*(float*)(((asDWORD*)x)+1)) 1905 #define asBC_PTRARG(x) (*(asPWORD*)(((asDWORD*)x)+1)) 1906 #define asBC_WORDARG0(x) (*(((asWORD*)x)+1)) 1907 #define asBC_WORDARG1(x) (*(((asWORD*)x)+2)) 1908 #define asBC_SWORDARG0(x) (*(((short*)x)+1)) 1909 #define asBC_SWORDARG1(x) (*(((short*)x)+2)) 1910 #define asBC_SWORDARG2(x) (*(((short*)x)+3)) Definition: angelscript.h:1325
Definition: angelscript.h:1083
Definition: angelscript.h:1611
Definition: angelscript.h:793
Definition: angelscript.h:942
Definition: angelscript.h:1215
Definition: angelscript.h:1154
Definition: angelscript.h:1209
Definition: angelscript.h:863
Definition: angelscript.h:788
Definition: angelscript.h:778
Definition: angelscript.h:1338
Definition: angelscript.h:1145
Definition: angelscript.h:982
Definition: angelscript.h:429
Definition: angelscript.h:502
Definition: angelscript.h:639
Definition: angelscript.h:1011