From: Uwe Hermann Date: Sat, 18 Feb 2012 10:41:21 +0000 (+0100) Subject: sr/cli/gtk/qt: s/get_dev_info/dev_info_get/. X-Git-Tag: libsigrok-0.1.0~111 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=5097b0d0912165429aceddb5febbf68467b623f5 sr/cli/gtk/qt: s/get_dev_info/dev_info_get/. --- diff --git a/device.c b/device.c index 228727f8..9cc3b680 100644 --- 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; diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 4c22737e..94a95723 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -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, diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 8d573696..77f3e350 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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, diff --git a/hardware/chronovu-la8/chronovu-la8.c b/hardware/chronovu-la8/chronovu-la8.c index cdaf22c9..67c4f55c 100644 --- a/hardware/chronovu-la8/chronovu-la8.c +++ b/hardware/chronovu-la8/chronovu-la8.c @@ -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, diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 48c70029..447a2b31 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -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, diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 98e1507b..91e60f67 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -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, diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 33237527..76f82f99 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -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, diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 12ede4e1..b23bbbd7 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -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, diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 77cda797..8bb7d1ed 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -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, diff --git a/hwplugin.c b/hwplugin.c index 00ebec9c..b924f0d6 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -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) { diff --git a/output/analog.c b/output/analog.c index 4672af09..65bdc71d 100644 --- a/output/analog.c +++ b/output/analog.c @@ -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); diff --git a/output/chronovu_la8.c b/output/chronovu_la8.c index 49f157f7..91ad56e6 100644 --- a/output/chronovu_la8.c +++ b/output/chronovu_la8.c @@ -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 { diff --git a/output/csv.c b/output/csv.c index 18d5c420..819008ae 100644 --- a/output/csv.c +++ b/output/csv.c @@ -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 { diff --git a/output/gnuplot.c b/output/gnuplot.c index da4e25d2..ecbc027b 100644 --- a/output/gnuplot.c +++ b/output/gnuplot.c @@ -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); diff --git a/output/ols.c b/output/ols.c index 62ab5382..2025249d 100644 --- a/output/ols.c +++ b/output/ols.c @@ -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; diff --git a/output/text/text.c b/output/text/text.c index a2ae5265..d78895de 100644 --- a/output/text/text.c +++ b/output/text/text.c @@ -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); diff --git a/output/vcd.c b/output/vcd.c index 64e2438e..7ceb0bae 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -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); diff --git a/session_driver.c b/session_driver.c index cf6267f4..e8c4d2ec 100644 --- a/session_driver.c +++ b/session_driver.c @@ -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, }; diff --git a/session_file.c b/session_file.c index 1f85c049..e4f41a5e 100644 --- a/session_file.c +++ b/session_file.c @@ -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); diff --git a/sigrok.h b/sigrok.h index dcad1b77..256ed32e 100644 --- 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); diff --git a/strutil.c b/strutil.c index cb84e57f..9a791e19 100644 --- 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;