static int SaveImage(lua_State *L) { Ihandle *image = iuplua_checkihandle(L,1); const char *filename = luaL_checkstring(L, 2); const char *format = luaL_checkstring(L, 3); lua_pushboolean(L, IupSaveImage(image, filename, format)); return 1; }
VALUE rb_IupSaveImage(VALUE self,VALUE node,VALUE v_file_name,VALUE v_format) { const char* file_name = RSTRING_PTR(v_file_name); const char* format = RSTRING_PTR(v_format); int v; VALUE v_ih = rb_iv_get(node,"@ihandle"); v = IupSaveImage((Ihandle*)NUM2ULONG(v_ih),file_name,format); return INT2FIX((int)v); }