summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/Lua/Check.h')
-rw-r--r--Sluift/Lua/Check.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/Sluift/Lua/Check.h b/Sluift/Lua/Check.h
new file mode 100644
index 0000000..a569826
--- /dev/null
+++ b/Sluift/Lua/Check.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2013 Remko Tronçon
+ * Licensed under the GNU General Public License.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+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);
+
+ void* checkUserDataRaw(lua_State* L, int arg, const char* tableName);
+
+ template<typename T>
+ T** checkUserData(lua_State* L, int arg, const char* tableName) {
+ return reinterpret_cast<T**>(checkUserDataRaw(L, arg, tableName));
+ }
+ }
+}