Code::Blocks
SVN r11506
|
#include <new>
#include <stdio.h>
#include <squirrel.h>
#include <sqstdio.h>
#include "sqstdstream.h"
Go to the source code of this file.
Classes | |
struct | SQFile |
Macros | |
#define | SQSTD_FILE_TYPE_TAG (SQSTD_STREAM_TYPE_TAG | 0x00000001) |
#define | _DECL_FILE_FUNC(name, nparams, typecheck) {_SC(#name),_file_##name,nparams,typecheck} |
#define | READ() |
#define | _DECL_GLOBALIO_FUNC(name, nparams, typecheck) {_SC(#name),_g_io_##name,nparams,typecheck} |
Functions | |
SQFILE | sqstd_fopen (const SQChar *filename, const SQChar *mode) |
SQInteger | sqstd_fread (void *buffer, SQInteger size, SQInteger count, SQFILE file) |
SQInteger | sqstd_fwrite (const SQUserPointer buffer, SQInteger size, SQInteger count, SQFILE file) |
SQInteger | sqstd_fseek (SQFILE file, SQInteger offset, SQInteger origin) |
SQInteger | sqstd_ftell (SQFILE file) |
SQInteger | sqstd_fflush (SQFILE file) |
SQInteger | sqstd_fclose (SQFILE file) |
SQInteger | sqstd_feof (SQFILE file) |
static SQInteger | _file__typeof (HSQUIRRELVM v) |
static SQInteger | _file_releasehook (SQUserPointer p, SQInteger) |
static SQInteger | _file_constructor (HSQUIRRELVM v) |
SQRESULT | sqstd_createfile (HSQUIRRELVM v, SQFILE file, SQBool own) |
SQRESULT | sqstd_getfile (HSQUIRRELVM v, SQInteger idx, SQFILE *file) |
static SQInteger | _io_file_lexfeed_ASCII (SQUserPointer file) |
static SQInteger | _io_file_lexfeed_UTF8 (SQUserPointer file) |
static SQInteger | _io_file_lexfeed_UCS2_LE (SQUserPointer file) |
static SQInteger | _io_file_lexfeed_UCS2_BE (SQUserPointer file) |
SQInteger | file_read (SQUserPointer file, SQUserPointer buf, SQInteger size) |
SQInteger | file_write (SQUserPointer file, SQUserPointer p, SQInteger size) |
SQRESULT | sqstd_loadfile (HSQUIRRELVM v, const SQChar *filename, SQBool printerror) |
SQRESULT | sqstd_dofile (HSQUIRRELVM v, const SQChar *filename, SQBool retval, SQBool printerror) |
SQRESULT | sqstd_writeclosuretofile (HSQUIRRELVM v, const SQChar *filename) |
SQInteger | _g_io_loadfile (HSQUIRRELVM v) |
SQInteger | _g_io_writeclosuretofile (HSQUIRRELVM v) |
SQInteger | _g_io_dofile (HSQUIRRELVM v) |
SQRESULT | sqstd_register_iolib (HSQUIRRELVM v) |
Variables | |
static SQRegFunction | _file_methods [] |
static SQRegFunction | iolib_funcs [] |
#define _DECL_FILE_FUNC | ( | name, | |
nparams, | |||
typecheck | |||
) | {_SC(#name),_file_##name,nparams,typecheck} |
Definition at line 152 of file sqstdio.cpp.
#define _DECL_GLOBALIO_FUNC | ( | name, | |
nparams, | |||
typecheck | |||
) | {_SC(#name),_g_io_##name,nparams,typecheck} |
Definition at line 387 of file sqstdio.cpp.
#define READ | ( | ) |
Referenced by _io_file_lexfeed_UTF8().
#define SQSTD_FILE_TYPE_TAG (SQSTD_STREAM_TYPE_TAG | 0x00000001) |
Definition at line 8 of file sqstdio.cpp.
Referenced by sqstd_getfile(), and sqstd_register_iolib().
|
static |
Definition at line 111 of file sqstdio.cpp.
References sq_pushstring().
|
static |
Definition at line 125 of file sqstdio.cpp.
References _file_releasehook(), sq_getstring(), sq_gettype(), sq_getuserpointer(), sq_setinstanceup(), sq_setreleasehook(), sq_throwerror(), SQFile::SQFile(), and sqstd_fopen().
|
static |
Definition at line 118 of file sqstdio.cpp.
Referenced by _file_constructor().
SQInteger _g_io_dofile | ( | HSQUIRRELVM | v | ) |
Definition at line 373 of file sqstdio.cpp.
References sq_getbool(), sq_getstring(), sq_gettop(), sq_push(), and sqstd_dofile().
SQInteger _g_io_loadfile | ( | HSQUIRRELVM | v | ) |
Definition at line 351 of file sqstdio.cpp.
References sq_getbool(), sq_getstring(), sq_gettop(), and sqstd_loadfile().
SQInteger _g_io_writeclosuretofile | ( | HSQUIRRELVM | v | ) |
Definition at line 364 of file sqstdio.cpp.
References sq_getstring(), and sqstd_writeclosuretofile().
|
static |
Definition at line 197 of file sqstdio.cpp.
References sqstd_fread().
Referenced by sqstd_loadfile().
|
static |
Definition at line 252 of file sqstdio.cpp.
References sqstd_fread().
Referenced by sqstd_loadfile().
|
static |
Definition at line 243 of file sqstdio.cpp.
References sqstd_fread().
Referenced by sqstd_loadfile().
|
static |
SQInteger file_read | ( | SQUserPointer | file, |
SQUserPointer | buf, | ||
SQInteger | size | ||
) |
Definition at line 263 of file sqstdio.cpp.
References sqstd_fread().
Referenced by sqstd_loadfile().
SQInteger file_write | ( | SQUserPointer | file, |
SQUserPointer | p, | ||
SQInteger | size | ||
) |
Definition at line 270 of file sqstdio.cpp.
References sqstd_fwrite().
Referenced by sqstd_writeclosuretofile().
SQRESULT sqstd_createfile | ( | HSQUIRRELVM | v, |
SQFILE | file, | ||
SQBool | own | ||
) |
Definition at line 161 of file sqstdio.cpp.
References sq_call(), sq_get(), sq_gettop(), sq_pushinteger(), sq_pushnull(), sq_pushregistrytable(), sq_pushroottable(), sq_pushstring(), sq_pushuserpointer(), sq_remove(), and sq_settop().
Referenced by sqstd_register_iolib().
SQRESULT sqstd_dofile | ( | HSQUIRRELVM | v, |
const SQChar * | filename, | ||
SQBool | retval, | ||
SQBool | printerror | ||
) |
Definition at line 326 of file sqstdio.cpp.
References sq_call(), sq_pop(), sq_push(), sq_remove(), and sqstd_loadfile().
Referenced by _g_io_dofile().
SQInteger sqstd_fclose | ( | SQFILE | file | ) |
Definition at line 51 of file sqstdio.cpp.
Referenced by SQFile::Close(), sqstd_loadfile(), and sqstd_writeclosuretofile().
SQInteger sqstd_feof | ( | SQFILE | file | ) |
Definition at line 56 of file sqstdio.cpp.
SQInteger sqstd_fflush | ( | SQFILE | file | ) |
Definition at line 46 of file sqstdio.cpp.
Referenced by SQFile::Flush().
Definition at line 10 of file sqstdio.cpp.
Referenced by _file_constructor(), SQFile::Open(), sqstd_loadfile(), and sqstd_writeclosuretofile().
SQInteger sqstd_fread | ( | void * | buffer, |
SQInteger | size, | ||
SQInteger | count, | ||
SQFILE | file | ||
) |
Definition at line 19 of file sqstdio.cpp.
Referenced by _io_file_lexfeed_ASCII(), _io_file_lexfeed_UCS2_BE(), _io_file_lexfeed_UCS2_LE(), file_read(), SQFile::Read(), and sqstd_loadfile().
SQInteger sqstd_fseek | ( | SQFILE | file, |
SQInteger | offset, | ||
SQInteger | origin | ||
) |
Definition at line 29 of file sqstdio.cpp.
Referenced by SQFile::Seek(), and sqstd_loadfile().
SQInteger sqstd_ftell | ( | SQFILE | file | ) |
Definition at line 41 of file sqstdio.cpp.
Referenced by SQFile::Tell().
SQInteger sqstd_fwrite | ( | const SQUserPointer | buffer, |
SQInteger | size, | ||
SQInteger | count, | ||
SQFILE | file | ||
) |
Definition at line 24 of file sqstdio.cpp.
Referenced by file_write(), and SQFile::Write().
SQRESULT sqstd_getfile | ( | HSQUIRRELVM | v, |
SQInteger | idx, | ||
SQFILE * | file | ||
) |
Definition at line 185 of file sqstdio.cpp.
References NULL, sq_getinstanceup(), sq_throwerror(), and SQSTD_FILE_TYPE_TAG.
SQRESULT sqstd_loadfile | ( | HSQUIRRELVM | v, |
const SQChar * | filename, | ||
SQBool | printerror | ||
) |
Definition at line 275 of file sqstdio.cpp.
References _io_file_lexfeed_ASCII(), _io_file_lexfeed_UCS2_BE(), _io_file_lexfeed_UCS2_LE(), _io_file_lexfeed_UTF8(), file_read(), sq_compile(), sq_readclosure(), sq_throwerror(), sqstd_fclose(), sqstd_fopen(), sqstd_fread(), and sqstd_fseek().
Referenced by _g_io_loadfile(), and sqstd_dofile().
SQRESULT sqstd_register_iolib | ( | HSQUIRRELVM | v | ) |
Definition at line 395 of file sqstdio.cpp.
References _file_methods, declare_stream(), iolib_funcs, sq_gettop(), sq_pushstring(), sq_settop(), sqstd_createfile(), and SQSTD_FILE_TYPE_TAG.
SQRESULT sqstd_writeclosuretofile | ( | HSQUIRRELVM | v, |
const SQChar * | filename | ||
) |
Definition at line 339 of file sqstdio.cpp.
References file_write(), sq_throwerror(), sq_writeclosure(), sqstd_fclose(), and sqstd_fopen().
Referenced by _g_io_writeclosuretofile().
|
static |
Definition at line 153 of file sqstdio.cpp.
Referenced by sqstd_register_iolib().
|
static |
Definition at line 388 of file sqstdio.cpp.
Referenced by sqstd_register_iolib().