]> sigrok.org Git - libsigrok.git/commitdiff
sr/cli/gtk/qt: s/get_dev_info/dev_info_get/.
authorUwe Hermann <redacted>
Sat, 18 Feb 2012 10:41:21 +0000 (11:41 +0100)
committerUwe Hermann <redacted>
Sat, 18 Feb 2012 10:41:21 +0000 (11:41 +0100)
21 files changed:
device.c
hardware/alsa/alsa.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/chronovu-la8.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
output/analog.c
output/chronovu_la8.c
output/csv.c
output/gnuplot.c
output/ols.c
output/text/text.c
output/vcd.c
session_driver.c
session_file.c
sigrok.h
strutil.c

index 228727f8e0a782188cbf1d60e08d202963972bbd..9cc3b6800691b4debd76555b8b572bb1d20486b7 100644 (file)
--- a/device.c
+++ b/device.c
@@ -424,7 +424,7 @@ SR_API int sr_dev_info_get(const struct sr_dev *dev, int id, const void **data)
        if (data == NULL)
                return SR_ERR_ARG;
 
-       *data = dev->plugin->get_dev_info(dev->plugin_index, id);
+       *data = dev->plugin->dev_info_get(dev->plugin_index, id);
 
        if (*data == NULL)
                return SR_ERR;
index 4c22737e1314e31dec37de11b3ed8952bc81f424..94a95723adc4eea6ddd06df3a5c980f70ada848b 100644 (file)
@@ -165,7 +165,7 @@ static int hw_cleanup(void)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -400,7 +400,7 @@ SR_PRIV struct sr_dev_plugin alsa_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 8d5736964c7ca50e73108b5163d6bcd8f7388ab4..77f3e3507787a2797caab5821ee680bfd1632d49 100644 (file)
@@ -744,7 +744,7 @@ static int hw_cleanup(void)
        return ret;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct sigma *sigma;
@@ -1419,7 +1419,7 @@ SR_PRIV struct sr_dev_plugin asix_sigma_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index cdaf22c9da8293acc224a0bd1b3889c157b16837..67c4f55c2069ade43ad1fefb0c2506ff83008500 100644 (file)
@@ -111,7 +111,7 @@ struct la8 {
        uint8_t divcount;
 };
 
-/* This will be initialized via hw_get_dev_info()/SR_DI_SAMPLERATES. */
+/* This will be initialized via hw_dev_info_get()/SR_DI_SAMPLERATES. */
 static uint64_t supported_samplerates[255 + 1] = { 0 };
 
 /*
@@ -693,7 +693,7 @@ static int hw_cleanup(void)
        return ret;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct la8 *la8;
@@ -1121,7 +1121,7 @@ SR_PRIV struct sr_dev_plugin chronovu_la8_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 48c70029486575c66702ac1ebc73273976cd3cc3..447a2b318ad1da39d10231db25d24ac6d8dbdecb 100644 (file)
@@ -180,7 +180,7 @@ static int hw_cleanup(void)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        void *info = NULL;
@@ -497,7 +497,7 @@ SR_PRIV struct sr_dev_plugin demo_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 98e1507b939a0981f8e7aa559a4169f01177e34d..91e60f670be0743531014f5b2b9aeec6d9aa552c 100644 (file)
@@ -602,7 +602,7 @@ static int hw_closedev(int dev_index)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct mso *mso;
@@ -837,7 +837,7 @@ SR_PRIV struct sr_dev_plugin link_mso19_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 33237527fbc4fffeb21e0573cdb1fe07acd74591..76f82f99a5817922cfeb948da3deae8894072cb5 100644 (file)
@@ -555,7 +555,7 @@ static int hw_cleanup(void)
        return ret;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct ols_dev *ols;
@@ -1045,7 +1045,7 @@ SR_PRIV struct sr_dev_plugin ols_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 12ede4e168fb69d7053e4ba9bab07b1ddf35d987..b23bbbd7ab0ec1fdc9daf6bfde526fc244f5c84d 100644 (file)
@@ -500,7 +500,7 @@ static int hw_cleanup(void)
        return ret;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct fx2_dev *fx2;
@@ -898,7 +898,7 @@ SR_PRIV struct sr_dev_plugin saleae_logic_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 77cda797d49b7d14e8d39541c0301f82dee1d65c..8bb7d1ed1cf8a2fa4c36bf1a03b54fde61dd3212 100644 (file)
@@ -507,7 +507,7 @@ static int hw_cleanup(void)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct sr_dev_inst *sdi;
        struct zp *zp;
@@ -736,7 +736,7 @@ SR_PRIV struct sr_dev_plugin zeroplus_logic_cube_plugin_info = {
        .cleanup = hw_cleanup,
        .opendev = hw_opendev,
        .closedev = hw_closedev,
-       .get_dev_info = hw_get_dev_info,
+       .dev_info_get = hw_dev_info_get,
        .get_status = hw_get_status,
        .hwcap_get_all = hw_hwcap_get_all,
        .config_set = hw_config_set,
index 00ebec9c2d7a8e60206a70f7ce70f5085c039916..b924f0d65c3547871634fb0d61c3bf7ec19908f3 100644 (file)
@@ -134,8 +134,8 @@ SR_API int sr_hw_init(struct sr_dev_plugin *plugin)
        num_devs = plugin->init(NULL);
        for (i = 0; i < num_devs; i++) {
                num_probes = GPOINTER_TO_INT(
-                               plugin->get_dev_info(i, SR_DI_NUM_PROBES));
-               probe_names = (char **)plugin->get_dev_info(i,
+                               plugin->dev_info_get(i, SR_DI_NUM_PROBES));
+               probe_names = (char **)plugin->dev_info_get(i,
                                                        SR_DI_PROBE_NAMES);
 
                if (!probe_names) {
index 4672af09f39781c582a0b0b8d76f5f5023a2e4e7..65bdc71d3beaff7736871d7ec7f02989d4f0dd83 100644 (file)
@@ -136,7 +136,7 @@ static int init(struct sr_output *o, int default_spl, enum outputmode mode)
        snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
        num_probes = g_slist_length(o->dev->probes);
        if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                if (!(samplerate_s = sr_samplerate_string(samplerate))) {
                        g_free(ctx->header);
index 49f157f742a9fbf9db6f26527ea9ebf8e92f21f9..91ad56e6ed315357abaae2496088b2abeef3deec 100644 (file)
@@ -125,7 +125,7 @@ static int init(struct sr_output *o)
        num_probes = g_slist_length(o->dev->probes);
 
        if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                /* TODO: Error checks. */
        } else {
index 18d5c420bb406235f979c356600e1213f78fc1af..819008ae16b688f303fbc5d320ffa84b6d37aebe 100644 (file)
@@ -92,7 +92,7 @@ static int init(struct sr_output *o)
        num_probes = g_slist_length(o->dev->probes);
 
        if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                /* TODO: Error checks. */
        } else {
index da4e25d28db0a61299d99e93e385b46338615eae..ecbc027b05a38194e08d54d426bda5a6e76db10e 100644 (file)
@@ -101,7 +101,7 @@ static int init(struct sr_output *o)
        num_probes = g_slist_length(o->dev->probes);
        comment[0] = '\0';
        if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                if (!(frequency_s = sr_samplerate_string(samplerate))) {
                        sr_err("gnuplot out: %s: sr_samplerate_string failed",
@@ -325,7 +325,7 @@ static int analog_init(struct sr_output *o)
        num_probes = g_slist_length(o->dev->probes);
        comment[0] = '\0';
        if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                if (!(frequency_s = sr_samplerate_string(samplerate))) {
                        g_free(ctx->header);
index 62ab5382bbdf9008220ce49841dc69d5fa258a42..2025249d6a350e9657be065fce8e82c776bdebf3 100644 (file)
@@ -61,7 +61,7 @@ static int init(struct sr_output *o)
        ctx->unitsize = (num_enabled_probes + 7) / 8;
 
        if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE))
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
        else
                samplerate = 0;
index a2ae5265d9069e0c92f39d581b17b043117c728b..d78895de924c79bd74eedb487c00e5abbcda3f18 100644 (file)
@@ -111,7 +111,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
        snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
        num_probes = g_slist_length(o->dev->probes);
        if (o->dev->plugin || sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                if (!(samplerate_s = sr_samplerate_string(samplerate))) {
                        g_free(ctx->header);
index 64e2438e6813dbe7b10f5d83545921725bd1b7fd..7ceb0bae71a28a74795249abbd1fbf4f43a30b20 100644 (file)
@@ -85,7 +85,7 @@ static int init(struct sr_output *o)
                        PACKAGE, PACKAGE_VERSION);
 
        if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
-               ctx->samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+               ctx->samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
                                o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
                        g_string_free(ctx->header, TRUE);
index cf6267f463ccdf24916bd8ec037d5461d6a4b877..e8c4d2ecb48f220c0ac461ade466df6edc5f1252 100644 (file)
@@ -194,7 +194,7 @@ static int hw_opendev(int dev_index)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct session_vdev *vdev;
        void *info;
@@ -332,17 +332,17 @@ static int hw_start_acquisition(int dev_index, gpointer session_dev_id)
 }
 
 SR_PRIV struct sr_dev_plugin session_driver = {
-       "session",
-       "Session-emulating driver",
-       1,
-       hw_init,
-       hw_cleanup,
-       hw_opendev,
-       NULL,
-       hw_get_dev_info,
-       hw_get_status,
-       hw_hwcap_get_all,
-       hw_config_set,
-       hw_start_acquisition,
-       NULL,
+       .name = "session",
+       .longname = "Session-emulating driver",
+       .api_version = 1,
+       .init = hw_init,
+       .cleanup = hw_cleanup,
+       .opendev = hw_opendev,
+       .closedev = NULL,
+       .dev_info_get = hw_dev_info_get,
+       .get_status = hw_get_status,
+       .hwcap_get_all = hw_hwcap_get_all,
+       .config_set = hw_config_set,
+       .start_acquisition = hw_start_acquisition,
+       .stop_acquisition = NULL,
 };
index 1f85c049d6f3265e7163af4c1deff2f3d398756a..e4f41a5e9c7c18b747c43a4dc5f0874434fb9c39 100644 (file)
@@ -227,7 +227,7 @@ int sr_session_save(const char *filename)
                        fprintf(meta, "unitsize = %d\n", ds->ds_unitsize);
                        fprintf(meta, "total probes = %d\n", g_slist_length(dev->probes));
                        if (sr_dev_has_hwcap(dev, SR_HWCAP_SAMPLERATE)) {
-                               samplerate = *((uint64_t *) dev->plugin->get_dev_info(
+                               samplerate = *((uint64_t *) dev->plugin->dev_info_get(
                                                dev->plugin_index, SR_DI_CUR_SAMPLERATE));
                                s = sr_samplerate_string(samplerate);
                                fprintf(meta, "samplerate = %s\n", s);
index dcad1b7721acefa91065a0138a01f13ca4e10fdc..256ed32e2291bc13abc4a2f9af4ad406d5b8dd06 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -349,7 +349,7 @@ struct sr_dev_plugin {
        /* Device-specific */
        int (*opendev) (int dev_index);
        int (*closedev) (int dev_index);
-       void *(*get_dev_info) (int dev_index, int dev_info_id);
+       void *(*dev_info_get) (int dev_index, int dev_info_id);
        int (*get_status) (int dev_index);
        int *(*hwcap_get_all) (void);
        int (*config_set) (int dev_index, int hwcap, void *value);
index cb84e57f9c106cfbdf1b314a85b364c685de138e..9a791e1950f7c05e7f029bb99d509866e6f23007 100644 (file)
--- a/strutil.c
+++ b/strutil.c
@@ -131,7 +131,7 @@ SR_API char **sr_parse_triggerstring(struct sr_dev *dev,
        }
 
        tokens = g_strsplit(triggerstring, ",", max_probes);
-       trigger_types = dev->plugin->get_dev_info(0, SR_DI_TRIGGER_TYPES);
+       trigger_types = dev->plugin->dev_info_get(0, SR_DI_TRIGGER_TYPES);
        if (trigger_types == NULL)
                return NULL;