/usr/include/codeblocks/scripting/sqplus/SqPlusConst.h is in codeblocks-dev 10.05-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | // SqPlusConst.h
// SqPlus constant type and constant member function support created by Simon Michelmore.
// Modular integration 11/14/05 jcs.
#ifdef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
#undef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
// Kamaitati's NULL_INSTANCE support. 5/28/06 jcs
#ifdef SQPLUS_SUPPORT_NULL_INSTANCES
#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
namespace SqPlus { \
inline void Push(HSQUIRRELVM v,const TYPE * value) { \
if (!value) sq_pushnull(v); \
else if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) \
throw SquirrelError(sqT("Push(): could not create INSTANCE (check registration name)")); } \
inline void Push(HSQUIRRELVM v,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(sqT("Push(): could not create INSTANCE copy (check registration name)")); } \
inline bool Match(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return GetInstance<TYPE,false>(v,idx) != NULL; } \
inline const TYPE & Get(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return *GetInstance<TYPE,true>(v,idx); } \
} // nameSpace SqPlus
#else
#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
namespace SqPlus { \
inline void Push(HSQUIRRELVM v,const TYPE * value) { if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) throw SquirrelError(sqT("Push(): could not create INSTANCE (check registration name)")); } \
inline void Push(HSQUIRRELVM v,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(sqT("Push(): could not create INSTANCE copy (check registration name)")); } \
inline bool Match(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return GetInstance<TYPE,false>(v,idx) != NULL; } \
inline const TYPE & Get(TypeWrapper<const TYPE &>,HSQUIRRELVM v,int idx) { return *GetInstance<TYPE,true>(v,idx); } \
} // nameSpace SqPlus
#endif
#define DECLARE_INSTANCE_TYPE(TYPE) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,TYPE)
#define DECLARE_INSTANCE_TYPE_NAME(TYPE,NAME) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME)
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_RET0
#undef SQPLUS_CALL_CONST_MFUNC_RET0
template <typename Callee>
static int Call(Callee & callee,RT (Callee::*func)() const,HSQUIRRELVM v,int /*index*/) {
RT ret = (callee.*func)();
Push(v,ret);
return 1;
}
template <typename Callee,typename P1>
static int Call(Callee & callee,RT (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5)
);
Push(v,ret);
return 1;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
sq_argassert(7,index + 6);
RT ret = (callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5),
Get(TypeWrapper<P7>(),v,index + 6)
);
Push(v,ret);
return 1;
}
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_NORET
#undef SQPLUS_CALL_CONST_MFUNC_NORET
template<typename Callee>
static int Call(Callee & callee,void (Callee::*func)() const,HSQUIRRELVM,int /*index*/) {
(callee.*func)();
return 0;
}
template<typename Callee,typename P1>
static int Call(Callee & callee,void (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0)
);
return 0;
}
template<typename Callee,typename P1,typename P2>
static int Call(Callee & callee,void (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5)
);
return 0;
}
template<typename Callee,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
sq_argassert(1,index + 0);
sq_argassert(2,index + 1);
sq_argassert(3,index + 2);
sq_argassert(4,index + 3);
sq_argassert(5,index + 4);
sq_argassert(6,index + 5);
sq_argassert(7,index + 6);
(callee.*func)(
Get(TypeWrapper<P1>(),v,index + 0),
Get(TypeWrapper<P2>(),v,index + 1),
Get(TypeWrapper<P3>(),v,index + 2),
Get(TypeWrapper<P4>(),v,index + 3),
Get(TypeWrapper<P5>(),v,index + 4),
Get(TypeWrapper<P6>(),v,index + 5),
Get(TypeWrapper<P7>(),v,index + 6)
);
return 0;
}
#endif
#ifdef SQPLUS_CALL_CONST_MFUNC_RET1
#undef SQ_REG_CONST_STATIC_VAR
template<typename Callee,typename RT>
int Call(Callee & callee, RT (Callee::*func)() const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1>
int Call(Callee & callee,RT (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2>
int Call(Callee & callee,RT (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
template<typename Callee,typename RT,typename P1,typename P2,typename P3,typename P4,typename P5,typename P6,typename P7>
int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
return ReturnSpecialization<RT>::Call(callee,func,v,index);
}
#undef SQPLUS_CALL_CONST_MFUNC_RET1
#endif
#ifdef SQ_REG_CONST_STATIC_VAR
template<typename VarType>
SQClassDef & staticVar(const VarType * pvar,const SQChar * name,VarAccessType access=VAR_ACCESS_READ_ONLY) {
struct CV {
const VarType * var;
} cv; // Cast Variable helper.
cv.var = pvar;
RegisterInstanceVariable(newClass,ClassType<TClassType>::type(),*(VarType **)&cv,name,VarAccessType(access|VAR_ACCESS_STATIC));
return *this;
} // staticVar
#endif
// SqPlusConst.h
|