truelight@9487: /* $Id$ */ truelight@9487: truelight@9487: /** @file squirrel_std.hpp defines the Squirrel Standard Function class */ truelight@9487: truelight@9487: #ifndef SQUIRREL_STD_HPP truelight@9487: #define SQUIRREL_STD_HPP truelight@9487: truelight@9591: #if defined(__APPLE__) truelight@9591: /* Which idiotic system makes 'require' a macro? :s Oh well.... */ truelight@9591: #undef require truelight@9591: #endif /* __APPLE__ */ truelight@9591: truelight@9487: /** truelight@9487: * By default we want to give a set of standard commands to a SQ script. truelight@9487: * Most of them are easy wrappers around internal functions. Of course we truelight@9487: * could just as easy include things like the stdmath of SQ, but of those truelight@9487: * functions we are sure they work on all our supported targets. truelight@9487: */ truelight@9487: class SquirrelStd { truelight@9487: public: truelight@9487: /** truelight@9487: * Make an integer absolute. truelight@9487: */ truelight@9487: static SQInteger abs(HSQUIRRELVM vm); truelight@9577: truelight@9577: /** truelight@9577: * Load an other file on runtime. truelight@9577: * @note This is always loaded on the root-level, no matter where you call this. truelight@9577: * @note The filename is always relative from the script it is called from. Absolute calls are NOT allowed! truelight@9577: */ truelight@9577: static SQInteger require(HSQUIRRELVM vm); truelight@9487: }; truelight@9487: truelight@9487: /** truelight@9487: * Register all standard functions we want to give to a script. truelight@9487: */ truelight@9487: void squirrel_register_std(Squirrel *engine); truelight@9487: truelight@9577: /** truelight@9577: * Register all standard functions that are available on first startup. truelight@9577: * @note this set is very limited, and is only ment to load other scripts and things like that. truelight@9577: */ truelight@9577: void squirrel_register_global_std(Squirrel *engine); truelight@9577: truelight@9487: #endif /* SQUIRREL_STD_HPP */