#define screname rename
#endif
-static int _system_getenv(HSQUIRRELVM v)
+static SQInteger _system_getenv(HSQUIRRELVM v)
{
const SQChar *s;
if(SQ_SUCCEEDED(sq_getstring(v,2,&s))){
}
-static int _system_system(HSQUIRRELVM v)
+static SQInteger _system_system(HSQUIRRELVM v)
{
const SQChar *s;
if(SQ_SUCCEEDED(sq_getstring(v,2,&s))){
}
-static int _system_clock(HSQUIRRELVM v)
+static SQInteger _system_clock(HSQUIRRELVM v)
{
sq_pushfloat(v,((SQFloat)clock())/(SQFloat)CLOCKS_PER_SEC);
return 1;
}
-static int _system_time(HSQUIRRELVM v)
+static SQInteger _system_time(HSQUIRRELVM v)
{
time_t t;
time(&t);
return 1;
}
-static int _system_remove(HSQUIRRELVM v)
+static SQInteger _system_remove(HSQUIRRELVM v)
{
const SQChar *s;
sq_getstring(v,2,&s);
return 0;
}
-static int _system_rename(HSQUIRRELVM v)
+static SQInteger _system_rename(HSQUIRRELVM v)
{
const SQChar *oldn,*newn;
sq_getstring(v,2,&oldn);
sq_rawset(v,-3);
}
-static int _system_date(HSQUIRRELVM v)
+static SQInteger _system_date(HSQUIRRELVM v)
{
time_t t;
+ SQInteger it;
SQInteger format = 'l';
if(sq_gettop(v) > 1) {
- sq_getinteger(v,2,(SQInteger*)&t);
+ sq_getinteger(v,2,&it);
+ t = it;
if(sq_gettop(v) > 2) {
sq_getinteger(v,3,(SQInteger*)&format);
}
_DECL_FUNC(date,-1,_SC(".nn")),
_DECL_FUNC(remove,2,_SC(".s")),
_DECL_FUNC(rename,3,_SC(".ss")),
- {0,0,0,0}
+ {0,0}
};
-int sqstd_register_systemlib(HSQUIRRELVM v)
+SQInteger sqstd_register_systemlib(HSQUIRRELVM v)
{
- int i=0;
+ SQInteger i=0;
while(systemlib_funcs[i].name!=0)
{
sq_pushstring(v,systemlib_funcs[i].name,-1);