aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Luamm.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Luamm.hh')
-rw-r--r--src/FbTk/Luamm.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/FbTk/Luamm.hh b/src/FbTk/Luamm.hh
index 110ac97..b75fb12 100644
--- a/src/FbTk/Luamm.hh
+++ b/src/FbTk/Luamm.hh
@@ -131,6 +131,14 @@ namespace lua {
131 {} 131 {}
132 }; 132 };
133 133
134 // thrown by check* functions when they detect an invalid argument
135 class check_error: public std::runtime_error {
136 public:
137 check_error(const std::string &msg)
138 : std::runtime_error(msg)
139 {}
140 };
141
134 // a fancy wrapper around lua_State 142 // a fancy wrapper around lua_State
135 class state { 143 class state {
136 lua_State *cobj; 144 lua_State *cobj;
@@ -264,6 +272,10 @@ namespace lua {
264 // type c, throw everything but the kitchen sink 272 // type c, throw everything but the kitchen sink
265 // call() is a protected mode call, we don't allow unprotected calls 273 // call() is a protected mode call, we don't allow unprotected calls
266 void call(int nargs, int nresults, int errfunc = 0); 274 void call(int nargs, int nresults, int errfunc = 0);
275 void checkargno(int argno) throw(lua::check_error);
276 void *checkudata(int narg, const char *tname) throw(lua::check_error, std::bad_alloc);
277 template<typename T>
278 T *checkudata(int narg, const char *tname) throw(lua::check_error, std::bad_alloc) { return static_cast<T *>(checkudata(narg, tname)); }
267 void concat(int n); 279 void concat(int n);
268 bool equal(int index1, int index2); 280 bool equal(int index1, int index2);
269 int gc(int what, int data); 281 int gc(int what, int data);