Code::Blocks  SVN r11506
SquirrelObject.cpp
Go to the documentation of this file.
1 #include "sqplus.h"
2 
3 SquirrelObject::SquirrelObject(void)
4 {
5  sq_resetobject(&_o);
6 }
7 
8 SquirrelObject::~SquirrelObject()
9 {
10  if(SquirrelVM::_VM)
11  sq_release(SquirrelVM::_VM,&_o);
12 }
13 
14 SquirrelObject::SquirrelObject(const SquirrelObject &o)
15 {
16  _o = o._o;
17  sq_addref(SquirrelVM::_VM,&_o);
18 }
19 
20 SquirrelObject::SquirrelObject(HSQOBJECT o)
21 {
22  _o = o;
23  sq_addref(SquirrelVM::_VM,&_o);
24 }
25 
26 void SquirrelObject::Reset(void) {
27  if(SquirrelVM::_VM)
28  sq_release(SquirrelVM::_VM,&_o);
29  sq_resetobject(&_o);
30 } // SquirrelObject::Reset
31 
32 SquirrelObject SquirrelObject::Clone()
33 {
34  SquirrelObject ret;
35  if(GetType() == OT_TABLE || GetType() == OT_ARRAY)
36  {
37  sq_pushobject(SquirrelVM::_VM,_o);
38  sq_clone(SquirrelVM::_VM,-1);
39  ret.AttachToStackObject(-1);
40  sq_pop(SquirrelVM::_VM,2);
41  }
42  return ret;
43 
44 }
45 
46 SquirrelObject & SquirrelObject::operator =(const SquirrelObject &o)
47 {
48  HSQOBJECT t;
49  t = o._o;
50  sq_addref(SquirrelVM::_VM,&t);
51  sq_release(SquirrelVM::_VM,&_o);
52  _o = t;
53  return *this;
54 }
55 
56 SquirrelObject & SquirrelObject::operator =(SQInteger n)
57 {
58  sq_pushinteger(SquirrelVM::_VM,n);
59  AttachToStackObject(-1);
60  sq_pop(SquirrelVM::_VM,1);
61  return *this;
62 }
63 
64 void SquirrelObject::ArrayAppend(const SquirrelObject &o)
65 {
66  if(sq_isarray(_o)) {
67  sq_pushobject(SquirrelVM::_VM,_o);
68  sq_pushobject(SquirrelVM::_VM,o._o);
69  sq_arrayappend(SquirrelVM::_VM,-2);
70  sq_pop(SquirrelVM::_VM,1);
71  }
72 }
73 
74 void SquirrelObject::AttachToStackObject(SQInteger idx)
75 {
76  HSQOBJECT t;
77  sq_getstackobj(SquirrelVM::_VM,idx,&t);
78  sq_addref(SquirrelVM::_VM,&t);
79  sq_release(SquirrelVM::_VM,&_o);
80  _o = t;
81 }
82 
83 BOOL_T SquirrelObject::SetDelegate(SquirrelObject &obj)
84 {
85  if(obj.GetType() == OT_TABLE ||
86  obj.GetType() == OT_NULL) {
87  switch(_o._type) {
88  case OT_USERDATA:
89  case OT_TABLE:
90  sq_pushobject(SquirrelVM::_VM,_o);
91  sq_pushobject(SquirrelVM::_VM,obj._o);
92  if(SQ_SUCCEEDED(sq_setdelegate(SquirrelVM::_VM,-2)))
93  return TRUE;
94  break;
95  // C::B patch: Handle all switch cases
96  default: break;
97  }
98  }
99  return FALSE;
100 }
101 
102 SquirrelObject SquirrelObject::GetDelegate()
103 {
104  SquirrelObject ret;
105  if(_o._type == OT_TABLE || _o._type == OT_USERDATA)
106  {
107  SQInteger top = sq_gettop(SquirrelVM::_VM);
108  sq_pushobject(SquirrelVM::_VM,_o);
109  sq_getdelegate(SquirrelVM::_VM,-1);
110  ret.AttachToStackObject(-1);
111  sq_settop(SquirrelVM::_VM,top);
112 // sq_pop(SquirrelVM::_VM,2);
113  }
114  return ret;
115 }
116 
117 BOOL_T SquirrelObject::IsNull() const
118 {
119  return sq_isnull(_o);
120 }
121 
122 BOOL_T SquirrelObject::IsNumeric() const
123 {
124  return sq_isnumeric(_o);
125 }
126 
127 SQInteger SquirrelObject::Len() const
128 {
129  SQInteger ret = 0;
130  if(sq_isarray(_o) || sq_istable(_o) || sq_isstring(_o)) {
131  sq_pushobject(SquirrelVM::_VM,_o);
132  ret = sq_getsize(SquirrelVM::_VM,-1);
133  sq_pop(SquirrelVM::_VM,1);
134  }
135  return ret;
136 }
137 
138 #define _SETVALUE_INT_BEGIN \
139  BOOL_T ret = FALSE; \
140  SQInteger top = sq_gettop(SquirrelVM::_VM); \
141  sq_pushobject(SquirrelVM::_VM,_o); \
142  sq_pushinteger(SquirrelVM::_VM,key);
143 
144 #define _SETVALUE_INT_END \
145  if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) { \
146  ret = TRUE; \
147  } \
148  sq_settop(SquirrelVM::_VM,top); \
149  return ret;
150 
151 BOOL_T SquirrelObject::SetValue(INT_T key,const SquirrelObject &val)
152 {
154  sq_pushobject(SquirrelVM::_VM,val._o);
156 }
157 
158 BOOL_T SquirrelObject::SetValue(INT_T key,INT_T n)
159 {
161  sq_pushinteger(SquirrelVM::_VM,n);
163 }
164 
165 BOOL_T SquirrelObject::SetValue(INT_T key,FLOAT_T f)
166 {
168  sq_pushfloat(SquirrelVM::_VM,f);
170 }
171 
172 BOOL_T SquirrelObject::SetValue(INT_T key,const SQChar *s)
173 {
175  sq_pushstring(SquirrelVM::_VM,s,-1);
177 }
178 
179 BOOL_T SquirrelObject::SetValue(INT_T key,bool b)
180 {
182  sq_pushbool(SquirrelVM::_VM,b);
184 }
185 
186 BOOL_T SquirrelObject::SetValue(const SquirrelObject &key,const SquirrelObject &val)
187 {
188  BOOL_T ret = FALSE;
189  SQInteger top = sq_gettop(SquirrelVM::_VM);
190  sq_pushobject(SquirrelVM::_VM,_o);
191  sq_pushobject(SquirrelVM::_VM,key._o);
192  sq_pushobject(SquirrelVM::_VM,val._o);
193  if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) {
194  ret = TRUE;
195  }
196  sq_settop(SquirrelVM::_VM,top);
197  return ret;
198 }
199 
200 #define _SETVALUE_STR_BEGIN \
201  BOOL_T ret = FALSE; \
202  SQInteger top = sq_gettop(SquirrelVM::_VM); \
203  sq_pushobject(SquirrelVM::_VM,_o); \
204  sq_pushstring(SquirrelVM::_VM,key,-1);
205 
206 #define _SETVALUE_STR_END \
207  if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) { \
208  ret = TRUE; \
209  } \
210  sq_settop(SquirrelVM::_VM,top); \
211  return ret;
212 
213 BOOL_T SquirrelObject::SetValue(const SQChar *key,const SquirrelObject &val)
214 {
216  sq_pushobject(SquirrelVM::_VM,val._o);
218 }
219 
220 BOOL_T SquirrelObject::SetValue(const SQChar *key,INT_T n)
221 {
223  sq_pushinteger(SquirrelVM::_VM,n);
225 }
226 
227 BOOL_T SquirrelObject::SetValue(const SQChar *key,FLOAT_T f)
228 {
230  sq_pushfloat(SquirrelVM::_VM,f);
232 }
233 
234 BOOL_T SquirrelObject::SetValue(const SQChar *key,const SQChar *s)
235 {
237  sq_pushstring(SquirrelVM::_VM,s,-1);
239 }
240 
241 BOOL_T SquirrelObject::SetValue(const SQChar *key,bool b)
242 {
244  sq_pushbool(SquirrelVM::_VM,b);
246 }
247 
248 // === BEGIN User Pointer, User Data ===
249 
250 BOOL_T SquirrelObject::SetUserPointer(const SQChar * key,SQUserPointer up) {
252  sq_pushuserpointer(SquirrelVM::_VM,up);
254 } // SquirrelObject::SetUserPointer
255 
256 SQUserPointer SquirrelObject::GetUserPointer(const SQChar * key) {
257  SQUserPointer ret = NULL;
258  if (GetSlot(key)) {
259  sq_getuserpointer(SquirrelVM::_VM,-1,&ret);
260  sq_pop(SquirrelVM::_VM,1);
261  } // if
262  sq_pop(SquirrelVM::_VM,1);
263  return ret;
264 } // SquirrelObject::GetUserPointer
265 
266 BOOL_T SquirrelObject::SetUserPointer(INT_T key,SQUserPointer up) {
268  sq_pushuserpointer(SquirrelVM::_VM,up);
270 } // SquirrelObject::SetUserPointer
271 
272 SQUserPointer SquirrelObject::GetUserPointer(INT_T key) {
273  SQUserPointer ret = NULL;
274  if (GetSlot(key)) {
275  sq_getuserpointer(SquirrelVM::_VM,-1,&ret);
276  sq_pop(SquirrelVM::_VM,1);
277  } // if
278  sq_pop(SquirrelVM::_VM,1);
279  return ret;
280 } // SquirrelObject::GetUserPointer
281 
282 // === User Data ===
283 
284 BOOL_T SquirrelObject::NewUserData(const SQChar * key,INT_T size,SQUserPointer * typetag) {
286  sq_newuserdata(SquirrelVM::_VM,size);
287  if (typetag) {
288  sq_settypetag(SquirrelVM::_VM,-1,typetag);
289  } // if
291 } // SquirrelObject::NewUserData
292 
293 BOOL_T SquirrelObject::GetUserData(const SQChar * key,SQUserPointer * data,SQUserPointer * typetag) {
294  BOOL_T ret = false;
295  if (GetSlot(key)) {
296  sq_getuserdata(SquirrelVM::_VM,-1,data,typetag);
297  sq_pop(SquirrelVM::_VM,1);
298  ret = true;
299  } // if
300  sq_pop(SquirrelVM::_VM,1);
301  return ret;
302 } // SquirrelObject::GetUserData
303 
304 BOOL_T SquirrelObject::RawGetUserData(const SQChar * key,SQUserPointer * data,SQUserPointer * typetag) {
305  BOOL_T ret = false;
306  if (RawGetSlot(key)) {
307  sq_getuserdata(SquirrelVM::_VM,-1,data,typetag);
308  sq_pop(SquirrelVM::_VM,1);
309  ret = true;
310  } // if
311  sq_pop(SquirrelVM::_VM,1);
312  return ret;
313 } // SquirrelObject::RawGetUserData
314 
315 // === END User Pointer ===
316 
317 // === BEGIN Arrays ===
318 
319 BOOL_T SquirrelObject::ArrayResize(INT_T newSize) {
320 // SQInteger top = sq_gettop(SquirrelVM::_VM);
321  sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
322  BOOL_T res = sq_arrayresize(SquirrelVM::_VM,-1,newSize) == SQ_OK;
323  sq_pop(SquirrelVM::_VM,1);
324 // sq_settop(SquirrelVM::_VM,top);
325  return res;
326 } // SquirrelObject::ArrayResize
327 
328 BOOL_T SquirrelObject::ArrayExtend(INT_T amount) {
329  SQInteger newLen = Len()+amount;
330  return ArrayResize(newLen);
331 } // SquirrelObject::ArrayExtend
332 
333 BOOL_T SquirrelObject::ArrayReverse(void) {
334  sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
335  BOOL_T res = sq_arrayreverse(SquirrelVM::_VM,-1) == SQ_OK;
336  sq_pop(SquirrelVM::_VM,1);
337  return res;
338 } // SquirrelObject::ArrayReverse
339 
340 SquirrelObject SquirrelObject::ArrayPop(SQBool returnPoppedVal) {
341  SquirrelObject ret;
342  SQInteger top = sq_gettop(SquirrelVM::_VM);
343  sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
344  if (sq_arraypop(SquirrelVM::_VM,-1,returnPoppedVal) == SQ_OK) {
345  if (returnPoppedVal) {
346  ret.AttachToStackObject(-1);
347  } // if
348  } // if
349  sq_settop(SquirrelVM::_VM,top);
350  return ret;
351 } // SquirrelObject::ArrayPop
352 
353 // === END Arrays ===
354 
355 SQObjectType SquirrelObject::GetType()
356 {
357  return _o._type;
358 }
359 
360 BOOL_T SquirrelObject::GetSlot(INT_T key) const
361 {
362  sq_pushobject(SquirrelVM::_VM,_o);
363  sq_pushinteger(SquirrelVM::_VM,key);
364  if(SQ_SUCCEEDED(sq_get(SquirrelVM::_VM,-2))) {
365  return TRUE;
366  }
367 
368  return FALSE;
369 }
370 
371 
372 SquirrelObject SquirrelObject::GetValue(INT_T key)const
373 {
374  SquirrelObject ret;
375  if(GetSlot(key)) {
376  ret.AttachToStackObject(-1);
377  sq_pop(SquirrelVM::_VM,1);
378  }
379  sq_pop(SquirrelVM::_VM,1);
380  return ret;
381 }
382 
383 FLOAT_T SquirrelObject::GetFloat(INT_T key) const
384 {
385  FLOAT_T ret = 0.0f;
386  if(GetSlot(key)) {
387  sq_getfloat(SquirrelVM::_VM,-1,&ret);
388  sq_pop(SquirrelVM::_VM,1);
389  }
390  sq_pop(SquirrelVM::_VM,1);
391  return ret;
392 }
393 
394 INT_T SquirrelObject::GetInt(INT_T key) const
395 {
396  INT_T ret = 0;
397  if(GetSlot(key)) {
398  sq_getinteger(SquirrelVM::_VM,-1,&ret);
399  sq_pop(SquirrelVM::_VM,1);
400  }
401  sq_pop(SquirrelVM::_VM,1);
402  return ret;
403 }
404 
405 const SQChar *SquirrelObject::GetString(INT_T key) const
406 {
407  const SQChar *ret = NULL;
408  if(GetSlot(key)) {
409  sq_getstring(SquirrelVM::_VM,-1,&ret);
410  sq_pop(SquirrelVM::_VM,1);
411  }
412  sq_pop(SquirrelVM::_VM,1);
413  return ret;
414 }
415 
416 bool SquirrelObject::GetBool(INT_T key) const
417 {
418  SQBool ret = FALSE;
419  if(GetSlot(key)) {
420  sq_getbool(SquirrelVM::_VM,-1,&ret);
421  sq_pop(SquirrelVM::_VM,1);
422  }
423  sq_pop(SquirrelVM::_VM,1);
424  return ret?true:false;
425 }
426 
427 BOOL_T SquirrelObject::Exists(const SQChar *key) const
428 {
429  BOOL_T ret = FALSE;
430  if(GetSlot(key)) {
431  ret = TRUE;
432  }
433  sq_pop(SquirrelVM::_VM,1);
434  return ret;
435 }
438 
439 BOOL_T SquirrelObject::GetSlot(const SQChar *name) const
440 {
441  sq_pushobject(SquirrelVM::_VM,_o);
442  sq_pushstring(SquirrelVM::_VM,name,-1);
443  if(SQ_SUCCEEDED(sq_get(SquirrelVM::_VM,-2))) {
444  return TRUE;
445  }
446 
447  return FALSE;
448 }
449 
450 BOOL_T SquirrelObject::RawGetSlot(const SQChar *name) const {
451  sq_pushobject(SquirrelVM::_VM,_o);
452  sq_pushstring(SquirrelVM::_VM,name,-1);
453  if(SQ_SUCCEEDED(sq_rawget(SquirrelVM::_VM,-2))) {
454  return TRUE;
455  }
456  return FALSE;
457 } // SquirrelObject::RawGetSlot
458 
459 SquirrelObject SquirrelObject::GetValue(const SQChar *key)const
460 {
461  SquirrelObject ret;
462  if(GetSlot(key)) {
463  ret.AttachToStackObject(-1);
464  sq_pop(SquirrelVM::_VM,1);
465  }
466  sq_pop(SquirrelVM::_VM,1);
467  return ret;
468 }
469 
470 FLOAT_T SquirrelObject::GetFloat(const SQChar *key) const
471 {
472  FLOAT_T ret = 0.0f;
473  if(GetSlot(key)) {
474  sq_getfloat(SquirrelVM::_VM,-1,&ret);
475  sq_pop(SquirrelVM::_VM,1);
476  }
477  sq_pop(SquirrelVM::_VM,1);
478  return ret;
479 }
480 
481 INT_T SquirrelObject::GetInt(const SQChar *key) const
482 {
483  INT_T ret = 0;
484  if(GetSlot(key)) {
485  sq_getinteger(SquirrelVM::_VM,-1,&ret);
486  sq_pop(SquirrelVM::_VM,1);
487  }
488  sq_pop(SquirrelVM::_VM,1);
489  return ret;
490 }
491 
492 const SQChar *SquirrelObject::GetString(const SQChar *key) const
493 {
494  const SQChar *ret = NULL;
495  if(GetSlot(key)) {
496  sq_getstring(SquirrelVM::_VM,-1,&ret);
497  sq_pop(SquirrelVM::_VM,1);
498  }
499  sq_pop(SquirrelVM::_VM,1);
500  return ret;
501 }
502 
503 bool SquirrelObject::GetBool(const SQChar *key) const
504 {
505  SQBool ret = FALSE;
506  if(GetSlot(key)) {
507  sq_getbool(SquirrelVM::_VM,-1,&ret);
508  sq_pop(SquirrelVM::_VM,1);
509  }
510  sq_pop(SquirrelVM::_VM,1);
511  return ret?true:false;
512 }
513 
514 SQUserPointer SquirrelObject::GetInstanceUP(SQUserPointer tag) const
515 {
516  SQUserPointer up;
517  sq_pushobject(SquirrelVM::_VM,_o);
518  if (SQ_FAILED(sq_getinstanceup(SquirrelVM::_VM,-1,(SQUserPointer*)&up,tag))) {
519  sq_reseterror(SquirrelVM::_VM);
520  up = NULL;
521  } // if
522  sq_pop(SquirrelVM::_VM,1);
523  return up;
524 }
525 
526 BOOL_T SquirrelObject::SetInstanceUP(SQUserPointer up)
527 {
528  if(!sq_isinstance(_o)) return FALSE;
529  sq_pushobject(SquirrelVM::_VM,_o);
530  sq_setinstanceup(SquirrelVM::_VM,-1,up);
531  sq_pop(SquirrelVM::_VM,1);
532  return TRUE;
533 }
534 
535 SquirrelObject SquirrelObject::GetAttributes(const SQChar *key)
536 {
537  SquirrelObject ret;
538  SQInteger top = sq_gettop(SquirrelVM::_VM);
539  sq_pushobject(SquirrelVM::_VM,_o);
540  if(key)
541  sq_pushstring(SquirrelVM::_VM,key,-1);
542  else
543  sq_pushnull(SquirrelVM::_VM);
544  if(SQ_SUCCEEDED(sq_getattributes(SquirrelVM::_VM,-2))) {
545  ret.AttachToStackObject(-1);
546  }
547  sq_settop(SquirrelVM::_VM,top);
548  return ret;
549 }
550 
551 BOOL_T SquirrelObject::BeginIteration()
552 {
553  if(!sq_istable(_o) && !sq_isarray(_o) && !sq_isclass(_o))
554  return FALSE;
555  sq_pushobject(SquirrelVM::_VM,_o);
556  sq_pushnull(SquirrelVM::_VM);
557  return TRUE;
558 }
559 
560 BOOL_T SquirrelObject::Next(SquirrelObject &key,SquirrelObject &val)
561 {
562  if(SQ_SUCCEEDED(sq_next(SquirrelVM::_VM,-2))) {
563  key.AttachToStackObject(-2);
564  val.AttachToStackObject(-1);
565  sq_pop(SquirrelVM::_VM,2);
566  return TRUE;
567  }
568  return FALSE;
569 }
570 
571 BOOL_T SquirrelObject::GetTypeTag(SQUserPointer * typeTag) {
572  if (SQ_SUCCEEDED(sq_getobjtypetag(&_o,typeTag))) {
573  return TRUE;
574  } // if
575  return FALSE;
576 } // SquirrelObject::GetTypeTag
577 
578 const SQChar * SquirrelObject::GetTypeName(const SQChar * key) {
579 #if 1
580  // This version will work even if SQ_SUPPORT_INSTANCE_TYPE_INFO is not enabled.
581  SqPlus::ScriptStringVar256 varNameTag;
582  SqPlus::getVarNameTag(varNameTag,sizeof(varNameTag),key);
583  SQUserPointer data=0;
584  if (!RawGetUserData(varNameTag,&data)) {
585  return NULL;
586  } // if
587  SqPlus::VarRefPtr vr = (SqPlus::VarRefPtr)data;
588  return vr->typeName;
589 #else // This version will only work if SQ_SUPPORT_INSTANCE_TYPE_INFO is enabled.
590  SquirrelObject so = GetValue(key);
591  if (so.IsNull()) return NULL;
592  return so.GetTypeName();
593 #endif
594 } // SquirrelObject::GetTypeName
595 
596 const SQChar * SquirrelObject::GetTypeName(INT_T key) {
597  SquirrelObject so = GetValue(key);
598  if (so.IsNull()) return NULL;
599  return so.GetTypeName();
600 } // SquirrelObject::GetTypeName
601 
602 const SQChar * SquirrelObject::GetTypeName(void) {
603  SQUserPointer typeTag=NULL;
604  if (SQ_SUCCEEDED(sq_getobjtypetag(&_o,&typeTag))) {
605  SquirrelObject typeTable = SquirrelVM::GetRootTable().GetValue(SQ_PLUS_TYPE_TABLE);
606  if (typeTable.IsNull()) {
607  return NULL; // Not compiled with SQ_SUPPORT_INSTANCE_TYPE_INFO enabled.
608  } // if
609  return typeTable.GetString(INT_T((size_t)typeTag));
610  } // if
611  return NULL;
612 } // SquirrelObject::GetTypeName
613 
614 const SQChar* SquirrelObject::ToString()
615 {
616  return sq_objtostring(&_o);
617 }
618 
619 SQInteger SquirrelObject::ToInteger()
620 {
621  return sq_objtointeger(&_o);
622 }
623 
624 SQFloat SquirrelObject::ToFloat()
625 {
626  return sq_objtofloat(&_o);
627 }
628 
629 bool SquirrelObject::ToBool()
630 {
631  //<<FIXME>>
632  return _o._unVal.nInteger?true:false;
633 }
634 
635 void SquirrelObject::EndIteration()
636 {
637  sq_pop(SquirrelVM::_VM,2);
638 }
639 
SQRESULT sq_get(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:840
SQRESULT sq_arraypop(HSQUIRRELVM v, SQInteger idx, SQBool pushval)
Definition: sqapi.cpp:273
SQRESULT sq_rawget(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:849
SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p, SQUserPointer typetag)
Definition: sqapi.cpp:647
SQRESULT sq_clone(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:555
void sq_pop(HSQUIRRELVM v, SQInteger nelemstopop)
Definition: sqapi.cpp:678
SQRESULT sq_getuserdata(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p, SQUserPointer *typetag)
Definition: sqapi.cpp:582
SQInteger IsNull(HSQUIRRELVM v)
Definition: sc_globals.cpp:44
SQRESULT sq_rawset(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:742
void sq_pushnull(HSQUIRRELVM v)
Definition: sqapi.cpp:190
void SetValue(WatchesProperty *prop)
Definition: watchesdlg.cpp:515
SQRESULT sq_arrayappend(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:263
void sq_pushfloat(HSQUIRRELVM v, SQFloat n)
Definition: sqapi.cpp:212
SQRESULT sq_getinteger(HSQUIRRELVM v, SQInteger idx, SQInteger *i)
Definition: sqapi.cpp:509
SQInteger sq_getsize(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:566
const SQChar * GetTypeName(const SQObjectPtr &obj1)
Definition: sqobject.cpp:43
SQInteger sq_gettop(HSQUIRRELVM v)
Definition: sqapi.cpp:664
#define _SETVALUE_INT_BEGIN
void sq_pushinteger(HSQUIRRELVM v, SQInteger n)
Definition: sqapi.cpp:202
SQRESULT sq_next(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:1205
#define _SETVALUE_INT_END
#define _SETVALUE_STR_END
SQBool sq_release(HSQUIRRELVM v, HSQOBJECT *po)
Definition: sqapi.cpp:147
void sq_settop(HSQUIRRELVM v, SQInteger newtop)
Definition: sqapi.cpp:669
void sq_reseterror(HSQUIRRELVM v)
Definition: sqapi.cpp:924
SQRESULT sq_arrayresize(HSQUIRRELVM v, SQInteger idx, SQInteger newsize)
Definition: sqapi.cpp:286
SQRESULT sq_getfloat(HSQUIRRELVM v, SQInteger idx, SQFloat *f)
Definition: sqapi.cpp:519
SQRESULT sq_getattributes(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:1119
SQRESULT sq_getobjtypetag(HSQOBJECT *o, SQUserPointer *typetag)
Definition: sqapi.cpp:602
void sq_pushstring(HSQUIRRELVM v, const SQChar *s, SQInteger len)
Definition: sqapi.cpp:195
SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p)
Definition: sqapi.cpp:629
SQRESULT sq_getstring(HSQUIRRELVM v, SQInteger idx, const SQChar **c)
Definition: sqapi.cpp:539
const SQChar * sq_objtostring(HSQOBJECT *o)
Definition: sqapi.cpp:158
SQRESULT sq_getuserpointer(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p)
Definition: sqapi.cpp:621
char SQChar
SQRESULT sq_getbool(HSQUIRRELVM v, SQInteger idx, SQBool *b)
Definition: sqapi.cpp:529
void sq_resetobject(HSQOBJECT *po)
Definition: sqapi.cpp:913
SQUserPointer sq_newuserdata(HSQUIRRELVM v, SQUnsignedInteger size)
Definition: sqapi.cpp:222
SQRESULT sq_settypetag(HSQUIRRELVM v, SQInteger idx, SQUserPointer typetag)
Definition: sqapi.cpp:591
void sq_pushbool(HSQUIRRELVM v, SQBool b)
Definition: sqapi.cpp:207
void sq_addref(HSQUIRRELVM v, HSQOBJECT *po)
Definition: sqapi.cpp:137
SQInteger sq_objtointeger(HSQOBJECT *o)
Definition: sqapi.cpp:166
SQRESULT sq_arrayreverse(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:299
SQRESULT sq_getdelegate(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:822
SQRESULT sq_getstackobj(HSQUIRRELVM v, SQInteger idx, HSQOBJECT *po)
Definition: sqapi.cpp:877
SQRESULT sq_setdelegate(HSQUIRRELVM v, SQInteger idx)
Definition: sqapi.cpp:776
#define NULL
Definition: prefix.cpp:59
void sq_pushobject(HSQUIRRELVM v, HSQOBJECT obj)
Definition: sqapi.cpp:908
SQFloat sq_objtofloat(HSQOBJECT *o)
Definition: sqapi.cpp:174
void sq_pushuserpointer(HSQUIRRELVM v, SQUserPointer p)
Definition: sqapi.cpp:217
#define _SETVALUE_STR_BEGIN