Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
c_types.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7extern "C" {
8#include "lua.h"
9}
10
11#include <iostream>
12
13#include "exceptions.h"
14
16{
17 int num;
18 const char *str;
19};
20
22{
23private:
24 lua_State *m_lua;
26public:
27 StackUnroller(lua_State *L):
28 m_lua(L),
30 {
31 m_original_top = lua_gettop(m_lua); // store stack height
32 }
34 {
35 lua_settop(m_lua, m_original_top); // restore stack height
36 }
37};
38
39class LuaError : public ModError
40{
41public:
42 LuaError(const std::string &s) : ModError(s) {}
43};
44
45
46extern EnumString es_ItemType[];
EnumString es_TouchInteractionMode[]
Definition c_types.cpp:21
EnumString es_ItemType[]
Definition c_types.cpp:12
Definition c_types.h:40
LuaError(const std::string &s)
Definition c_types.h:42
Definition exceptions.h:85
Definition c_types.h:22
lua_State * m_lua
Definition c_types.h:24
int m_original_top
Definition c_types.h:25
StackUnroller(lua_State *L)
Definition c_types.h:27
~StackUnroller()
Definition c_types.h:33
Definition c_types.h:16
const char * str
Definition c_types.h:18
int num
Definition c_types.h:17