git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/SpiderScript - Added language namespace exports
[tpg/acess2.git]
/
Usermode
/
include
/
spiderscript.h
diff --git
a/Usermode/include/spiderscript.h
b/Usermode/include/spiderscript.h
index
4a492ed
..
e049730
100644
(file)
--- a/
Usermode/include/spiderscript.h
+++ b/
Usermode/include/spiderscript.h
@@
-51,7
+51,7
@@
enum eSpiderScript_DataTypes
*/
SS_DATATYPE_OBJECT,
/**
*/
SS_DATATYPE_OBJECT,
/**
- * \brief Array data type
+ * \brief Array data type
(invalid when using static typing)
*/
SS_DATATYPE_ARRAY,
/**
*/
SS_DATATYPE_ARRAY,
/**
@@
-65,6
+65,31
@@
enum eSpiderScript_DataTypes
NUM_SS_DATATYPES
};
NUM_SS_DATATYPES
};
+#define SS_MAKEARRAY(_type) ((_type) + 0x10000)
+#define SS_DOWNARRAY(_type) ((_type) - 0x10000)
+#define SS_GETARRAYDEPTH(_type) ((_type) >> 16)
+
+enum eSpiderValueOps
+{
+ SS_VALUEOP_NOP,
+
+ SS_VALUEOP_ADD,
+ SS_VALUEOP_SUBTRACT,
+ SS_VALUEOP_NEGATE,
+ SS_VALUEOP_MULIPLY,
+ SS_VALUEOP_DIVIDE,
+ SS_VALUEOP_MODULO,
+
+ SS_VALUEOP_BITNOT,
+ SS_VALUEOP_BITAND,
+ SS_VALUEOP_BITOR,
+ SS_VALUEOP_BITXOR,
+
+ SS_VALUEOP_SHIFTLEFT,
+ SS_VALUEOP_SHIFTRIGHT,
+ SS_VALUEOP_ROTATELEFT
+};
+
/**
* \brief Namespace definition
*/
/**
* \brief Namespace definition
*/
@@
-215,6
+240,12
@@
struct sSpiderFunction
* \brief Function handler
*/
tSpiderValue *(*Handler)(tSpiderScript *Script, int nParams, tSpiderValue **Parameters);
* \brief Function handler
*/
tSpiderValue *(*Handler)(tSpiderScript *Script, int nParams, tSpiderValue **Parameters);
+
+ /**
+ * \brief What type is returned
+ */
+ int ReturnType;
+
/**
* \brief Argument types
*
/**
* \brief Argument types
*
@@
-242,8
+273,9
@@
extern tSpiderScript *SpiderScript_ParseFile(tSpiderVariant *Variant, const char
* \return Return value
*/
extern tSpiderValue *SpiderScript_ExecuteFunction(tSpiderScript *Script,
* \return Return value
*/
extern tSpiderValue *SpiderScript_ExecuteFunction(tSpiderScript *Script,
- tSpiderNamespace *Namespace, const char *Function,
- int NArguments, tSpiderValue **Arguments
+ const char *Function, const char *DefaultNamespaces[],
+ int NArguments, tSpiderValue **Arguments,
+ void **FunctionIdent
);
/**
* \brief Execute an object method
);
/**
* \brief Execute an object method
@@
-256,7
+288,7
@@
extern tSpiderValue *SpiderScript_ExecuteMethod(tSpiderScript *Script,
* \brief Creates an object instance
*/
extern tSpiderValue *SpiderScript_CreateObject(tSpiderScript *Script,
* \brief Creates an object instance
*/
extern tSpiderValue *SpiderScript_CreateObject(tSpiderScript *Script,
-
tSpiderNamespace *Namespace, const char *ClassName
,
+
const char *ClassName, const char *DefaultNamespaces[]
,
int NArguments, tSpiderValue **Arguments
);
int NArguments, tSpiderValue **Arguments
);
@@
-291,6
+323,8
@@
extern tSpiderValue *SpiderScript_CastValueTo(int Type, tSpiderValue *Source);
extern int SpiderScript_IsValueTrue(tSpiderValue *Value);
extern void SpiderScript_FreeValue(tSpiderValue *Value);
extern char *SpiderScript_DumpValue(tSpiderValue *Value);
extern int SpiderScript_IsValueTrue(tSpiderValue *Value);
extern void SpiderScript_FreeValue(tSpiderValue *Value);
extern char *SpiderScript_DumpValue(tSpiderValue *Value);
+
+extern tSpiderValue *SpiderScript_DoOp(tSpiderValue *Left, enum eSpiderValueOps Op, int bCanCast, tSpiderValue *Right);
/**
* \}
*/
/**
* \}
*/
UCC
git Repository :: git.ucc.asn.au