28 #if !defined(_SQ_MODULE_H_)
44 HSQUIRRELVM (*open)(SQInteger initialstacksize);
45 HSQUIRRELVM (*newthread)(HSQUIRRELVM friendvm, SQInteger initialstacksize);
46 void (*seterrorhandler)(HSQUIRRELVM v);
47 void (*close)(HSQUIRRELVM v);
48 void (*setforeignptr)(HSQUIRRELVM v,SQUserPointer p);
49 SQUserPointer (*getforeignptr)(HSQUIRRELVM v);
50 #if SQUIRREL_VERSION_NUMBER >= 300
51 void (*setprintfunc)(HSQUIRRELVM v, SQPRINTFUNCTION printfunc, SQPRINTFUNCTION);
53 void (*setprintfunc)(HSQUIRRELVM v, SQPRINTFUNCTION printfunc);
55 SQPRINTFUNCTION (*getprintfunc)(HSQUIRRELVM v);
56 SQRESULT (*suspendvm)(HSQUIRRELVM v);
57 SQRESULT (*wakeupvm)(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror,SQBool throwerror);
58 SQInteger (*getvmstate)(HSQUIRRELVM v);
61 SQRESULT (*compile)(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,
const SQChar *sourcename,SQBool raiseerror);
62 SQRESULT (*compilebuffer)(HSQUIRRELVM v,
const SQChar *s,SQInteger size,
const SQChar *sourcename,SQBool raiseerror);
63 void (*enabledebuginfo)(HSQUIRRELVM v, SQBool enable);
64 void (*notifyallexceptions)(HSQUIRRELVM v, SQBool enable);
65 void (*setcompilererrorhandler)(HSQUIRRELVM v,SQCOMPILERERROR f);
68 void (*push)(HSQUIRRELVM v,SQInteger idx);
69 void (*pop)(HSQUIRRELVM v,SQInteger nelemstopop);
70 void (*poptop)(HSQUIRRELVM v);
71 void (*
remove)(HSQUIRRELVM v,SQInteger idx);
72 SQInteger (*gettop)(HSQUIRRELVM v);
73 void (*settop)(HSQUIRRELVM v,SQInteger newtop);
74 #if SQUIRREL_VERSION_NUMBER >= 300
75 SQRESULT (*reservestack)(HSQUIRRELVM v,SQInteger nsize);
77 void (*reservestack)(HSQUIRRELVM v,SQInteger nsize);
79 SQInteger (*cmp)(HSQUIRRELVM v);
80 void (*move)(HSQUIRRELVM dest,HSQUIRRELVM src,SQInteger idx);
83 SQUserPointer (*newuserdata)(HSQUIRRELVM v,SQUnsignedInteger size);
84 void (*newtable)(HSQUIRRELVM v);
85 void (*newarray)(HSQUIRRELVM v,SQInteger size);
86 void (*newclosure)(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars);
87 SQRESULT (*setparamscheck)(HSQUIRRELVM v,SQInteger nparamscheck,
const SQChar *typemask);
88 SQRESULT (*bindenv)(HSQUIRRELVM v,SQInteger idx);
89 void (*pushstring)(HSQUIRRELVM v,
const SQChar *s,SQInteger len);
90 void (*pushfloat)(HSQUIRRELVM v,SQFloat f);
91 void (*pushinteger)(HSQUIRRELVM v,SQInteger n);
92 void (*pushbool)(HSQUIRRELVM v,SQBool b);
93 void (*pushuserpointer)(HSQUIRRELVM v,SQUserPointer p);
94 void (*pushnull)(HSQUIRRELVM v);
95 SQObjectType (*gettype)(HSQUIRRELVM v,SQInteger idx);
96 SQInteger (*getsize)(HSQUIRRELVM v,SQInteger idx);
97 SQRESULT (*getbase)(HSQUIRRELVM v,SQInteger idx);
98 SQBool (*instanceof)(HSQUIRRELVM v);
99 #if SQUIRREL_VERSION_NUMBER >= 300
100 SQRESULT (*tostring)(HSQUIRRELVM v,SQInteger idx);
102 void (*tostring)(HSQUIRRELVM v,SQInteger idx);
104 void (*tobool)(HSQUIRRELVM v, SQInteger idx, SQBool *b);
105 SQRESULT (*getstring)(HSQUIRRELVM v,SQInteger idx,
const SQChar **c);
106 SQRESULT (*getinteger)(HSQUIRRELVM v,SQInteger idx,SQInteger *i);
107 SQRESULT (*getfloat)(HSQUIRRELVM v,SQInteger idx,SQFloat *f);
108 SQRESULT (*getbool)(HSQUIRRELVM v,SQInteger idx,SQBool *b);
109 SQRESULT (*getthread)(HSQUIRRELVM v,SQInteger idx,HSQUIRRELVM *thread);
110 SQRESULT (*getuserpointer)(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p);
111 SQRESULT (*getuserdata)(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p,SQUserPointer *typetag);
112 SQRESULT (*settypetag)(HSQUIRRELVM v,SQInteger idx,SQUserPointer typetag);
113 SQRESULT (*gettypetag)(HSQUIRRELVM v,SQInteger idx,SQUserPointer *typetag);
114 void (*setreleasehook)(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook);
115 SQChar* (*getscratchpad)(HSQUIRRELVM v,SQInteger minsize);
116 SQRESULT (*getclosureinfo)(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars);
117 SQRESULT (*setnativeclosurename)(HSQUIRRELVM v,SQInteger idx,
const SQChar *name);
118 SQRESULT (*setinstanceup)(HSQUIRRELVM v, SQInteger idx, SQUserPointer p);
119 SQRESULT (*getinstanceup)(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p,SQUserPointer typetag);
120 SQRESULT (*setclassudsize)(HSQUIRRELVM v, SQInteger idx, SQInteger udsize);
121 SQRESULT (*newclass)(HSQUIRRELVM v,SQBool hasbase);
122 SQRESULT (*createinstance)(HSQUIRRELVM v,SQInteger idx);
123 SQRESULT (*setattributes)(HSQUIRRELVM v,SQInteger idx);
124 SQRESULT (*getattributes)(HSQUIRRELVM v,SQInteger idx);
125 SQRESULT (*getclass)(HSQUIRRELVM v,SQInteger idx);
126 void (*weakref)(HSQUIRRELVM v,SQInteger idx);
127 SQRESULT (*getdefaultdelegate)(HSQUIRRELVM v,SQObjectType t);
130 void (*pushroottable)(HSQUIRRELVM v);
131 void (*pushregistrytable)(HSQUIRRELVM v);
132 void (*pushconsttable)(HSQUIRRELVM v);
133 SQRESULT (*setroottable)(HSQUIRRELVM v);
134 SQRESULT (*setconsttable)(HSQUIRRELVM v);
135 SQRESULT (*newslot)(HSQUIRRELVM v, SQInteger idx, SQBool bstatic);
136 SQRESULT (*deleteslot)(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
137 SQRESULT (*set)(HSQUIRRELVM v,SQInteger idx);
138 SQRESULT (*
get)(HSQUIRRELVM v,SQInteger idx);
139 SQRESULT (*rawget)(HSQUIRRELVM v,SQInteger idx);
140 SQRESULT (*rawset)(HSQUIRRELVM v,SQInteger idx);
141 SQRESULT (*rawdeleteslot)(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
142 SQRESULT (*arrayappend)(HSQUIRRELVM v,SQInteger idx);
143 SQRESULT (*arraypop)(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
144 SQRESULT (*arrayresize)(HSQUIRRELVM v,SQInteger idx,SQInteger newsize);
145 SQRESULT (*arrayreverse)(HSQUIRRELVM v,SQInteger idx);
146 SQRESULT (*arrayremove)(HSQUIRRELVM v,SQInteger idx,SQInteger itemidx);
147 SQRESULT (*arrayinsert)(HSQUIRRELVM v,SQInteger idx,SQInteger destpos);
148 SQRESULT (*setdelegate)(HSQUIRRELVM v,SQInteger idx);
149 SQRESULT (*getdelegate)(HSQUIRRELVM v,SQInteger idx);
150 SQRESULT (*clone)(HSQUIRRELVM v,SQInteger idx);
151 SQRESULT (*setfreevariable)(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
152 SQRESULT (*next)(HSQUIRRELVM v,SQInteger idx);
153 SQRESULT (*getweakrefval)(HSQUIRRELVM v,SQInteger idx);
154 SQRESULT (*clear)(HSQUIRRELVM v,SQInteger idx);
157 SQRESULT (*call)(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror);
158 SQRESULT (*resume)(HSQUIRRELVM v,SQBool retval,SQBool raiseerror);
159 const SQChar* (*getlocal)(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx);
160 const SQChar* (*getfreevariable)(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
161 SQRESULT (*throwerror)(HSQUIRRELVM v,
const SQChar *err);
162 void (*reseterror)(HSQUIRRELVM v);
163 void (*getlasterror)(HSQUIRRELVM v);
166 SQRESULT (*getstackobj)(HSQUIRRELVM v,SQInteger idx,HSQOBJECT *po);
167 void (*pushobject)(HSQUIRRELVM v,HSQOBJECT obj);
168 void (*addref)(HSQUIRRELVM v,HSQOBJECT *po);
169 SQBool (*release)(HSQUIRRELVM v,HSQOBJECT *po);
170 void (*resetobject)(HSQOBJECT *po);
171 const SQChar* (*objtostring)(
const HSQOBJECT *o);
172 SQBool (*objtobool)(
const HSQOBJECT *o);
173 SQInteger (*objtointeger)(
const HSQOBJECT *o);
174 SQFloat (*objtofloat)(
const HSQOBJECT *o);
175 SQRESULT (*getobjtypetag)(
const HSQOBJECT *o,SQUserPointer * typetag);
178 SQInteger (*collectgarbage)(HSQUIRRELVM v);
181 SQRESULT (*writeclosure)(HSQUIRRELVM vm,SQWRITEFUNC writef,SQUserPointer up);
182 SQRESULT (*readclosure)(HSQUIRRELVM vm,SQREADFUNC readf,SQUserPointer up);
185 void* (*malloc)(SQUnsignedInteger size);
186 void* (*realloc)(
void* p,SQUnsignedInteger oldsize,SQUnsignedInteger newsize);
187 void (*free)(
void *p,SQUnsignedInteger size);
190 SQRESULT (*stackinfos)(HSQUIRRELVM v,SQInteger level,SQStackInfos *si);
191 void (*setdebughook)(HSQUIRRELVM v);
193 typedef sq_api* HSQAPI;