#include <libusb.h>
#include <cups/cups-private.h>
+#include <cups/dir.h>
#include <pthread.h>
#include <sys/select.h>
#include <sys/types.h>
cups_array_t *all_quirks; /* Array of printer quirks */
usb_globals_t g = { 0 }; /* Globals */
-libusb_device **list; /* List of connected USB devices */
+libusb_device **all_list; /* List of connected USB devices */
/*
void
list_devices(void)
{
+ load_quirks();
+
fputs("DEBUG: list_devices\n", stderr);
find_device(list_cb, NULL);
}
const char *val; /* Option value */
+ load_quirks();
+
/*
* See if the side-channel descriptor is valid...
*/
* Clean up ....
*/
- libusb_free_device_list(list, 1);
+ libusb_free_device_list(all_list, 1);
libusb_exit(NULL);
return (status);
if (err)
{
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
- "libusb error %i\n", err);
+ "libusb error %i\n", (int)err);
return (NULL);
}
fprintf(stderr, "DEBUG: Loading USB quirks from \"%s\".\n", filename);
- while (dent = cupsDirRead(dir))
+ while ((dent = cupsDirRead(dir)) != NULL)
{
if (!S_ISREG(dent->fileinfo.st_mode))
continue;