]> sigrok.org Git - libsigrok.git/commitdiff
Prefixes for *_device_instance.
authorUwe Hermann <redacted>
Sun, 30 Jan 2011 15:44:26 +0000 (16:44 +0100)
committerUwe Hermann <redacted>
Sun, 30 Jan 2011 17:32:59 +0000 (18:32 +0100)
hardware/link-mso19/link-mso19.c
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c
hwplugin.c
sigrok-proto.h
sigrok.h

index 42779942fd8b52e11fa6dd544e2479a11c1e389a..924ce7c1c27df04303738268f15d8c826acbfb0e 100644 (file)
@@ -436,7 +436,7 @@ static int hw_init(char *deviceinfo)
                /* save a pointer to our private instance data */
                sdi->priv = mso;
 
-               sdi->serial = serial_device_instance_new(path, -1);
+               sdi->serial = sr_serial_device_instance_new(path, -1);
                if (!sdi->serial)
                        goto err_device_instance_free;
 
index dbad1888dfabceddbc9343594316431e951aacb8..cf9f025aecd86660be901fafe304bf7ac18b7619 100644 (file)
@@ -96,7 +96,7 @@ static struct samplerates samplerates = {
        0,
 };
 
-/* List of struct serial_device_instance */
+/* List of struct sr_serial_device_instance */
 static GSList *device_instances = NULL;
 
 /* Current state of the flag register */
@@ -295,7 +295,7 @@ static int hw_init(char *deviceinfo)
                                                    (final_devcnt, ST_INACTIVE,
                                                     "Openbench", "Logic Sniffer",
                                                     "v1.0");
-                                       sdi->serial = serial_device_instance_new
+                                       sdi->serial = sr_serial_device_instance_new
                                            (device_names[i], -1);
                                        device_instances =
                                            g_slist_append(device_instances, sdi);
index 5137539226a714aa22b25155b2a2d74b2ff23345..8a74332e615266ad40abba5a83b9afe4bbb82167 100644 (file)
@@ -335,11 +335,11 @@ static int hw_init(char *deviceinfo)
                                g_warning("firmware upload failed for "
                                          "device %d", devcnt);
 
-                       sdi->usb = usb_device_instance_new
+                       sdi->usb = sr_usb_device_instance_new
                                (libusb_get_bus_number(devlist[i]), 0, NULL);
                } else {
                        /* Already has the firmware, so fix the new address. */
-                       sdi->usb = usb_device_instance_new
+                       sdi->usb = sr_usb_device_instance_new
                            (libusb_get_bus_number(devlist[i]),
                             libusb_get_device_address(devlist[i]), NULL);
                }
index 92c33204ffe6645188cbdc1f0cddbc871c3a41fc..8399292cb9f06be7794798a5b864d7fb2328b562 100644 (file)
@@ -312,7 +312,7 @@ static int hw_init(char *deviceinfo)
                                return 0;
                        device_instances =
                            g_slist_append(device_instances, sdi);
-                       sdi->usb = usb_device_instance_new(
+                       sdi->usb = sr_usb_device_instance_new(
                                libusb_get_bus_number(devlist[i]),
                                libusb_get_device_address(devlist[i]), NULL);
                        devcnt++;
index efd8f5e1b77dac587ae042f48f6339476303218a..36f22016a7327d6a06b5bb9e16d3740520a5bcff 100644 (file)
@@ -139,10 +139,10 @@ void sr_device_instance_free(struct sr_device_instance *sdi)
 {
        switch (sdi->instance_type) {
        case USB_INSTANCE:
-               usb_device_instance_free(sdi->usb);
+               sr_usb_device_instance_free(sdi->usb);
                break;
        case SERIAL_INSTANCE:
-               serial_device_instance_free(sdi->serial);
+               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);
 }
index 4d700f3147d3ee0d3a552089e2e48a8787bb4831..4c31bfe63f484b2425353a6882d644c12e6e4008 100644 (file)
@@ -70,14 +70,14 @@ struct sr_device_instance *sr_get_device_instance(GSList *device_instances,
 void sr_device_instance_free(struct sr_device_instance *sdi);
 
 /* USB-specific instances */
-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);
-void usb_device_instance_free(struct usb_device_instance *usb);
+void sr_usb_device_instance_free(struct sr_usb_device_instance *usb);
 
 /* Serial-specific instances */
-struct serial_device_instance *serial_device_instance_new(
+struct sr_serial_device_instance *sr_serial_device_instance_new(
                                        const char *port, int fd);
-void serial_device_instance_free(struct serial_device_instance *serial);
+void sr_serial_device_instance_free(struct sr_serial_device_instance *serial);
 
 int find_hwcap(int *capabilities, int hwcap);
 struct hwcap_option *find_hwcap_option(int hwcap);
index 20bd59430a9df6c08bd4634c9162162348a3f967..f45577e7cdf7885da001011a0d82add7a85921e8 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -246,8 +246,8 @@ struct sr_device_instance {
        char *version;
        void *priv;
        union {
-               struct usb_device_instance *usb;
-               struct serial_device_instance *serial;
+               struct sr_usb_device_instance *usb;
+               struct sr_serial_device_instance *serial;
        };
 };
 
@@ -257,13 +257,13 @@ enum {
        SERIAL_INSTANCE,
 };
 
-struct usb_device_instance {
+struct sr_usb_device_instance {
        uint8_t bus;
        uint8_t address;
        struct libusb_device_handle *devhdl;
 };
 
-struct serial_device_instance {
+struct sr_serial_device_instance {
        char *port;
        int fd;
 };