3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "lua_api/l_base.h"
25 class ModApiUtil : public ModApiBase {
29 The functions in this module are available through
30 minetest.<function> in the in-game API as well as
31 engine.<function> in the mainmenu API
33 All functions that don't require either a Server or
34 GUIEngine instance should be in here.
38 // Writes a line to dstream
39 static int l_debug(lua_State *L);
42 // Writes a line to the logger.
43 // The one-argument version logs to infostream.
44 // The two-argument version accept a log level: error, action, info, or verbose.
45 static int l_log(lua_State *L);
47 // setting_set(name, value)
48 static int l_setting_set(lua_State *L);
51 static int l_setting_get(lua_State *L);
53 // setting_setbool(name, value)
54 static int l_setting_setbool(lua_State *L);
56 // setting_getbool(name)
57 static int l_setting_getbool(lua_State *L);
60 static int l_setting_save(lua_State *L);
62 // parse_json(str[, nullvalue])
63 static int l_parse_json(lua_State *L);
65 // get_dig_params(groups, tool_capabilities[, time_from_last_punch])
66 static int l_get_dig_params(lua_State *L);
68 // get_hit_params(groups, tool_capabilities[, time_from_last_punch])
69 static int l_get_hit_params(lua_State *L);
71 // get_password_hash(name, raw_password)
72 static int l_get_password_hash(lua_State *L);
75 static int l_is_yes(lua_State *L);
78 static void Initialize(lua_State *L, int top);
82 #endif /* L_UTIL_H_ */