diff --git a/.gitignore b/.gitignore index 012ac34..0d20b64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -# Folders created at compilation -bin/ -lib/ - -# Folders created at documentation generation -doc/ +*.pyc diff --git a/sq/sq.c b/cmdLine/rabbit.cpp similarity index 91% rename from sq/sq.c rename to cmdLine/rabbit.cpp index e089d99..6b1e4a3 100644 --- a/sq/sq.c +++ b/cmdLine/rabbit.cpp @@ -1,4 +1,10 @@ -/* see copyright notice in squirrel.h */ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ #include #include @@ -9,13 +15,13 @@ #include #include #endif -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #ifdef SQUNICODE #define scfprintf fwprintf @@ -29,9 +35,13 @@ void PrintVersionInfos(); #if defined(_MSC_VER) && defined(_DEBUG) -int MemAllocHook( int allocType, void *userData, size_t size, int blockType, - long requestNumber, const unsigned char *filename, int lineNumber) -{ +int MemAllocHook(int allocType, + void *userData, + size_t size, + int blockType, + long requestNumber, + const unsigned char *filename, + int lineNumber) { //if(requestNumber==769)_asm int 3; return 1; } @@ -71,7 +81,7 @@ void PrintUsage() { scfprintf(stderr,_SC("usage: sq .\n") _SC("Available options are:\n") - _SC(" -c compiles the file to bytecode(default output 'out.cnut')\n") + _SC(" -c compiles the file to bytecode(default output 'out.karrot')\n") _SC(" -o specifies output file for the -c option\n") _SC(" -c compiles only\n") _SC(" -d generates debug infos\n") @@ -103,7 +113,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval) { switch(argv[arg][1]) { - case 'd': //DEBUG(debug infos) + case 'd': sq_enabledebuginfo(v,1); break; case 'c': @@ -154,7 +164,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval) //sq_pop(v,1); if(compiles_only) { if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,SQTrue))){ - const SQChar *outfile = _SC("out.cnut"); + const SQChar *outfile = _SC("out.karrot"); if(output) { #ifdef SQUNICODE int len = (int)(strlen(output)+1); @@ -243,7 +253,7 @@ void Interactive(HSQUIRRELVM v) while (!done) { SQInteger i = 0; - scprintf(_SC("\nsq>")); + scprintf(_SC("\nrabbit> ")); for(;;) { int c; if(done)return; diff --git a/etc/minimal.c b/etc/minimal.cpp similarity index 100% rename from etc/minimal.c rename to etc/minimal.cpp diff --git a/etc/test.nut b/etc/test.carrot similarity index 100% rename from etc/test.nut rename to etc/test.carrot diff --git a/include/sqstdaux.h b/include/sqstdaux.h deleted file mode 100644 index 7396add..0000000 --- a/include/sqstdaux.h +++ /dev/null @@ -1,16 +0,0 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_AUXLIB_H_ -#define _SQSTD_AUXLIB_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v); -SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* _SQSTD_AUXLIB_H_ */ diff --git a/include/sqstdmath.h b/include/sqstdmath.h deleted file mode 100644 index 3c611f0..0000000 --- a/include/sqstdmath.h +++ /dev/null @@ -1,15 +0,0 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_MATH_H_ -#define _SQSTD_MATH_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*_SQSTD_MATH_H_*/ diff --git a/include/sqstdsystem.h b/include/sqstdsystem.h deleted file mode 100644 index 8c82328..0000000 --- a/include/sqstdsystem.h +++ /dev/null @@ -1,15 +0,0 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_SYSTEMLIB_H_ -#define _SQSTD_SYSTEMLIB_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* _SQSTD_SYSTEMLIB_H_ */ diff --git a/lutin_rabbit-core.py b/lutin_rabbit-core.py new file mode 100644 index 0000000..32a9d06 --- /dev/null +++ b/lutin_rabbit-core.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +import lutin.debug as debug +import lutin.tools as tools +import os + + +def get_type(): + return "LIBRARY" + +def get_desc(): + return "rabbit script interpreter" + +def get_licence(): + return "MIT" + +def get_compagny_type(): + return "org" + +def get_compagny_name(): + return "rabbit" + +def get_maintainer(): + return ["Edouard DUPIN "] + +def get_version(): + return [0,1] + +def configure(target, my_module): + my_module.add_src_file([ + 'rabbit/sqmem.cpp', + 'rabbit/sqbaselib.cpp', + 'rabbit/sqapi.cpp', + 'rabbit/sqlexer.cpp', + 'rabbit/sqclass.cpp', + 'rabbit/sqvm.cpp', + 'rabbit/sqtable.cpp', + 'rabbit/sqstate.cpp', + 'rabbit/sqobject.cpp', + 'rabbit/sqcompiler.cpp', + 'rabbit/sqdebug.cpp', + 'rabbit/sqfuncstate.cpp', + ]) + my_module.compile_version("c++", 2011) + my_module.add_depend([ + 'z', + 'm', + 'c' + ]) + my_module.add_header_file([ + 'rabbit/sqclass.hpp', + 'rabbit/sqvm.hpp', + 'rabbit/sqstate.hpp', + 'rabbit/rabbit.hpp', + 'rabbit/sqobject.hpp', + 'rabbit/sqopcodes.hpp', + 'rabbit/squserdata.hpp', + 'rabbit/squtils.hpp', + 'rabbit/sqpcheader.hpp', + 'rabbit/sqfuncproto.hpp', + 'rabbit/sqconfig.hpp', + 'rabbit/sqcompiler.hpp', + 'rabbit/sqarray.hpp', + 'rabbit/sqclosure.hpp', + 'rabbit/sqlexer.hpp', + 'rabbit/sqfuncstate.hpp', + 'rabbit/sqstring.hpp', + 'rabbit/sqtable.hpp', + ]) + return True + + diff --git a/lutin_rabbit-std.py b/lutin_rabbit-std.py new file mode 100644 index 0000000..cb5c2ec --- /dev/null +++ b/lutin_rabbit-std.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +import lutin.debug as debug +import lutin.tools as tools +import os + + +def get_type(): + return "LIBRARY" + +def get_desc(): + return "rabbit script interpreter (std wrapping)" + +def get_licence(): + return "MIT" + +def get_compagny_type(): + return "org" + +def get_compagny_name(): + return "rabbit" + +def get_maintainer(): + return ["Edouard DUPIN "] + +def get_version(): + return [0,1] + +def configure(target, my_module): + my_module.add_src_file([ + 'rabbit-std/sqstdaux.cpp', + 'rabbit-std/sqstdstream.cpp', + 'rabbit-std/sqstdrex.cpp', + 'rabbit-std/sqstdsystem.cpp', + 'rabbit-std/sqstdio.cpp', + 'rabbit-std/sqstdblob.cpp', + 'rabbit-std/sqstdmath.cpp', + 'rabbit-std/sqstdstring.cpp', + ]) + my_module.compile_version("c++", 2011) + my_module.add_depend([ + 'rabbit-core' + ]) + my_module.add_header_file([ + 'rabbit-std/sqstdstring.hpp', + 'rabbit-std/sqstdmath.hpp', + 'rabbit-std/sqstdaux.hpp', + 'rabbit-std/sqstdsystem.hpp', + 'rabbit-std/sqstdblobimpl.hpp', + 'rabbit-std/sqstdstream.hpp', + 'rabbit-std/sqstdio.hpp', + 'rabbit-std/sqstdblob.hpp', + ]) + return True + + diff --git a/lutin_rabbit.py b/lutin_rabbit.py new file mode 100644 index 0000000..bd48bf7 --- /dev/null +++ b/lutin_rabbit.py @@ -0,0 +1,40 @@ +#!/usr/bin/python +import lutin.debug as debug +import lutin.tools as tools +import os + + +def get_type(): + return "BINARY" + +def get_desc(): + return "rabbit command line interpreter" + +def get_licence(): + return "MIT" + +def get_compagny_type(): + return "org" + +def get_compagny_name(): + return "rabbit" + +def get_maintainer(): + return ["Edouard DUPIN "] + +def get_version(): + return [0,1] + +def configure(target, my_module): + my_module.add_src_file([ + 'cmdLine/rabbit.cpp', + ]) + my_module.compile_version("c++", 2011) + my_module.add_depend([ + 'rabbit-core', + 'rabbit-std', + 'cxx', + ]) + return True + + diff --git a/sqstdlib/sqstdaux.cpp b/rabbit-std/sqstdaux.cpp similarity index 93% rename from sqstdlib/sqstdaux.cpp rename to rabbit-std/sqstdaux.cpp index e56ef66..3eac5ff 100644 --- a/sqstdlib/sqstdaux.cpp +++ b/rabbit-std/sqstdaux.cpp @@ -1,6 +1,13 @@ -/* see copyright notice in squirrel.h */ -#include -#include +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include +#include #include void sqstd_printcallstack(HSQUIRRELVM v) diff --git a/rabbit-std/sqstdaux.hpp b/rabbit-std/sqstdaux.hpp new file mode 100644 index 0000000..4887b7a --- /dev/null +++ b/rabbit-std/sqstdaux.hpp @@ -0,0 +1,11 @@ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v); +SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v); diff --git a/sqstdlib/sqstdblob.cpp b/rabbit-std/sqstdblob.cpp similarity index 97% rename from sqstdlib/sqstdblob.cpp rename to rabbit-std/sqstdblob.cpp index 3b7edcf..7a9f89c 100644 --- a/sqstdlib/sqstdblob.cpp +++ b/rabbit-std/sqstdblob.cpp @@ -1,11 +1,11 @@ -/* see copyright notice in squirrel.h */ +/* see copyright notice in rabbit.hpp */ #include -#include -#include +#include +#include #include -#include -#include "sqstdstream.h" -#include "sqstdblobimpl.h" +#include +#include +#include #define SQSTD_BLOB_TYPE_TAG ((SQUnsignedInteger)(SQSTD_STREAM_TYPE_TAG | 0x00000002)) diff --git a/include/sqstdblob.h b/rabbit-std/sqstdblob.hpp similarity index 56% rename from include/sqstdblob.h rename to rabbit-std/sqstdblob.hpp index cd7ce56..83eef05 100644 --- a/include/sqstdblob.h +++ b/rabbit-std/sqstdblob.hpp @@ -1,10 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTDBLOB_H_ -#define _SQSTDBLOB_H_ - -#ifdef __cplusplus -extern "C" { -#endif +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size); SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr); @@ -12,9 +13,3 @@ SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx); SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v); -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*_SQSTDBLOB_H_*/ - diff --git a/sqstdlib/sqstdblobimpl.h b/rabbit-std/sqstdblobimpl.hpp similarity index 92% rename from sqstdlib/sqstdblobimpl.h rename to rabbit-std/sqstdblobimpl.hpp index bfdaddc..60c8cad 100644 --- a/sqstdlib/sqstdblobimpl.h +++ b/rabbit-std/sqstdblobimpl.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_BLOBIMPL_H_ -#define _SQSTD_BLOBIMPL_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once struct SQBlob : public SQStream { @@ -105,4 +110,3 @@ private: bool _owns; }; -#endif //_SQSTD_BLOBIMPL_H_ diff --git a/sqstdlib/sqstdio.cpp b/rabbit-std/sqstdio.cpp similarity index 97% rename from sqstdlib/sqstdio.cpp rename to rabbit-std/sqstdio.cpp index a8dd3ed..7c992a0 100644 --- a/sqstdlib/sqstdio.cpp +++ b/rabbit-std/sqstdio.cpp @@ -1,9 +1,16 @@ -/* see copyright notice in squirrel.h */ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + #include #include -#include -#include -#include "sqstdstream.h" +#include +#include +#include #define SQSTD_FILE_TYPE_TAG ((SQUnsignedInteger)(SQSTD_STREAM_TYPE_TAG | 0x00000001)) //basic API diff --git a/include/sqstdio.h b/rabbit-std/sqstdio.hpp similarity index 86% rename from include/sqstdio.h rename to rabbit-std/sqstdio.hpp index fbc7451..d76c5bb 100644 --- a/include/sqstdio.h +++ b/rabbit-std/sqstdio.hpp @@ -1,8 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTDIO_H_ -#define _SQSTDIO_H_ - -#ifdef __cplusplus +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #define SQSTD_STREAM_TYPE_TAG 0x80000000 @@ -18,9 +21,6 @@ struct SQStream { virtual bool EOS() = 0; }; -extern "C" { -#endif - #define SQ_SEEK_CUR 0 #define SQ_SEEK_END 1 #define SQ_SEEK_SET 2 @@ -46,9 +46,3 @@ SQUIRREL_API SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filen SQUIRREL_API SQRESULT sqstd_register_iolib(HSQUIRRELVM v); -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*_SQSTDIO_H_*/ - diff --git a/sqstdlib/sqstdmath.cpp b/rabbit-std/sqstdmath.cpp similarity index 90% rename from sqstdlib/sqstdmath.cpp rename to rabbit-std/sqstdmath.cpp index a0329bc..0076e26 100644 --- a/sqstdlib/sqstdmath.cpp +++ b/rabbit-std/sqstdmath.cpp @@ -1,8 +1,15 @@ -/* see copyright notice in squirrel.h */ -#include +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #include #include -#include +#include #define SINGLE_ARG_FUNC(_funcname) static SQInteger math_##_funcname(HSQUIRRELVM v){ \ SQFloat f; \ diff --git a/rabbit-std/sqstdmath.hpp b/rabbit-std/sqstdmath.hpp new file mode 100644 index 0000000..c8bb04e --- /dev/null +++ b/rabbit-std/sqstdmath.hpp @@ -0,0 +1,11 @@ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v); + diff --git a/sqstdlib/sqstdrex.cpp b/rabbit-std/sqstdrex.cpp similarity index 98% rename from sqstdlib/sqstdrex.cpp rename to rabbit-std/sqstdrex.cpp index cd91fa0..9f8eb0d 100644 --- a/sqstdlib/sqstdrex.cpp +++ b/rabbit-std/sqstdrex.cpp @@ -1,9 +1,16 @@ -/* see copyright notice in squirrel.h */ -#include +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #include #include #include -#include +#include #ifdef _DEBUG #include diff --git a/sqstdlib/sqstdstream.cpp b/rabbit-std/sqstdstream.cpp similarity index 95% rename from sqstdlib/sqstdstream.cpp rename to rabbit-std/sqstdstream.cpp index 28cefa9..a94a0e4 100644 --- a/sqstdlib/sqstdstream.cpp +++ b/rabbit-std/sqstdstream.cpp @@ -1,13 +1,20 @@ -/* see copyright notice in squirrel.h */ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + #include #include #include #include -#include -#include -#include -#include "sqstdstream.h" -#include "sqstdblobimpl.h" +#include +#include +#include +#include +#include #define SETUP_STREAM(v) \ SQStream *self = NULL; \ diff --git a/sqstdlib/sqstdstream.h b/rabbit-std/sqstdstream.hpp similarity index 74% rename from sqstdlib/sqstdstream.h rename to rabbit-std/sqstdstream.hpp index 867c135..a7b5efd 100644 --- a/sqstdlib/sqstdstream.h +++ b/rabbit-std/sqstdstream.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_STREAM_H_ -#define _SQSTD_STREAM_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once SQInteger _stream_readblob(HSQUIRRELVM v); SQInteger _stream_readline(HSQUIRRELVM v); @@ -15,4 +20,3 @@ SQInteger _stream_flush(HSQUIRRELVM v); #define _DECL_STREAM_FUNC(name,nparams,typecheck) {_SC(#name),_stream_##name,nparams,typecheck} SQRESULT declare_stream(HSQUIRRELVM v,const SQChar* name,SQUserPointer typetag,const SQChar* reg_name,const SQRegFunction *methods,const SQRegFunction *globals); -#endif /*_SQSTD_STREAM_H_*/ diff --git a/sqstdlib/sqstdstring.cpp b/rabbit-std/sqstdstring.cpp similarity index 98% rename from sqstdlib/sqstdstring.cpp rename to rabbit-std/sqstdstring.cpp index 4414e60..6ef1442 100644 --- a/sqstdlib/sqstdstring.cpp +++ b/rabbit-std/sqstdstring.cpp @@ -1,6 +1,13 @@ -/* see copyright notice in squirrel.h */ -#include -#include +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include +#include #include #include #include diff --git a/include/sqstdstring.h b/rabbit-std/sqstdstring.hpp similarity index 80% rename from include/sqstdstring.h rename to rabbit-std/sqstdstring.hpp index e7ecbed..7671e20 100644 --- a/include/sqstdstring.h +++ b/rabbit-std/sqstdstring.hpp @@ -1,10 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTD_STRING_H_ -#define _SQSTD_STRING_H_ - -#ifdef __cplusplus -extern "C" { -#endif +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once typedef unsigned int SQRexBool; typedef struct SQRex SQRex; @@ -26,8 +27,3 @@ SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQIn SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v); -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*_SQSTD_STRING_H_*/ diff --git a/sqstdlib/sqstdsystem.cpp b/rabbit-std/sqstdsystem.cpp similarity index 92% rename from sqstdlib/sqstdsystem.cpp rename to rabbit-std/sqstdsystem.cpp index 6f56852..e3fc67c 100644 --- a/sqstdlib/sqstdsystem.cpp +++ b/rabbit-std/sqstdsystem.cpp @@ -1,9 +1,16 @@ -/* see copyright notice in squirrel.h */ -#include +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #include #include #include -#include +#include #ifdef SQUNICODE #include diff --git a/rabbit-std/sqstdsystem.hpp b/rabbit-std/sqstdsystem.hpp new file mode 100644 index 0000000..f04ae5f --- /dev/null +++ b/rabbit-std/sqstdsystem.hpp @@ -0,0 +1,10 @@ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v); diff --git a/include/squirrel.h b/rabbit/rabbit.hpp similarity index 92% rename from include/squirrel.h rename to rabbit/rabbit.hpp index c4c3383..2d7340b 100644 --- a/include/squirrel.h +++ b/rabbit/rabbit.hpp @@ -1,26 +1,11 @@ -/* -Copyright (c) 2003-2017 Alberto Demichelis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -#ifndef _SQUIRREL_H_ -#define _SQUIRREL_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #ifdef _SQ_CONFIG_INCLUDE #include _SQ_CONFIG_INCLUDE @@ -63,12 +48,12 @@ struct SQOuter; #define SQUNICODE #endif -#include "sqconfig.h" +#include "sqconfig.hpp" -#define SQUIRREL_VERSION _SC("Squirrel 3.1 stable") +#define SQUIRREL_VERSION _SC("Rabbit 0.1 un-stable") #define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2017 Alberto Demichelis") -#define SQUIRREL_AUTHOR _SC("Alberto Demichelis") -#define SQUIRREL_VERSION_NUMBER 310 +#define SQUIRREL_AUTHOR _SC("Edouard DUPIN") +#define SQUIRREL_VERSION_NUMBER 010 #define SQ_VMSTATE_IDLE 0 #define SQ_VMSTATE_RUNNING 1 @@ -408,4 +393,3 @@ SQUIRREL_API void sq_setnativedebughook(HSQUIRRELVM v,SQDEBUGHOOK hook); } /*extern "C"*/ #endif -#endif /*_SQUIRREL_H_*/ diff --git a/squirrel/sqapi.cpp b/rabbit/sqapi.cpp similarity index 98% rename from squirrel/sqapi.cpp rename to rabbit/sqapi.cpp index e4e8276..8d84927 100644 --- a/squirrel/sqapi.cpp +++ b/rabbit/sqapi.cpp @@ -1,17 +1,21 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqvm.h" -#include "sqstring.h" -#include "sqtable.h" -#include "sqarray.h" -#include "sqfuncproto.h" -#include "sqclosure.h" -#include "squserdata.h" -#include "sqcompiler.h" -#include "sqfuncstate.h" -#include "sqclass.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static bool sq_aux_gettypedarg(HSQUIRRELVM v,SQInteger idx,SQObjectType type,SQObjectPtr **o) { diff --git a/squirrel/sqarray.h b/rabbit/sqarray.hpp similarity index 92% rename from squirrel/sqarray.h rename to rabbit/sqarray.hpp index 7c6c204..a6710a9 100644 --- a/squirrel/sqarray.h +++ b/rabbit/sqarray.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQARRAY_H_ -#define _SQARRAY_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once struct SQArray : public CHAINABLE_OBJ { @@ -91,4 +96,5 @@ public: SQObjectPtrVec _values; }; -#endif //_SQARRAY_H_ + + diff --git a/squirrel/sqbaselib.cpp b/rabbit/sqbaselib.cpp similarity index 98% rename from squirrel/sqbaselib.cpp rename to rabbit/sqbaselib.cpp index f835cbf..f57a0a7 100644 --- a/squirrel/sqbaselib.cpp +++ b/rabbit/sqbaselib.cpp @@ -1,14 +1,18 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqvm.h" -#include "sqstring.h" -#include "sqtable.h" -#include "sqarray.h" -#include "sqfuncproto.h" -#include "sqclosure.h" -#include "sqclass.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/squirrel/sqclass.cpp b/rabbit/sqclass.cpp similarity index 93% rename from squirrel/sqclass.cpp rename to rabbit/sqclass.cpp index fc61961..17604fc 100644 --- a/squirrel/sqclass.cpp +++ b/rabbit/sqclass.cpp @@ -1,12 +1,16 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqvm.h" -#include "sqtable.h" -#include "sqclass.h" -#include "sqfuncproto.h" -#include "sqclosure.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include +#include +#include +#include +#include +#include diff --git a/squirrel/sqclass.h b/rabbit/sqclass.hpp similarity index 95% rename from squirrel/sqclass.h rename to rabbit/sqclass.hpp index 7d40217..734d6a0 100644 --- a/squirrel/sqclass.h +++ b/rabbit/sqclass.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQCLASS_H_ -#define _SQCLASS_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once struct SQInstance; @@ -159,4 +164,3 @@ public: SQObjectPtr _values[1]; }; -#endif //_SQCLASS_H_ diff --git a/squirrel/sqclosure.h b/rabbit/sqclosure.hpp similarity index 96% rename from squirrel/sqclosure.h rename to rabbit/sqclosure.hpp index 66495b9..b998291 100644 --- a/squirrel/sqclosure.h +++ b/rabbit/sqclosure.hpp @@ -1,7 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQCLOSURE_H_ -#define _SQCLOSURE_H_ - +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #define _CALC_CLOSURE_SIZE(func) (sizeof(SQClosure) + (func->_noutervalues*sizeof(SQObjectPtr)) + (func->_ndefaultparams*sizeof(SQObjectPtr))) @@ -197,5 +201,3 @@ public: }; - -#endif //_SQCLOSURE_H_ diff --git a/squirrel/sqcompiler.cpp b/rabbit/sqcompiler.cpp similarity index 99% rename from squirrel/sqcompiler.cpp rename to rabbit/sqcompiler.cpp index 04d7e6e..a5b3d99 100644 --- a/squirrel/sqcompiler.cpp +++ b/rabbit/sqcompiler.cpp @@ -1,18 +1,22 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include #ifndef NO_COMPILER #include #include -#include "sqopcodes.h" -#include "sqstring.h" -#include "sqfuncproto.h" -#include "sqcompiler.h" -#include "sqfuncstate.h" -#include "sqlexer.h" -#include "sqvm.h" -#include "sqtable.h" +#include +#include +#include +#include +#include +#include +#include +#include #define EXPR 1 #define OBJECT 2 diff --git a/squirrel/sqcompiler.h b/rabbit/sqcompiler.hpp similarity index 88% rename from squirrel/sqcompiler.h rename to rabbit/sqcompiler.hpp index e7da642..380d8f1 100644 --- a/squirrel/sqcompiler.h +++ b/rabbit/sqcompiler.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQCOMPILER_H_ -#define _SQCOMPILER_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once struct SQVM; @@ -76,4 +81,3 @@ struct SQVM; typedef void(*CompilerErrorFunc)(void *ud, const SQChar *s); bool Compile(SQVM *vm, SQLEXREADFUNC rg, SQUserPointer up, const SQChar *sourcename, SQObjectPtr &out, bool raiseerror, bool lineinfo); -#endif //_SQCOMPILER_H_ diff --git a/include/sqconfig.h b/rabbit/sqconfig.hpp similarity index 93% rename from include/sqconfig.h rename to rabbit/sqconfig.hpp index 58bc979..baaee56 100644 --- a/include/sqconfig.h +++ b/rabbit/sqconfig.hpp @@ -1,3 +1,11 @@ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #ifdef _SQ64 diff --git a/squirrel/sqdebug.cpp b/rabbit/sqdebug.cpp similarity index 91% rename from squirrel/sqdebug.cpp rename to rabbit/sqdebug.cpp index d55b1b2..bc10d2b 100644 --- a/squirrel/sqdebug.cpp +++ b/rabbit/sqdebug.cpp @@ -1,12 +1,17 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #include -#include "sqvm.h" -#include "sqfuncproto.h" -#include "sqclosure.h" -#include "sqstring.h" +#include +#include +#include +#include SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger level,SQFunctionInfo *fi) { diff --git a/squirrel/sqfuncproto.h b/rabbit/sqfuncproto.hpp similarity index 95% rename from squirrel/sqfuncproto.h rename to rabbit/sqfuncproto.hpp index 546dbab..5000f7c 100644 --- a/squirrel/sqfuncproto.h +++ b/rabbit/sqfuncproto.hpp @@ -1,8 +1,13 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQFUNCTION_H_ -#define _SQFUNCTION_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once -#include "sqopcodes.h" +#include enum SQOuterType { otLOCAL = 0, @@ -150,5 +155,3 @@ public: SQInteger _ninstructions; SQInstruction _instructions[1]; }; - -#endif //_SQFUNCTION_H_ diff --git a/squirrel/sqfuncstate.cpp b/rabbit/sqfuncstate.cpp similarity index 97% rename from squirrel/sqfuncstate.cpp rename to rabbit/sqfuncstate.cpp index 6d633c7..fe24734 100644 --- a/squirrel/sqfuncstate.cpp +++ b/rabbit/sqfuncstate.cpp @@ -1,14 +1,19 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #ifndef NO_COMPILER -#include "sqcompiler.h" -#include "sqstring.h" -#include "sqfuncproto.h" -#include "sqtable.h" -#include "sqopcodes.h" -#include "sqfuncstate.h" +#include +#include +#include +#include +#include +#include #ifdef _DEBUG_DUMP SQInstructionDesc g_InstrDesc[]={ diff --git a/squirrel/sqfuncstate.h b/rabbit/sqfuncstate.hpp similarity index 92% rename from squirrel/sqfuncstate.h rename to rabbit/sqfuncstate.hpp index a693d13..99e899c 100644 --- a/squirrel/sqfuncstate.h +++ b/rabbit/sqfuncstate.hpp @@ -1,8 +1,13 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQFUNCSTATE_H_ -#define _SQFUNCSTATE_H_ -/////////////////////////////////// -#include "squtils.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +#include struct SQFuncState { @@ -87,5 +92,3 @@ private: }; -#endif //_SQFUNCSTATE_H_ - diff --git a/squirrel/sqlexer.cpp b/rabbit/sqlexer.cpp similarity index 97% rename from squirrel/sqlexer.cpp rename to rabbit/sqlexer.cpp index 6a8e7c4..fc4e439 100644 --- a/squirrel/sqlexer.cpp +++ b/rabbit/sqlexer.cpp @@ -1,13 +1,18 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include #include #include -#include "sqtable.h" -#include "sqstring.h" -#include "sqcompiler.h" -#include "sqlexer.h" +#include +#include +#include +#include #define CUR_CHAR (_currdata) #define RETURN_TOKEN(t) { _prevtoken = _curtoken; _curtoken = t; return t;} diff --git a/squirrel/sqlexer.h b/rabbit/sqlexer.hpp similarity index 84% rename from squirrel/sqlexer.h rename to rabbit/sqlexer.hpp index d731c20..d2f223f 100644 --- a/squirrel/sqlexer.h +++ b/rabbit/sqlexer.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQLEXER_H_ -#define _SQLEXER_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #ifdef SQUNICODE typedef SQChar LexChar; @@ -52,4 +57,3 @@ public: void *_errtarget; }; -#endif diff --git a/squirrel/sqmem.cpp b/rabbit/sqmem.cpp similarity index 55% rename from squirrel/sqmem.cpp rename to rabbit/sqmem.cpp index 378e254..bf5b14f 100644 --- a/squirrel/sqmem.cpp +++ b/rabbit/sqmem.cpp @@ -1,7 +1,13 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include + #ifndef SQ_EXCLUDE_DEFAULT_MEMFUNCTIONS void *sq_vm_malloc(SQUnsignedInteger size){ return malloc(size); } diff --git a/squirrel/sqobject.cpp b/rabbit/sqobject.cpp similarity index 97% rename from squirrel/sqobject.cpp rename to rabbit/sqobject.cpp index 4e98072..ce401fa 100644 --- a/squirrel/sqobject.cpp +++ b/rabbit/sqobject.cpp @@ -1,15 +1,19 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqvm.h" -#include "sqstring.h" -#include "sqarray.h" -#include "sqtable.h" -#include "squserdata.h" -#include "sqfuncproto.h" -#include "sqclass.h" -#include "sqclosure.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include const SQChar *IdType2Name(SQObjectType type) diff --git a/squirrel/sqobject.h b/rabbit/sqobject.hpp similarity index 97% rename from squirrel/sqobject.h rename to rabbit/sqobject.hpp index a202222..4d692a4 100644 --- a/squirrel/sqobject.h +++ b/rabbit/sqobject.hpp @@ -1,8 +1,13 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQOBJECT_H_ -#define _SQOBJECT_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once -#include "squtils.h" +#include #ifdef _SQ64 #define UINT_MINUS_ONE (0xFFFFFFFFFFFFFFFF) @@ -350,4 +355,3 @@ const SQChar *IdType2Name(SQObjectType type); -#endif //_SQOBJECT_H_ diff --git a/squirrel/sqopcodes.h b/rabbit/sqopcodes.hpp similarity index 92% rename from squirrel/sqopcodes.h rename to rabbit/sqopcodes.hpp index 15d80e4..33102ff 100644 --- a/squirrel/sqopcodes.h +++ b/rabbit/sqopcodes.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQOPCODES_H_ -#define _SQOPCODES_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once #define MAX_FUNC_STACKSIZE 0xFF #define MAX_LITERALS ((SQInteger)0x7FFFFFFF) @@ -123,10 +128,9 @@ struct SQInstruction unsigned char _arg3; }; -#include "squtils.h" +#include typedef sqvector SQInstructionVec; #define NEW_SLOT_ATTRIBUTES_FLAG 0x01 #define NEW_SLOT_STATIC_FLAG 0x02 -#endif // _SQOPCODES_H_ diff --git a/rabbit/sqpcheader.hpp b/rabbit/sqpcheader.hpp new file mode 100644 index 0000000..4feadc7 --- /dev/null +++ b/rabbit/sqpcheader.hpp @@ -0,0 +1,24 @@ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +#if defined(_MSC_VER) && defined(_DEBUG) +#include +#endif + +#include +#include +#include +#include +#include +#include +//rabbit stuff +#include +#include +#include + diff --git a/squirrel/sqstate.cpp b/rabbit/sqstate.cpp similarity index 97% rename from squirrel/sqstate.cpp rename to rabbit/sqstate.cpp index c89bdc4..0ab1136 100644 --- a/squirrel/sqstate.cpp +++ b/rabbit/sqstate.cpp @@ -1,16 +1,20 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqopcodes.h" -#include "sqvm.h" -#include "sqfuncproto.h" -#include "sqclosure.h" -#include "sqstring.h" -#include "sqtable.h" -#include "sqarray.h" -#include "squserdata.h" -#include "sqclass.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include SQSharedState::SQSharedState() { diff --git a/squirrel/sqstate.h b/rabbit/sqstate.hpp similarity index 93% rename from squirrel/sqstate.h rename to rabbit/sqstate.hpp index 2cdc8da..787e5af 100644 --- a/squirrel/sqstate.h +++ b/rabbit/sqstate.hpp @@ -1,9 +1,14 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTATE_H_ -#define _SQSTATE_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once -#include "squtils.h" -#include "sqobject.h" +#include +#include struct SQString; struct SQTable; //max number of character for a printed number @@ -133,4 +138,3 @@ private: bool CompileTypemask(SQIntVec &res,const SQChar *typemask); -#endif //_SQSTATE_H_ diff --git a/squirrel/sqstring.h b/rabbit/sqstring.hpp similarity index 75% rename from squirrel/sqstring.h rename to rabbit/sqstring.hpp index 82f1cdf..5575d6b 100644 --- a/squirrel/sqstring.h +++ b/rabbit/sqstring.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQSTRING_H_ -#define _SQSTRING_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once inline SQHash _hashstr (const SQChar *s, size_t l) { @@ -28,4 +33,3 @@ public: -#endif //_SQSTRING_H_ diff --git a/squirrel/sqtable.cpp b/rabbit/sqtable.cpp similarity index 93% rename from squirrel/sqtable.cpp rename to rabbit/sqtable.cpp index 3a89c45..ef3f1c1 100644 --- a/squirrel/sqtable.cpp +++ b/rabbit/sqtable.cpp @@ -1,11 +1,16 @@ -/* -see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" -#include "sqvm.h" -#include "sqtable.h" -#include "sqfuncproto.h" -#include "sqclosure.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ + +#include +#include +#include +#include +#include SQTable::SQTable(SQSharedState *ss,SQInteger nInitialSize) { diff --git a/squirrel/sqtable.h b/rabbit/sqtable.hpp similarity index 92% rename from squirrel/sqtable.h rename to rabbit/sqtable.hpp index 59db331..5fb0fa6 100644 --- a/squirrel/sqtable.h +++ b/rabbit/sqtable.hpp @@ -1,13 +1,19 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQTABLE_H_ -#define _SQTABLE_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + /* * The following code is based on Lua 4.0 (Copyright 1994-2002 Tecgraf, PUC-Rio.) * http://www.lua.org/copyright.html#4 * http://www.lua.org/source/4.0.1/src_ltable.c.html */ -#include "sqstring.h" +#include #define hashptr(p) ((SQHash)(((SQInteger)p) >> 3)) @@ -107,4 +113,3 @@ public: }; -#endif //_SQTABLE_H_ diff --git a/squirrel/squserdata.h b/rabbit/squserdata.hpp similarity index 81% rename from squirrel/squserdata.h rename to rabbit/squserdata.hpp index ec21731..ba41416 100644 --- a/squirrel/squserdata.h +++ b/rabbit/squserdata.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQUSERDATA_H_ -#define _SQUSERDATA_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once struct SQUserData : SQDelegable { @@ -37,4 +42,3 @@ struct SQUserData : SQDelegable //SQChar _val[1]; }; -#endif //_SQUSERDATA_H_ diff --git a/squirrel/squtils.h b/rabbit/squtils.hpp similarity index 93% rename from squirrel/squtils.h rename to rabbit/squtils.hpp index f3e819a..e42da59 100644 --- a/squirrel/squtils.h +++ b/rabbit/squtils.hpp @@ -1,6 +1,11 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQUTILS_H_ -#define _SQUTILS_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once void *sq_vm_malloc(SQUnsignedInteger size); void *sq_vm_realloc(void *p,SQUnsignedInteger oldsize,SQUnsignedInteger size); @@ -113,4 +118,3 @@ private: SQUnsignedInteger _allocated; }; -#endif //_SQUTILS_H_ diff --git a/squirrel/sqvm.cpp b/rabbit/sqvm.cpp similarity index 99% rename from squirrel/sqvm.cpp rename to rabbit/sqvm.cpp index 3cb643a..8db107a 100644 --- a/squirrel/sqvm.cpp +++ b/rabbit/sqvm.cpp @@ -1,18 +1,22 @@ -/* - see copyright notice in squirrel.h -*/ -#include "sqpcheader.h" +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#include #include #include -#include "sqopcodes.h" -#include "sqvm.h" -#include "sqfuncproto.h" -#include "sqclosure.h" -#include "sqstring.h" -#include "sqtable.h" -#include "squserdata.h" -#include "sqarray.h" -#include "sqclass.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define TOP() (_stack._vals[_top-1]) #define TARGET _stack._vals[_stackbase+arg0] diff --git a/squirrel/sqvm.h b/rabbit/sqvm.hpp similarity index 96% rename from squirrel/sqvm.h rename to rabbit/sqvm.hpp index a75524d..a356e4b 100644 --- a/squirrel/sqvm.h +++ b/rabbit/sqvm.hpp @@ -1,9 +1,15 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQVM_H_ -#define _SQVM_H_ +/** + * @author Alberto DEMICHELIS + * @author Edouard DUPIN + * @copyright 2018, Edouard DUPIN, all right reserved + * @copyright 2003-2017, Alberto DEMICHELIS, all right reserved + * @license MPL-2 (see license file) + */ +#pragma once + +#include +#include -#include "sqopcodes.h" -#include "sqobject.h" #define MAX_NATIVE_CALLS 100 #define MIN_STACK_OVERHEAD 15 @@ -210,4 +216,3 @@ inline SQObjectPtr &stack_get(HSQUIRRELVM v,SQInteger idx){return ((idx>=0)?(v-> v->ci->_closure.Null(); \ v->ci = css?&v->_callsstack[css-1]:NULL; \ } -#endif //_SQVM_H_ diff --git a/samples/ackermann.nut b/samples/ackermann.carrot similarity index 100% rename from samples/ackermann.nut rename to samples/ackermann.carrot diff --git a/samples/array.nut b/samples/array.carrot similarity index 100% rename from samples/array.nut rename to samples/array.carrot diff --git a/samples/class.nut b/samples/class.carrot similarity index 100% rename from samples/class.nut rename to samples/class.carrot diff --git a/samples/classattributes.nut b/samples/classattributes.carrot similarity index 100% rename from samples/classattributes.nut rename to samples/classattributes.carrot diff --git a/samples/coroutines.nut b/samples/coroutines.carrot similarity index 100% rename from samples/coroutines.nut rename to samples/coroutines.carrot diff --git a/samples/delegation.nut b/samples/delegation.carrot similarity index 100% rename from samples/delegation.nut rename to samples/delegation.carrot diff --git a/samples/fibonacci.nut b/samples/fibonacci.carrot similarity index 100% rename from samples/fibonacci.nut rename to samples/fibonacci.carrot diff --git a/samples/flow.nut b/samples/flow.carrot similarity index 100% rename from samples/flow.nut rename to samples/flow.carrot diff --git a/samples/generators.nut b/samples/generators.carrot similarity index 100% rename from samples/generators.nut rename to samples/generators.carrot diff --git a/samples/hello.nut b/samples/hello.carrot similarity index 100% rename from samples/hello.nut rename to samples/hello.carrot diff --git a/samples/list.nut b/samples/list.carrot similarity index 100% rename from samples/list.nut rename to samples/list.carrot diff --git a/samples/loops.nut b/samples/loops.carrot similarity index 100% rename from samples/loops.nut rename to samples/loops.carrot diff --git a/samples/matrix.nut b/samples/matrix.carrot similarity index 100% rename from samples/matrix.nut rename to samples/matrix.carrot diff --git a/samples/metamethods.nut b/samples/metamethods.carrot similarity index 100% rename from samples/metamethods.nut rename to samples/metamethods.carrot diff --git a/samples/methcall.nut b/samples/methcall.carrot similarity index 100% rename from samples/methcall.nut rename to samples/methcall.carrot diff --git a/samples/regex.nut b/samples/regex.carrot similarity index 100% rename from samples/regex.nut rename to samples/regex.carrot diff --git a/samples/tailstate.nut b/samples/tailstate.carrot similarity index 100% rename from samples/tailstate.nut rename to samples/tailstate.carrot diff --git a/squirrel/sqpcheader.h b/squirrel/sqpcheader.h deleted file mode 100644 index 5070dca..0000000 --- a/squirrel/sqpcheader.h +++ /dev/null @@ -1,20 +0,0 @@ -/* see copyright notice in squirrel.h */ -#ifndef _SQPCHEADER_H_ -#define _SQPCHEADER_H_ - -#if defined(_MSC_VER) && defined(_DEBUG) -#include -#endif - -#include -#include -#include -#include -#include -#include -//squirrel stuff -#include -#include "sqobject.h" -#include "sqstate.h" - -#endif //_SQPCHEADER_H_