sdi->vendor = vendor ? g_strdup(vendor) : NULL;
sdi->model = model ? g_strdup(model) : NULL;
sdi->version = version ? g_strdup(version) : NULL;
+ sdi->probes = NULL;
sdi->priv = NULL;
return sdi;
g_free(sdi);
}
+SR_PRIV struct sr_probe *sr_probe_new(int index, int type,
+ gboolean enabled, const char *name)
+{
+ struct sr_probe *probe;
+
+ if (!(probe = g_try_malloc0(sizeof(struct sr_probe)))) {
+ sr_err("hwdriver: probe malloc failed");
+ return NULL;
+ }
+
+ probe->index = index;
+ probe->type = type;
+ probe->enabled = enabled;
+ if (name)
+ probe->name = g_strdup(name);
+
+ return probe;
+}
+
#ifdef HAVE_LIBUSB_1_0
SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus,
const char *vendor, const char *model, const char *version);
SR_PRIV struct sr_dev_inst *sr_dev_inst_get(GSList *dev_insts, int dev_index);
SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi);
+SR_PRIV struct sr_probe *sr_probe_new(int index, int type,
+ gboolean enabled, const char *name);
SR_PRIV int sr_source_remove(int fd);
SR_PRIV int sr_source_add(int fd, int events, int timeout,