OpenTTD Source: src/script/squirrel_std.hpp Source File

OpenTTD Source 15.0-RC2

squirrel_std.hpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SQUIRREL_STD_HPP
11#define SQUIRREL_STD_HPP
12
13#include "squirrel.hpp"
14
15#if defined(__APPLE__)
16/* Which idiotic system makes 'require' a macro? :s Oh well.... */
17#undef require
18#endif /* __APPLE__ */
19
26 class SquirrelStd {
27public:
28
32 static SQInteger min(HSQUIRRELVM vm);
33
37 static SQInteger max(HSQUIRRELVM vm);
38
44 static SQInteger require(HSQUIRRELVM vm);
45
49 static SQInteger notifyallexceptions(HSQUIRRELVM vm);
50};
51
55void squirrel_register_std(Squirrel &engine);
56
61void squirrel_register_global_std(Squirrel &engine);
62
63#endif /* SQUIRREL_STD_HPP */
SquirrelStd
By default we want to give a set of standard commands to a SQ script.
Definition squirrel_std.hpp:26
SquirrelStd::max
static SQInteger max(HSQUIRRELVM vm)
Get the highest of two integers.
Definition squirrel_std.cpp:30
SquirrelStd::require
static SQInteger require(HSQUIRRELVM vm)
Load another file on runtime.
Definition squirrel_std.cpp:40
SquirrelStd::notifyallexceptions
static SQInteger notifyallexceptions(HSQUIRRELVM vm)
Enable/disable stack trace showing for handled exceptions.
Definition squirrel_std.cpp:70
SquirrelStd::min
static SQInteger min(HSQUIRRELVM vm)
Get the lowest of two integers.
Definition squirrel_std.cpp:20
Squirrel
Definition squirrel.hpp:24
squirrel.hpp
defines the Squirrel class
squirrel_register_global_std
void squirrel_register_global_std(Squirrel &engine)
Register all standard functions that are available on first startup.
Definition squirrel_std.cpp:84
squirrel_register_std
void squirrel_register_std(Squirrel &engine)
Register all standard functions we want to give to a script.
Definition squirrel_std.cpp:92