Luanti
5.15.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
7
extern
"C"
{
8
#include "lua.h"
9
}
10
11
#include "
exceptions.h
"
12
13
class
StackUnroller
14
{
15
private
:
16
lua_State *
m_lua
;
17
int
m_original_top
;
18
public
:
19
StackUnroller
(lua_State *L):
20
m_lua
(L),
21
m_original_top
(-1)
22
{
23
m_original_top
= lua_gettop(
m_lua
);
// store stack height
24
}
25
~StackUnroller
()
26
{
27
lua_settop(
m_lua
,
m_original_top
);
// restore stack height
28
}
29
};
30
31
class
LuaError
:
public
ModError
32
{
33
public
:
34
LuaError
(
const
std::string &s) :
ModError
(s) {}
35
};
LuaError
Definition
c_types.h:32
LuaError::LuaError
LuaError(const std::string &s)
Definition
c_types.h:34
ModError
Definition
exceptions.h:85
StackUnroller
Definition
c_types.h:14
StackUnroller::m_lua
lua_State * m_lua
Definition
c_types.h:16
StackUnroller::m_original_top
int m_original_top
Definition
c_types.h:17
StackUnroller::StackUnroller
StackUnroller(lua_State *L)
Definition
c_types.h:19
StackUnroller::~StackUnroller
~StackUnroller()
Definition
c_types.h:25
exceptions.h
script
common
c_types.h
Generated on Fri Jan 2 2026 04:32:21 for Luanti by
1.11.0