]> sigrok.org Git - libsigrok.git/commitdiff
get_sr_device_instance() -> sr_get_device_instance().
authorUwe Hermann <redacted>
Sat, 29 Jan 2011 15:57:35 +0000 (16:57 +0100)
committerUwe Hermann <redacted>
Sun, 30 Jan 2011 17:32:56 +0000 (18:32 +0100)
hardware/alsa/alsa.c
hardware/asix-sigma/asix-sigma.c
hardware/demo/demo.c
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

index 4ee20369b75eb5a5ef6834aec570e5db15fb731b..8181f7ddf5c35ef98c8fb378a5bdd68b910597a1 100644 (file)
@@ -78,7 +78,7 @@ static int hw_opendev(int device_index)
        struct alsa *alsa;
        int err;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
        alsa = sdi->priv;
 
@@ -112,7 +112,7 @@ static void hw_closedev(int device_index)
        struct sr_device_instance *sdi;
        struct alsa *alsa;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return;
        alsa = sdi->priv;
        if (!alsa)
@@ -128,7 +128,7 @@ static void hw_cleanup(void)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, 0)))
+       if (!(sdi = sr_get_device_instance(device_instances, 0)))
                return;
 
        free(sdi->priv);
@@ -141,7 +141,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct alsa *alsa;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
        alsa = sdi->priv;
 
@@ -181,7 +181,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
        struct sr_device_instance *sdi;
        struct alsa *alsa;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
        alsa = sdi->priv;
 
@@ -266,7 +266,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        int count;
        int err;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
        alsa = sdi->priv;
 
index 1162b63cfbe3d81deab961370157344c9a640d07..68bfd8f8e2208a0ba0048d9486fdaae4a11d6a07 100644 (file)
@@ -526,7 +526,7 @@ static int hw_opendev(int device_index)
        struct sigma *sigma;
        int ret;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        sigma = sdi->priv;
@@ -669,7 +669,7 @@ static void hw_closedev(int device_index)
        struct sr_device_instance *sdi;
        struct sigma *sigma;
 
-       if ((sdi = get_sr_device_instance(device_instances, device_index)))
+       if ((sdi = sr_get_device_instance(device_instances, device_index)))
        {
                sigma = sdi->priv;
                if (sdi->status == ST_ACTIVE)
@@ -701,7 +701,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct sigma *sigma;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index))) {
+       if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
                fprintf(stderr, "It's NULL.\n");
                return NULL;
        }
@@ -733,7 +733,7 @@ static int hw_get_status(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       sdi = get_sr_device_instance(device_instances, device_index);
+       sdi = sr_get_device_instance(device_instances, device_index);
        if (sdi)
                return sdi->status;
        else
@@ -751,7 +751,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
        struct sigma *sigma;
        int ret;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        sigma = sdi->priv;
@@ -1211,7 +1211,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
 
        session_device_id = session_device_id;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        sigma = sdi->priv;
@@ -1320,7 +1320,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
        struct sigma *sigma;
        uint8_t modestatus;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return;
 
        sigma = sdi->priv;
index 5ab3969ef8e529092331c7226aa3b688396329b9..348fd704c48563280388e6696e1e8359d001c07f 100644 (file)
@@ -132,7 +132,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct sr_device_instance *sdi;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        switch (device_info_id) {
index 9f2b46a273032f1048f267581a06d14ddaa12713..392399d3b9a1ba0abce11dec18471fa2ac5bd585 100644 (file)
@@ -481,7 +481,7 @@ static int hw_opendev(int device_index)
        struct mso *mso;
        int ret = SR_ERR;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return ret;
 
        mso = sdi->priv;
@@ -519,7 +519,7 @@ static void hw_closedev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return;
 
        if (sdi->serial->fd != -1) {
@@ -535,7 +535,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct mso *mso;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
        mso = sdi->priv;
 
@@ -563,7 +563,7 @@ static int hw_get_status(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return ST_NOT_FOUND;
 
        return sdi->status;
@@ -578,7 +578,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        switch (capability) {
@@ -672,7 +672,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        struct datafeed_header header;
        int ret = SR_ERR;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return ret;
        mso = sdi->priv;
 
index 7d80b62e13a10afe40623e6f62e4dfd4a7e980c5..d5eb8ac918c27259d8e01f47f7b15b772c8c12bc 100644 (file)
@@ -328,7 +328,7 @@ static int hw_opendev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        sdi->serial->fd = serial_open(sdi->serial->port, O_RDWR);
@@ -344,7 +344,7 @@ static void hw_closedev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return;
 
        if (sdi->serial->fd != -1) {
@@ -375,7 +375,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct sr_device_instance *sdi;
        void *info;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        info = NULL;
@@ -404,7 +404,7 @@ static int hw_get_status(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return ST_NOT_FOUND;
 
        return sdi->status;
@@ -447,7 +447,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
        int ret;
        uint64_t *tmp_u64;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        if (sdi->status != ST_ACTIVE)
@@ -658,7 +658,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        uint16_t readcount, delaycount;
        uint8_t changrp_mask;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        if (sdi->status != ST_ACTIVE)
index dfc07f9b74774f6f68f8e410ffb3c7c2110fc723..3ddb4ccf6542e34cfe75aa720d4284b8e6971590 100644 (file)
@@ -173,7 +173,7 @@ struct sr_device_instance *sl_open_device(int device_index)
        struct libusb_device_descriptor des;
        int err, skip, i;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        libusb_get_device_list(usb_context, &devlist);
@@ -398,7 +398,7 @@ static void hw_closedev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if ((sdi = get_sr_device_instance(device_instances, device_index)))
+       if ((sdi = sr_get_device_instance(device_instances, device_index)))
                close_device(sdi);
 }
 
@@ -426,7 +426,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct sr_device_instance *sdi;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        switch (device_info_id) {
@@ -454,7 +454,7 @@ static int hw_get_status(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       sdi = get_sr_device_instance(device_instances, device_index);
+       sdi = sr_get_device_instance(device_instances, device_index);
        if (sdi)
                return sdi->status;
        else
@@ -503,7 +503,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
        int ret;
        uint64_t *tmp_u64;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        if (capability == HWCAP_SAMPLERATE) {
@@ -677,7 +677,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        int size, i;
        unsigned char *buf;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        packet = g_malloc(sizeof(struct datafeed_packet));
index ab48aa55cc3440fd775d8703bfdb50252b8f4103..b6916db196cb88e3edcd81ef23908b54288497af 100644 (file)
@@ -196,7 +196,7 @@ struct sr_device_instance *zp_open_device(int device_index)
        struct libusb_device_descriptor des;
        int err, i;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        libusb_get_device_list(usb_context, &devlist);
@@ -372,7 +372,7 @@ static void hw_closedev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if ((sdi = get_sr_device_instance(device_instances, device_index)))
+       if ((sdi = sr_get_device_instance(device_instances, device_index)))
                close_device(sdi);
 }
 
@@ -400,7 +400,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        struct sr_device_instance *sdi;
        void *info = NULL;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return NULL;
 
        switch (device_info_id) {
@@ -428,7 +428,7 @@ static int hw_get_status(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       sdi = get_sr_device_instance(device_instances, device_index);
+       sdi = sr_get_device_instance(device_instances, device_index);
        if (sdi)
                return sdi->status;
        else
@@ -461,7 +461,7 @@ static int hw_set_configuration(int device_index, int capability, void *value)
        struct sr_device_instance *sdi;
        uint64_t *tmp_u64;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        switch (capability) {
@@ -488,7 +488,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        unsigned int packet_num;
        unsigned char *buf;
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return SR_ERR;
 
        /* push configured settings to device */
@@ -553,7 +553,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
        packet.type = DF_END;
        session_bus(session_device_id, &packet);
 
-       if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+       if (!(sdi = sr_get_device_instance(device_instances, device_index)))
                return; /* TODO: Cry? */
 
        analyzer_reset(sdi->usb->devhdl);
index 5590a4bbb5b9a0d8e0b93d9f4583d7ca236f5cb2..e9bd582e8455e15c571f304a84f490fddc4374ea 100644 (file)
@@ -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;
index 8a96a88f96a484390754d7b6c0a6086f05fecb10..658553d489963906dcb3a2016b5d87616e084b29 100644 (file)
@@ -65,8 +65,8 @@ GSList *list_hwplugins(void);
 /* Generic device instances */
 struct sr_device_instance *sr_device_instance_new(int index,
        int status, const char *vendor, const char *model, const char *version);
-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);
 void sr_device_instance_free(struct sr_device_instance *sdi);
 
 /* USB-specific instances */