Code::Blocks  SVN r11506
SquirrelBindingsUtilsWin32.cpp
Go to the documentation of this file.
1 //#include "sqplus.h"
2 
3 //#include "SquirrelObject.h"
4 //#include "SquirrelVM.h"
5 #include "SquirrelBindingsUtilsWin32.h"
6 
7 // C::B patch: Comment out unused variable
8 SQInteger refcounted_release_hook(SQUserPointer p, SQInteger /* size */)
9 {
10  IUnknown *pRC = (IUnknown*)p;
11  pRC->Release();
12  return 0;
13 }
14 
15 static BOOL __CreateRefCountedInstance(HSQUIRRELVM v,const SQChar *classname,IUnknown *pRC,SQRELEASEHOOK hook)
16 {
17  if(!CreateNativeClassInstance(v,classname,pRC,hook)) return FALSE;
18  return TRUE;
19 }
20 
21 SQInteger construct_RefCounted(IUnknown *p)
22 {
23  sq_setinstanceup(SquirrelVM::GetVMPtr(),1,p);
24  sq_setreleasehook(SquirrelVM::GetVMPtr(),1,refcounted_release_hook);
25  return 1;
26 }
27 
28 
29 BOOL CreateRefCountedInstance(HSQUIRRELVM v,const SQChar *classname,IUnknown *pRC)
30 {
32 }
BOOL_T CreateNativeClassInstance(HSQUIRRELVM v, const SQChar *classname, SQUserPointer ud, SQRELEASEHOOK hook)
SQInteger refcounted_release_hook(SQUserPointer p, SQInteger)
BOOL CreateRefCountedInstance(HSQUIRRELVM v, const SQChar *classname, IUnknown *pRC)
SQInteger construct_RefCounted(IUnknown *p)
SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p)
Definition: sqapi.cpp:629
char SQChar
void sq_setreleasehook(HSQUIRRELVM v, SQInteger idx, SQRELEASEHOOK hook)
Definition: sqapi.cpp:999
static BOOL __CreateRefCountedInstance(HSQUIRRELVM v, const SQChar *classname, IUnknown *pRC, SQRELEASEHOOK hook)