]> sigrok.org Git - libsigrok.git/blobdiff - hwplugin.c
SR_ prefix for all public enums.
[libsigrok.git] / hwplugin.c
index 5590a4bbb5b9a0d8e0b93d9f4583d7ca236f5cb2..31fed10c8583fe77e255c8f38f2813477ca61112 100644 (file)
@@ -34,32 +34,32 @@ GSList *plugins;
  * options.
  */
 struct hwcap_option hwcap_options[] = {
-       {HWCAP_SAMPLERATE, T_UINT64, "Sample rate", "samplerate"},
-       {HWCAP_CAPTURE_RATIO, T_UINT64, "Pre-trigger capture ratio", "captureratio"},
-       {HWCAP_PATTERN_MODE, T_CHAR, "Pattern generator mode", "patternmode"},
+       {SR_HWCAP_SAMPLERATE, SR_T_UINT64, "Sample rate", "samplerate"},
+       {SR_HWCAP_CAPTURE_RATIO, SR_T_UINT64, "Pre-trigger capture ratio", "captureratio"},
+       {SR_HWCAP_PATTERN_MODE, SR_T_CHAR, "Pattern generator mode", "patternmode"},
        {0, 0, NULL, NULL},
 };
 
 #ifdef HAVE_LA_DEMO
-extern struct device_plugin demo_plugin_info;
+extern struct sr_device_plugin demo_plugin_info;
 #endif
 #ifdef HAVE_LA_SALEAE_LOGIC
-extern struct device_plugin saleae_logic_plugin_info;
+extern struct sr_device_plugin saleae_logic_plugin_info;
 #endif
 #ifdef HAVE_LA_OLS
-extern struct device_plugin ols_plugin_info;
+extern struct sr_device_plugin ols_plugin_info;
 #endif
 #ifdef HAVE_LA_ZEROPLUS_LOGIC_CUBE
-extern struct device_plugin zeroplus_logic_cube_plugin_info;
+extern struct sr_device_plugin zeroplus_logic_cube_plugin_info;
 #endif
 #ifdef HAVE_LA_ASIX_SIGMA
-extern struct device_plugin asix_sigma_plugin_info;
+extern struct sr_device_plugin asix_sigma_plugin_info;
 #endif
 #ifdef HAVE_LA_LINK_MSO19
-extern struct device_plugin link_mso19_plugin_info;
+extern struct sr_device_plugin link_mso19_plugin_info;
 #endif
 #ifdef HAVE_LA_ALSA
-extern struct device_plugin alsa_plugin_info;
+extern struct sr_device_plugin alsa_plugin_info;
 #endif
 
 
@@ -119,8 +119,8 @@ struct sr_device_instance *sr_device_instance_new(int index, int status,
        return sdi;
 }
 
-struct sr_device_instance *get_sr_device_instance(
-                               GSList *device_instances, int device_index)
+struct sr_device_instance *sr_get_device_instance(GSList *device_instances,
+                                                 int device_index)
 {
        struct sr_device_instance *sdi;
        GSList *l;
@@ -138,11 +138,11 @@ struct sr_device_instance *get_sr_device_instance(
 void sr_device_instance_free(struct sr_device_instance *sdi)
 {
        switch (sdi->instance_type) {
-       case USB_INSTANCE:
-               usb_device_instance_free(sdi->usb);
+       case SR_USB_INSTANCE:
+               sr_usb_device_instance_free(sdi->usb);
                break;
-       case SERIAL_INSTANCE:
-               serial_device_instance_free(sdi->serial);
+       case SR_SERIAL_INSTANCE:
+               sr_serial_device_instance_free(sdi->serial);
                break;
        default:
                /* No specific type, nothing extra to free. */
@@ -155,12 +155,12 @@ void sr_device_instance_free(struct sr_device_instance *sdi)
        free(sdi);
 }
 
-struct usb_device_instance *usb_device_instance_new(uint8_t bus,
+struct sr_usb_device_instance *sr_usb_device_instance_new(uint8_t bus,
                        uint8_t address, struct libusb_device_handle *hdl)
 {
-       struct usb_device_instance *udi;
+       struct sr_usb_device_instance *udi;
 
-       if (!(udi = malloc(sizeof(struct usb_device_instance))))
+       if (!(udi = malloc(sizeof(struct sr_usb_device_instance))))
                return NULL;
 
        udi->bus = bus;
@@ -170,7 +170,7 @@ struct usb_device_instance *usb_device_instance_new(uint8_t bus,
        return udi;
 }
 
-void usb_device_instance_free(struct usb_device_instance *usb)
+void sr_usb_device_instance_free(struct sr_usb_device_instance *usb)
 {
        /* Avoid compiler warnings. */
        usb = usb;
@@ -178,12 +178,12 @@ void usb_device_instance_free(struct usb_device_instance *usb)
        /* Nothing to do for this device instance type. */
 }
 
-struct serial_device_instance *serial_device_instance_new(
+struct sr_serial_device_instance *sr_serial_device_instance_new(
                                                const char *port, int fd)
 {
-       struct serial_device_instance *serial;
+       struct sr_serial_device_instance *serial;
 
-       if (!(serial = malloc(sizeof(struct serial_device_instance))))
+       if (!(serial = malloc(sizeof(struct sr_serial_device_instance))))
                return NULL;
 
        serial->port = strdup(port);
@@ -192,7 +192,7 @@ struct serial_device_instance *serial_device_instance_new(
        return serial;
 }
 
-void serial_device_instance_free(struct serial_device_instance *serial)
+void sr_serial_device_instance_free(struct sr_serial_device_instance *serial)
 {
        free(serial->port);
 }