Commits

Jérôme Vuarand  committed 796612b

Simple binding for libusb_set_debug.

  • Participants
  • Parent commits 99df5a8

Comments (0)

Files changed (1)

 	return 1;
 }
 
+BINDING(set_debug)
+{
+	libusb_context* ctx;
+	int level;
+	
+	ctx = luausb_opt_context(L, 1, NULL);
+	level = (int)luaL_checknumber(L, 2); /* :FIXME: handle overflow */
+	
+	libusb_set_debug(ctx, level);
+	
+	return 0;
+}
+
 /****************************************************************************/
 
 #define GETTER(c, f) int luausb_get_##c##_##f(lua_State* L)
 	BIND(handle_events_completed)
 	BIND(get_pollfds)
 	BIND(pollfds_handle_timeouts)
+	BIND(set_debug)
 	{0, 0},
 };
 /*