2 see copyright notice in squirrel.h
\r
4 #include "sqpcheader.h"
\r
6 #include "sqstring.h"
\r
9 #include "sqfuncproto.h"
\r
10 #include "sqclosure.h"
\r
11 #include "sqclass.h"
\r
16 bool str2num(const SQChar *s,SQObjectPtr &res)
\r
19 if(scstrstr(s,_SC("."))){
\r
20 SQFloat r = SQFloat(scstrtod(s,&end));
\r
21 if(s == end) return false;
\r
22 while (scisspace((*end)) ) end++;
\r
23 if (*end != _SC('\0')) return false;
\r
28 const SQChar *t = s;
\r
29 while(*t != _SC('\0')) if(!scisdigit(*t++)) return false;
\r
30 res = SQInteger(scatoi(s));
\r
35 #ifndef NO_GARBAGE_COLLECTOR
\r
36 static int base_collectgarbage(HSQUIRRELVM v)
\r
38 sq_pushinteger(v, sq_collectgarbage(v));
\r
43 static int base_getroottable(HSQUIRRELVM v)
\r
45 v->Push(v->_roottable);
\r
49 static int base_setroottable(HSQUIRRELVM v)
\r
51 SQObjectPtr &o=stack_get(v,2);
\r
52 if(SQ_FAILED(sq_setroottable(v))) return SQ_ERROR;
\r
57 static int base_seterrorhandler(HSQUIRRELVM v)
\r
59 sq_seterrorhandler(v);
\r
63 static int base_setdebughook(HSQUIRRELVM v)
\r
69 static int base_enabledebuginfo(HSQUIRRELVM v)
\r
71 SQObjectPtr &o=stack_get(v,2);
\r
72 sq_enabledebuginfo(v,(type(o) != OT_NULL)?1:0);
\r
76 static int base_getstackinfos(HSQUIRRELVM v)
\r
81 const SQChar *name = NULL;
\r
82 sq_getinteger(v, -1, &level);
\r
83 if (SQ_SUCCEEDED(sq_stackinfos(v, level, &si)))
\r
85 const SQChar *fn = _SC("unknown");
\r
86 const SQChar *src = _SC("unknown");
\r
87 if(si.funcname)fn = si.funcname;
\r
88 if(si.source)src = si.source;
\r
90 sq_pushstring(v, _SC("func"), -1);
\r
91 sq_pushstring(v, fn, -1);
\r
92 sq_createslot(v, -3);
\r
93 sq_pushstring(v, _SC("src"), -1);
\r
94 sq_pushstring(v, src, -1);
\r
95 sq_createslot(v, -3);
\r
96 sq_pushstring(v, _SC("line"), -1);
\r
97 sq_pushinteger(v, si.line);
\r
98 sq_createslot(v, -3);
\r
99 sq_pushstring(v, _SC("locals"), -1);
\r
102 while (name = sq_getlocal(v, level, seq)) {
\r
103 sq_pushstring(v, name, -1);
\r
105 sq_createslot(v, -4);
\r
109 sq_createslot(v, -3);
\r
116 static int base_assert(HSQUIRRELVM v)
\r
118 if(v->IsFalse(stack_get(v,2))){
\r
119 return sq_throwerror(v,_SC("assertion failed"));
\r
124 static int get_slice_params(HSQUIRRELVM v,int &sidx,int &eidx,SQObjectPtr &o)
\r
126 int top = sq_gettop(v);
\r
130 SQObjectPtr &start=stack_get(v,2);
\r
131 if(type(start)!=OT_NULL && sq_isnumeric(start)){
\r
132 sidx=tointeger(start);
\r
135 SQObjectPtr &end=stack_get(v,3);
\r
136 if(sq_isnumeric(end)){
\r
137 eidx=tointeger(end);
\r
141 eidx = sq_getsize(v,1);
\r
146 static int base_print(HSQUIRRELVM v)
\r
148 SQObjectPtr &o=stack_get(v,2);
\r
151 if(_ss(v)->_printfunc) _ss(v)->_printfunc(v,_SC("%s"),_stringval(o));
\r
154 if(_ss(v)->_printfunc) _ss(v)->_printfunc(v,_SC("%d"),_integer(o));
\r
157 if(_ss(v)->_printfunc) _ss(v)->_printfunc(v,_SC("%.14g"),_float(o));
\r
161 v->TypeOf(o,tname);
\r
162 if(_ss(v)->_printfunc) _ss(v)->_printfunc(v,_SC("(%s)"),_stringval(tname));
\r
169 static int base_compilestring(HSQUIRRELVM v)
\r
171 int nargs=sq_gettop(v);
\r
172 const SQChar *src=NULL,*name=_SC("unnamedbuffer");
\r
174 sq_getstring(v,2,&src);
\r
175 size=sq_getsize(v,2);
\r
177 sq_getstring(v,3,&name);
\r
179 if(SQ_SUCCEEDED(sq_compilebuffer(v,src,size,name,SQFalse)))
\r
185 static int base_newthread(HSQUIRRELVM v)
\r
187 SQObjectPtr &func = stack_get(v,2);
\r
188 int stksize = (_funcproto(_closure(func)->_function)->_stacksize << 1) +2;
\r
189 HSQUIRRELVM newv = sq_newthread(v, (stksize < MIN_STACK_OVERHEAD + 2)? MIN_STACK_OVERHEAD + 2 : stksize);
\r
190 sq_move(newv,v,-2);
\r
194 static int base_suspend(HSQUIRRELVM v)
\r
196 return sq_suspendvm(v);
\r
199 static int base_array(HSQUIRRELVM v)
\r
202 SQObject &size = stack_get(v,2);
\r
203 if(sq_gettop(v) > 2) {
\r
204 a = SQArray::Create(_ss(v),0);
\r
205 a->Resize(tointeger(size),stack_get(v,3));
\r
208 a = SQArray::Create(_ss(v),tointeger(size));
\r
214 static int base_type(HSQUIRRELVM v)
\r
216 SQObjectPtr &o = stack_get(v,2);
\r
217 v->Push(SQString::Create(_ss(v),GetTypeName(o),-1));
\r
221 static SQRegFunction base_funcs[]={
\r
223 {_SC("seterrorhandler"),base_seterrorhandler,2, NULL},
\r
224 {_SC("setdebughook"),base_setdebughook,2, NULL},
\r
225 {_SC("enabledebuginfo"),base_enabledebuginfo,2, NULL},
\r
226 {_SC("getstackinfos"),base_getstackinfos,2, _SC(".n")},
\r
227 {_SC("getroottable"),base_getroottable,1, NULL},
\r
228 {_SC("setroottable"),base_setroottable,2, NULL},
\r
229 {_SC("assert"),base_assert,2, NULL},
\r
230 {_SC("print"),base_print,2, NULL},
\r
231 {_SC("compilestring"),base_compilestring,-2, _SC(".ss")},
\r
232 {_SC("newthread"),base_newthread,2, _SC(".c")},
\r
233 {_SC("suspend"),base_suspend,-1, NULL},
\r
234 {_SC("array"),base_array,-2, _SC(".n")},
\r
235 {_SC("type"),base_type,2, NULL},
\r
236 #ifndef NO_GARBAGE_COLLECTOR
\r
237 {_SC("collectgarbage"),base_collectgarbage,1, _SC("t")},
\r
242 void sq_base_register(HSQUIRRELVM v)
\r
245 sq_pushroottable(v);
\r
246 while(base_funcs[i].name!=0) {
\r
247 sq_pushstring(v,base_funcs[i].name,-1);
\r
248 sq_newclosure(v,base_funcs[i].f,0);
\r
249 sq_setnativeclosurename(v,-1,base_funcs[i].name);
\r
250 sq_setparamscheck(v,base_funcs[i].nparamscheck,base_funcs[i].typemask);
\r
251 sq_createslot(v,-3);
\r
254 sq_pushstring(v,_SC("_charsize_"),-1);
\r
255 sq_pushinteger(v,sizeof(SQChar));
\r
256 sq_createslot(v,-3);
\r
260 static int default_delegate_len(HSQUIRRELVM v)
\r
262 v->Push(SQInteger(sq_getsize(v,1)));
\r
266 static int default_delegate_tofloat(HSQUIRRELVM v)
\r
268 SQObjectPtr &o=stack_get(v,1);
\r
272 if(str2num(_stringval(o),res)){
\r
273 v->Push(SQObjectPtr(tofloat(res)));
\r
276 case OT_INTEGER:case OT_FLOAT:
\r
277 v->Push(SQObjectPtr(tofloat(o)));
\r
280 v->Push(SQObjectPtr((SQFloat)(_integer(o)?1:0)));
\r
289 static int default_delegate_tointeger(HSQUIRRELVM v)
\r
291 SQObjectPtr &o=stack_get(v,1);
\r
295 if(str2num(_stringval(o),res)){
\r
296 v->Push(SQObjectPtr(tointeger(res)));
\r
299 case OT_INTEGER:case OT_FLOAT:
\r
300 v->Push(SQObjectPtr(tointeger(o)));
\r
303 v->Push(SQObjectPtr(_integer(o)?1:0));
\r
312 static int default_delegate_tostring(HSQUIRRELVM v)
\r
314 SQObjectPtr &o=stack_get(v,1);
\r
320 scsprintf(_ss(v)->GetScratchPad(rsl(NUMBER_MAX_CHAR+1)),_SC("%d"),_integer(o));
\r
321 v->Push(SQString::Create(_ss(v),_ss(v)->GetScratchPad(-1)));
\r
324 scsprintf(_ss(v)->GetScratchPad(rsl(NUMBER_MAX_CHAR+1)),_SC("%.14g"),_float(o));
\r
325 v->Push(SQString::Create(_ss(v),_ss(v)->GetScratchPad(-1)));
\r
328 v->Push(SQObjectPtr(SQString::Create(_ss(v),_integer(o)?_SC("true"):_SC("false"))));
\r
337 static int number_delegate_tochar(HSQUIRRELVM v)
\r
339 SQObject &o=stack_get(v,1);
\r
340 SQChar c=tointeger(o);
\r
341 v->Push(SQString::Create(_ss(v),(const SQChar *)&c,1));
\r
346 /////////////////////////////////////////////////////////////////
\r
347 //TABLE DEFAULT DELEGATE
\r
349 static int table_rawdelete(HSQUIRRELVM v)
\r
351 if(SQ_FAILED(sq_rawdeleteslot(v,1,SQTrue)))
\r
357 static int container_rawexists(HSQUIRRELVM v)
\r
359 if(SQ_SUCCEEDED(sq_rawget(v,-2))) {
\r
360 sq_pushbool(v,SQTrue);
\r
363 sq_pushbool(v,SQFalse);
\r
367 static int table_rawset(HSQUIRRELVM v)
\r
369 return sq_rawset(v,-3);
\r
373 static int table_rawget(HSQUIRRELVM v)
\r
375 return SQ_SUCCEEDED(sq_rawget(v,-2))?1:SQ_ERROR;
\r
378 SQRegFunction SQSharedState::_table_default_delegate_funcz[]={
\r
379 {_SC("len"),default_delegate_len,1, _SC("t")},
\r
380 {_SC("rawget"),table_rawget,2, _SC("t")},
\r
381 {_SC("rawset"),table_rawset,3, _SC("t")},
\r
382 {_SC("rawdelete"),table_rawdelete,2, _SC("t")},
\r
383 {_SC("rawin"),container_rawexists,2, _SC("t")},
\r
387 //ARRAY DEFAULT DELEGATE///////////////////////////////////////
\r
389 static int array_append(HSQUIRRELVM v)
\r
391 return sq_arrayappend(v,-2);
\r
394 static int array_extend(HSQUIRRELVM v)
\r
396 _array(stack_get(v,1))->Extend(_array(stack_get(v,2)));
\r
400 static int array_reverse(HSQUIRRELVM v)
\r
402 return sq_arrayreverse(v,-1);
\r
405 static int array_pop(HSQUIRRELVM v)
\r
407 return SQ_SUCCEEDED(sq_arraypop(v,1,SQTrue))?1:SQ_ERROR;
\r
410 static int array_top(HSQUIRRELVM v)
\r
412 SQObject &o=stack_get(v,1);
\r
413 if(_array(o)->Size()>0){
\r
414 v->Push(_array(o)->Top());
\r
417 else return sq_throwerror(v,_SC("top() on a empty array"));
\r
420 static int array_insert(HSQUIRRELVM v)
\r
422 SQObject &o=stack_get(v,1);
\r
423 SQObject &idx=stack_get(v,2);
\r
424 SQObject &val=stack_get(v,3);
\r
425 _array(o)->Insert(idx,val);
\r
429 static int array_remove(HSQUIRRELVM v)
\r
431 SQObject &o = stack_get(v, 1);
\r
432 SQObject &idx = stack_get(v, 2);
\r
433 if(!sq_isnumeric(idx)) return sq_throwerror(v, _SC("wrong type"));
\r
435 if(_array(o)->Get(tointeger(idx), val)) {
\r
436 _array(o)->Remove(tointeger(idx));
\r
440 return sq_throwerror(v, _SC("idx out of range"));
\r
443 static int array_resize(HSQUIRRELVM v)
\r
445 SQObject &o = stack_get(v, 1);
\r
446 SQObject &nsize = stack_get(v, 2);
\r
448 if(sq_isnumeric(nsize)) {
\r
449 if(sq_gettop(v) > 2)
\r
450 fill = stack_get(v, 3);
\r
451 _array(o)->Resize(tointeger(nsize),fill);
\r
454 return sq_throwerror(v, _SC("size must be a number"));
\r
458 //QSORT ala Sedgewick
\r
459 bool _qsort_compare(HSQUIRRELVM v,SQObjectPtr &arr,SQObjectPtr &a,SQObjectPtr &b,int func,int &ret)
\r
462 if(!v->ObjCmp(a,b,ret)) return false;
\r
465 int top = sq_gettop(v);
\r
467 sq_pushroottable(v);
\r
470 if(SQ_FAILED(sq_call(v, 3, SQTrue))) {
\r
471 v->Raise_Error(_SC("compare func failed"));
\r
474 sq_getinteger(v, -1, &ret);
\r
480 //QSORT ala Sedgewick
\r
481 bool _qsort(HSQUIRRELVM v,SQObjectPtr &arr, int l, int r,int func)
\r
484 SQArray *a=_array(arr);
\r
485 SQObjectPtr pivot,t;
\r
487 pivot = a->_values[l];
\r
494 if(!_qsort_compare(v,arr,a->_values[i],pivot,func,ret))
\r
496 } while( ret <= 0);
\r
499 if(!_qsort_compare(v,arr,a->_values[j],pivot,func,ret))
\r
503 if( i >= j ) break;
\r
504 t = a->_values[i]; a->_values[i] = a->_values[j]; a->_values[j] = t;
\r
506 t = a->_values[l]; a->_values[l] = a->_values[j]; a->_values[j] = t;
\r
507 if(!_qsort( v, arr, l, j-1,func)) return false;
\r
508 if(!_qsort( v, arr, j+1, r,func)) return false;
\r
513 static int array_sort(HSQUIRRELVM v)
\r
517 SQObjectPtr &o = stack_get(v,1);
\r
518 SQObject &funcobj = stack_get(v,2);
\r
519 if(_array(o)->Size() > 1) {
\r
520 if(type(funcobj) == OT_CLOSURE || type(funcobj) == OT_NATIVECLOSURE) func = 2;
\r
521 if(!_qsort(v, o, 0, _array(o)->Size()-1, func))
\r
527 static int array_slice(HSQUIRRELVM v)
\r
531 if(get_slice_params(v,sidx,eidx,o)==-1)return -1;
\r
532 if(sidx<0)sidx=_array(o)->Size()+sidx;
\r
533 if(eidx<0)eidx=_array(o)->Size()+eidx;
\r
534 if(eidx <= sidx)return sq_throwerror(v,_SC("wrong indexes"));
\r
535 SQArray *arr=SQArray::Create(_ss(v),eidx-sidx);
\r
538 for(int i=sidx;i<eidx;i++){
\r
539 _array(o)->Get(i,t);
\r
540 arr->Set(count++,t);
\r
547 SQRegFunction SQSharedState::_array_default_delegate_funcz[]={
\r
548 {_SC("len"),default_delegate_len,1, _SC("a")},
\r
549 {_SC("append"),array_append,2, _SC("a")},
\r
550 {_SC("extend"),array_extend,2, _SC("aa")},
\r
551 {_SC("push"),array_append,2, _SC("a")},
\r
552 {_SC("pop"),array_pop,1, _SC("a")},
\r
553 {_SC("top"),array_top,1, _SC("a")},
\r
554 {_SC("insert"),array_insert,3, _SC("an")},
\r
555 {_SC("remove"),array_remove,2, _SC("an")},
\r
556 {_SC("resize"),array_resize,-2, _SC("an")},
\r
557 {_SC("reverse"),array_reverse,1, _SC("a")},
\r
558 {_SC("sort"),array_sort,-1, _SC("ac")},
\r
559 {_SC("slice"),array_slice,-1, _SC("ann")},
\r
563 //STRING DEFAULT DELEGATE//////////////////////////
\r
564 static int string_slice(HSQUIRRELVM v)
\r
568 if(SQ_FAILED(get_slice_params(v,sidx,eidx,o)))return -1;
\r
569 if(sidx<0)sidx=_string(o)->_len+sidx;
\r
570 if(eidx<0)eidx=_string(o)->_len+eidx;
\r
572 return sq_throwerror(v,_SC("wrong indexes"));
\r
573 v->Push(SQString::Create(_ss(v),&_stringval(o)[sidx],eidx-sidx));
\r
577 static int string_find(HSQUIRRELVM v)
\r
579 int top,start_idx=0;
\r
580 const SQChar *str,*substr,*ret;
\r
581 if(((top=sq_gettop(v))>1) && SQ_SUCCEEDED(sq_getstring(v,1,&str)) && SQ_SUCCEEDED(sq_getstring(v,2,&substr))){
\r
582 if(top>2)sq_getinteger(v,3,&start_idx);
\r
583 if((sq_getsize(v,1)>start_idx) && (start_idx>=0)){
\r
584 ret=scstrstr(&str[start_idx],substr);
\r
586 sq_pushinteger(v,(int)(ret-str));
\r
592 return sq_throwerror(v,_SC("invalid param"));
\r
595 #define STRING_TOFUNCZ(func) static int string_##func(HSQUIRRELVM v) \
\r
597 SQObject str=stack_get(v,1); \
\r
598 int len=_string(str)->_len; \
\r
599 const SQChar *sThis=_stringval(str); \
\r
600 SQChar *sNew=(_ss(v)->GetScratchPad(rsl(len))); \
\r
601 for(int i=0;i<len;i++) sNew[i]=func(sThis[i]); \
\r
602 v->Push(SQString::Create(_ss(v),sNew,len)); \
\r
607 STRING_TOFUNCZ(tolower)
\r
608 STRING_TOFUNCZ(toupper)
\r
610 SQRegFunction SQSharedState::_string_default_delegate_funcz[]={
\r
611 {_SC("len"),default_delegate_len,1, _SC("s")},
\r
612 {_SC("tointeger"),default_delegate_tointeger,1, _SC("s")},
\r
613 {_SC("tofloat"),default_delegate_tofloat,1, _SC("s")},
\r
614 {_SC("tostring"),default_delegate_tostring,1, _SC("s")},
\r
615 {_SC("slice"),string_slice,-1, _SC(" s n n")},
\r
616 {_SC("find"),string_find,-2, _SC("s s n ")},
\r
617 {_SC("tolower"),string_tolower,1, _SC("s")},
\r
618 {_SC("toupper"),string_toupper,1, _SC("s")},
\r
622 //INTEGER DEFAULT DELEGATE//////////////////////////
\r
623 SQRegFunction SQSharedState::_number_default_delegate_funcz[]={
\r
624 {_SC("tointeger"),default_delegate_tointeger,1, _SC("n|b")},
\r
625 {_SC("tofloat"),default_delegate_tofloat,1, _SC("n|b")},
\r
626 {_SC("tostring"),default_delegate_tostring,1, _SC("n|b")},
\r
627 {_SC("tochar"),number_delegate_tochar,1, _SC("n|b")},
\r
631 //CLOSURE DEFAULT DELEGATE//////////////////////////
\r
632 static int closure_call(HSQUIRRELVM v)
\r
634 return SQ_SUCCEEDED(sq_call(v,sq_gettop(v)-1,SQTrue))?1:SQ_ERROR;
\r
637 static int closure_acall(HSQUIRRELVM v)
\r
639 SQArray *aparams=_array(stack_get(v,2));
\r
640 int nparams=aparams->Size();
\r
641 v->Push(stack_get(v,1));
\r
642 for(int i=0;i<nparams;i++)v->Push(aparams->_values[i]);
\r
643 return SQ_SUCCEEDED(sq_call(v,nparams,SQTrue))?1:SQ_ERROR;
\r
646 SQRegFunction SQSharedState::_closure_default_delegate_funcz[]={
\r
647 {_SC("call"),closure_call,-1, _SC("c")},
\r
648 {_SC("acall"),closure_acall,2, _SC("ca")},
\r
652 //GENERATOR DEFAULT DELEGATE
\r
653 static int generator_getstatus(HSQUIRRELVM v)
\r
655 SQObject &o=stack_get(v,1);
\r
656 switch(_generator(o)->_state){
\r
657 case SQGenerator::eSuspended:v->Push(SQString::Create(_ss(v),_SC("suspended")));break;
\r
658 case SQGenerator::eRunning:v->Push(SQString::Create(_ss(v),_SC("running")));break;
\r
659 case SQGenerator::eDead:v->Push(SQString::Create(_ss(v),_SC("dead")));break;
\r
664 SQRegFunction SQSharedState::_generator_default_delegate_funcz[]={
\r
665 {_SC("getstatus"),generator_getstatus,1, _SC("g")},
\r
669 //THREAD DEFAULT DELEGATE
\r
671 static int thread_call(HSQUIRRELVM v)
\r
673 SQObjectPtr o = stack_get(v,1);
\r
674 if(type(o) == OT_THREAD) {
\r
675 int nparams = sq_gettop(v);
\r
676 _thread(o)->Push(_thread(o)->_roottable);
\r
677 for(int i = 2; i<(nparams+1); i++)
\r
678 sq_move(_thread(o),v,i);
\r
679 if(SQ_SUCCEEDED(sq_call(_thread(o),nparams,SQTrue))) {
\r
680 sq_move(v,_thread(o),-1);
\r
685 return sq_throwerror(v,_SC("wrong parameter"));
\r
688 static int thread_wakeup(HSQUIRRELVM v)
\r
690 SQObjectPtr o = stack_get(v,1);
\r
691 if(type(o) == OT_THREAD) {
\r
692 SQVM *thread = _thread(o);
\r
693 int state = sq_getvmstate(thread);
\r
694 if(state != SQ_VMSTATE_SUSPENDED) {
\r
696 case SQ_VMSTATE_IDLE:
\r
697 return sq_throwerror(v,_SC("cannot wakeup a idle thread"));
\r
699 case SQ_VMSTATE_RUNNING:
\r
700 return sq_throwerror(v,_SC("cannot wakeup a running thread"));
\r
705 int wakeupret = sq_gettop(v)>1?1:0;
\r
707 sq_move(thread,v,2);
\r
709 if(SQ_SUCCEEDED(sq_wakeupvm(thread,wakeupret,1))) {
\r
710 sq_move(v,thread,-1);
\r
712 if(sq_getvmstate(thread) == SQ_VMSTATE_IDLE) {
\r
719 return sq_throwerror(v,_SC("wrong parameter"));
\r
722 static int thread_getstatus(HSQUIRRELVM v)
\r
724 SQObjectPtr &o = stack_get(v,1);
\r
725 switch(sq_getvmstate(_thread(o))) {
\r
726 case SQ_VMSTATE_IDLE:
\r
727 sq_pushstring(v,_SC("idle"),-1);
\r
729 case SQ_VMSTATE_RUNNING:
\r
730 sq_pushstring(v,_SC("running"),-1);
\r
732 case SQ_VMSTATE_SUSPENDED:
\r
733 sq_pushstring(v,_SC("suspended"),-1);
\r
736 return sq_throwerror(v,_SC("internal VM error"));
\r
741 SQRegFunction SQSharedState::_thread_default_delegate_funcz[] = {
\r
742 {_SC("call"), thread_call, -1, _SC("v")},
\r
743 {_SC("wakeup"), thread_wakeup, -1, _SC("v")},
\r
744 {_SC("getstatus"), thread_getstatus, 1, _SC("v")},
\r
748 static int class_getattributes(HSQUIRRELVM v)
\r
750 if(SQ_SUCCEEDED(sq_getattributes(v,-2)))
\r
755 static int class_setattributes(HSQUIRRELVM v)
\r
757 if(SQ_SUCCEEDED(sq_setattributes(v,-3)))
\r
762 SQRegFunction SQSharedState::_class_default_delegate_funcz[] = {
\r
763 {_SC("getattributes"), class_getattributes, 2, _SC("y.")},
\r
764 {_SC("setattributes"), class_setattributes, 3, _SC("y..")},
\r
765 {_SC("rawin"),container_rawexists,2, _SC("y")},
\r
769 static int instance_getclass(HSQUIRRELVM v)
\r
771 if(SQ_SUCCEEDED(sq_getclass(v,1)))
\r
776 SQRegFunction SQSharedState::_instance_default_delegate_funcz[] = {
\r
777 {_SC("getclass"), instance_getclass, 1, _SC("x")},
\r
778 {_SC("rawin"),container_rawexists,2, _SC("x")},
\r