diff options
author | rubidium <rubidium@openttd.org> | 2009-02-25 01:21:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-25 01:21:50 +0000 |
commit | 1ad50ce4e6ed74c8eeb89a1f2780e6ed58a72b2b (patch) | |
tree | 0955433146cc59335ddaac1d6e08eb177a9ead61 /src/3rdparty/squirrel/include/sqstdio.h | |
parent | 66a8c0a1325e1f8717150dc6bbe1bcb4fb458bef (diff) | |
download | openttd-1ad50ce4e6ed74c8eeb89a1f2780e6ed58a72b2b.tar.xz |
(svn r15578) -Change: unexternalise squirrel.
Diffstat (limited to 'src/3rdparty/squirrel/include/sqstdio.h')
-rw-r--r-- | src/3rdparty/squirrel/include/sqstdio.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/3rdparty/squirrel/include/sqstdio.h b/src/3rdparty/squirrel/include/sqstdio.h new file mode 100644 index 000000000..5eaec31c6 --- /dev/null +++ b/src/3rdparty/squirrel/include/sqstdio.h @@ -0,0 +1,54 @@ +/* see copyright notice in squirrel.h */ +#ifndef _SQSTDIO_H_ +#define _SQSTDIO_H_ + +#ifdef __cplusplus + +#define SQSTD_STREAM_TYPE_TAG 0x80000000 + +struct SQStream { + virtual ~SQStream() {} + virtual SQInteger Read(void *buffer, SQInteger size) = 0; + virtual SQInteger Write(void *buffer, SQInteger size) = 0; + virtual SQInteger Flush() = 0; + virtual SQInteger Tell() = 0; + virtual SQInteger Len() = 0; + virtual SQInteger Seek(SQInteger offset, SQInteger origin) = 0; + virtual bool IsValid() = 0; + virtual bool EOS() = 0; +}; + +extern "C" { +#endif + +#define SQ_SEEK_CUR 0 +#define SQ_SEEK_END 1 +#define SQ_SEEK_SET 2 + +typedef void* SQFILE; + +SQUIRREL_API SQFILE sqstd_fopen(const SQChar *,const SQChar *); +SQUIRREL_API SQInteger sqstd_fread(SQUserPointer, SQInteger, SQInteger, SQFILE); +SQUIRREL_API SQInteger sqstd_fwrite(const SQUserPointer, SQInteger, SQInteger, SQFILE); +SQUIRREL_API SQInteger sqstd_fseek(SQFILE , SQInteger , SQInteger); +SQUIRREL_API SQInteger sqstd_ftell(SQFILE); +SQUIRREL_API SQInteger sqstd_fflush(SQFILE); +SQUIRREL_API SQInteger sqstd_fclose(SQFILE); +SQUIRREL_API SQInteger sqstd_feof(SQFILE); + +SQUIRREL_API SQRESULT sqstd_createfile(HSQUIRRELVM v, SQFILE file,SQBool own); +SQUIRREL_API SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file); + +//compiler helpers +SQUIRREL_API SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror); +SQUIRREL_API SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror); +SQUIRREL_API SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filename); + +SQUIRREL_API SQRESULT sqstd_register_iolib(HSQUIRRELVM v); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*_SQSTDIO_H_*/ + |