-GSList *device_list(void)
-{
-
- if (!devices)
- device_scan();
-
- return devices;
-}
-
-struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
- int num_probes)
-{
- struct sr_device *device;
- int i;
-
- device = g_malloc0(sizeof(struct sr_device));
- device->plugin = plugin;
- device->plugin_index = plugin_index;
- devices = g_slist_append(devices, device);
-
- for (i = 0; i < num_probes; i++)
- device_probe_add(device, NULL);
-
- return device;
-}
-
-void device_clear(struct sr_device *device)
-{
- unsigned int pnum;
-
- /* TODO: Plugin-specific clear call? */
-
- if (!device->probes)
- return;
-
- for (pnum = 1; pnum <= g_slist_length(device->probes); pnum++)
- device_probe_clear(device, pnum);
-}
-
-void device_destroy(struct sr_device *device)
-{
- unsigned int pnum;
-
- /*
- * TODO: Plugin-specific destroy call, need to decrease refcount
- * in plugin.
- */
-
- devices = g_slist_remove(devices, device);
- if (device->probes) {
- for (pnum = 1; pnum <= g_slist_length(device->probes); pnum++)
- device_probe_clear(device, pnum);
- g_slist_free(device->probes);
- }
- g_free(device);