summaryrefslogtreecommitdiffstats
blob: c22751b9fe70357b91e41ee48f66c8ef74ccb429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2013-2014 Remko Tronçon
 * Licensed under the GNU General Public License.
 * See the COPYING file for more information.
 */

#pragma once

#include <string>

#include <Swiften/Base/ByteArray.h>

struct lua_State;

namespace Swift {
	namespace Lua {
		void checkType(lua_State* L, int arg, int type);
		int checkIntNumber(lua_State* L, int arg);
		std::string checkString(lua_State* L, int arg);
		ByteArray checkByteArray(lua_State* L, int arg);

		void* checkUserDataRaw(lua_State* L, int arg);

		template<typename T>
		T** checkUserData(lua_State* L, int arg) {
			return reinterpret_cast<T**>(checkUserDataRaw(L, arg));
		}
	}
}