Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SGS/CPP-BC
- // warning: do not modify this file, it may be regenerated during any build
- // generated: 10/27/13 18:26:46
- #include "thing.h"
- static int _sgs_method__thing__getTotalSize( SGS_CTX )
- {
- int method_call = sgs_Method( C );
- sgs_FuncName( C, method_call ? "thing.getTotalSize" : "thing_getTotalSize" );
- if( !sgs_IsObject( C, 0, thing::_sgs_interface ) )
- return sgs_ArgErrorExt( C, 0, method_call, "thing", "" );
- thing* data = static_cast<thing*>( sgs_GetObjectData( C, 0 ) );
- sgs_PushVar(C,data->getTotalSize());
- return 1;
- }
- static int _sgs_method__thing__addThing( SGS_CTX )
- {
- int method_call = sgs_Method( C );
- sgs_FuncName( C, method_call ? "thing.addThing" : "thing_addThing" );
- if( !sgs_IsObject( C, 0, thing::_sgs_interface ) )
- return sgs_ArgErrorExt( C, 0, method_call, "thing", "" );
- thing* data = static_cast<thing*>( sgs_GetObjectData( C, 0 ) );
- data->addThing(sgs_GetVar<thing>(C,1,true));
- return 0;
- }
- int thing::_sgs_getindex( SGS_CTX, sgs_VarObj* obj, int param )
- {
- char* name;
- if( sgs_ParseString( C, 0, &name, NULL ) )
- {
- if( strcmp( name, "getTotalSize" ) == 0 )
- {
- sgs_PushCFunction( C, _sgs_method__thing__getTotalSize );
- return SGS_SUCCESS;
- }
- if( strcmp( name, "addThing" ) == 0 )
- {
- sgs_PushCFunction( C, _sgs_method__thing__addThing );
- return SGS_SUCCESS;
- }
- if( strcmp( name, "size" ) == 0 )
- {
- sgs_PushVar( C, static_cast<thing*>( obj->data )->size );
- return SGS_SUCCESS;
- }
- }
- return SGS_ENOTFND;
- }
- int thing::_sgs_setindex( SGS_CTX, sgs_VarObj* obj, int param )
- {
- char* name;
- if( sgs_ParseString( C, 0, &name, NULL ) )
- {
- if( strcmp( name, "size" ) == 0 )
- {
- static_cast<thing*>( obj->data )->size = sgs_GetVar<int>( C, 1 );
- return SGS_SUCCESS;
- }
- }
- return SGS_ENOTFND;
- }
- int thing::_sgs_convert( SGS_CTX, sgs_VarObj* obj, int param )
- {
- if( param == SGS_CONVOP_TOTYPE || param == SGS_VT_STRING )
- {
- sgs_PushString( C, "thing" );
- return SGS_SUCCESS;
- }
- return SGS_ENOTSUP;
- }
- sgs_ObjCallback thing::_sgs_interface[] =
- {
- SGS_OP_GETINDEX, thing::_sgs_getindex,
- SGS_OP_SETINDEX, thing::_sgs_setindex,
- SGS_OP_CONVERT, thing::_sgs_convert,
- SGS_OP_END
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement