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