miniswig suspend is now an attribute appended to functions
[supertux.git] / src / scripting / wrapper_util.hpp
index 66ac995..54ca2e9 100644 (file)
@@ -6,25 +6,6 @@
 #include <sstream>
 #include <string>
 
-struct WrappedFunction {
-    const char* name;
-    SQFUNCTION f;
-};
-
-template<typename T>
-struct WrappedConstant {
-    const char* name;
-    T value;
-};
-
-struct WrappedClass {
-    const char* name;
-    WrappedFunction* functions;
-    WrappedConstant<int>* int_consts;
-    WrappedConstant<float>* float_consts;
-    WrappedConstant<const char*>* string_consts;
-};
-
 class SquirrelError : public std::exception
 {
 public:
@@ -36,46 +17,6 @@ private:
   std::string message;
 };
 
-void register_functions(HSQUIRRELVM v, WrappedFunction* functions);
-void register_classes(HSQUIRRELVM v, WrappedClass* classes);
-
-static inline void push_value(HSQUIRRELVM v, int val)
-{
-    sq_pushinteger(v, val);
-}
-
-static inline void push_value(HSQUIRRELVM v, float val)
-{
-    sq_pushfloat(v, val);
-}
-
-static inline void push_value(HSQUIRRELVM v, const char* str)
-{
-    sq_pushstring(v, str, -1);
-}
-
-template<typename T>
-void _register_constants(HSQUIRRELVM v, WrappedConstant<T>* constants)
-{
-    for(WrappedConstant<T>* c = constants; c->name != 0; ++c) {
-        sq_pushstring(v, c->name, -1);
-        push_value(v, c->value);
-        if(sq_createslot(v, -3) < 0) {
-            std::stringstream msg;
-            msg << "Couldn't register int constant '" << c->name << "'";
-            throw SquirrelError(v, msg.str());
-        }
-    }
-}
-
-template<typename T>
-void register_constants(HSQUIRRELVM v, WrappedConstant<T>* constants)
-{
-    sq_pushroottable(v);
-    _register_constants(v, constants);
-    sq_pop(v, 1);
-}
-
 void print_squirrel_stack(HSQUIRRELVM v);
 
 #endif