From: Uwe Hermann Date: Tue, 28 Feb 2012 22:52:30 +0000 (+0100) Subject: sr/cli/gtk/qt/: s/plugin/driver/. X-Git-Tag: sigrok-cli-0.3.0~19 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a210c4ccc2a730c8e02e3f330fbff36b7f81e2da;p=sigrok-cli.git sr/cli/gtk/qt/: s/plugin/driver/. --- diff --git a/parsers.c b/parsers.c index cd0a15f..47f11a0 100644 --- a/parsers.c +++ b/parsers.c @@ -127,7 +127,7 @@ GHashTable *parse_generic_arg(const char *arg) struct sr_dev *parse_devstring(const char *devstring) { struct sr_dev *dev, *d; - struct sr_dev_plugin **plugins; + struct sr_dev_driver **drivers; GSList *devs, *l; int i, num_devs, dev_num, dev_cnt; char *tmp; @@ -138,8 +138,8 @@ struct sr_dev *parse_devstring(const char *devstring) dev = NULL; dev_num = strtol(devstring, &tmp, 10); if (tmp != devstring) { - /* argument is numeric, meaning a device ID. Make all driver - * plugins scan for devices. + /* argument is numeric, meaning a device ID. Make all drivers + * scan for devices. */ num_devs = num_real_devs(); if (dev_num < 0 || dev_num >= num_devs) @@ -164,11 +164,11 @@ struct sr_dev *parse_devstring(const char *devstring) * no need to let them all scan */ dev = NULL; - plugins = sr_hw_list(); - for (i = 0; plugins[i]; i++) { - if (strcmp(plugins[i]->name, devstring)) + drivers = sr_hw_list(); + for (i = 0; drivers[i]; i++) { + if (strcmp(drivers[i]->name, devstring)) continue; - num_devs = sr_hw_init(plugins[i]); + num_devs = sr_hw_init(drivers[i]); if (num_devs == 1) { devs = sr_dev_list(); dev = devs->data; diff --git a/sigrok-cli.c b/sigrok-cli.c index d34dd5a..b88250f 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -86,7 +86,7 @@ static GOptionEntry optargs[] = { static void show_version(void) { GSList *l; - struct sr_dev_plugin **plugins; + struct sr_dev_driver **drivers; struct sr_input_format **inputs; struct sr_output_format **outputs; struct srd_decoder *dec; @@ -95,9 +95,9 @@ static void show_version(void) printf("sigrok-cli %s\n\n", VERSION); printf("Supported hardware drivers:\n"); - plugins = sr_hw_list(); - for (i = 0; plugins[i]; i++) { - printf(" %-20s %s\n", plugins[i]->name, plugins[i]->longname); + drivers = sr_hw_list(); + for (i = 0; drivers[i]; i++) { + printf(" %-20s %s\n", drivers[i]->name, drivers[i]->longname); } printf("\n"); @@ -200,7 +200,7 @@ static void show_dev_detail(void) } title = "Supported options:\n"; - hwcaps = dev->plugin->hwcap_get_all(); + hwcaps = dev->driver->hwcap_get_all(); for (cap = 0; hwcaps[cap]; cap++) { if (!(hwo = sr_hw_hwcap_get(hwcaps[cap]))) continue; @@ -746,11 +746,11 @@ static int set_dev_options(struct sr_dev *dev, GHashTable *args) ret = sr_parse_sizestring(value, &tmp_u64); if (ret != SR_OK) break; - ret = dev->plugin->dev_config_set(dev->plugin_index, + ret = dev->driver->dev_config_set(dev->driver_index, sr_hwcap_options[i].hwcap, &tmp_u64); break; case SR_T_CHAR: - ret = dev->plugin->dev_config_set(dev->plugin_index, + ret = dev->driver->dev_config_set(dev->driver_index, sr_hwcap_options[i].hwcap, value); break; case SR_T_BOOL: @@ -758,7 +758,7 @@ static int set_dev_options(struct sr_dev *dev, GHashTable *args) tmp_bool = TRUE; else tmp_bool = sr_parse_boolstring(value); - ret = dev->plugin->dev_config_set(dev->plugin_index, + ret = dev->driver->dev_config_set(dev->driver_index, sr_hwcap_options[i].hwcap, GINT_TO_POINTER(tmp_bool)); break; @@ -836,7 +836,7 @@ static void run_session(void) return; if (opt_continuous) { - if (!sr_hw_has_hwcap(dev->plugin, SR_HWCAP_CONTINUOUS)) { + if (!sr_hw_has_hwcap(dev->driver, SR_HWCAP_CONTINUOUS)) { printf("This device does not support continuous sampling."); sr_session_destroy(); return; @@ -868,8 +868,8 @@ static void run_session(void) return; } - if (sr_hw_has_hwcap(dev->plugin, SR_HWCAP_LIMIT_MSEC)) { - if (dev->plugin->dev_config_set(dev->plugin_index, + if (sr_hw_has_hwcap(dev->driver, SR_HWCAP_LIMIT_MSEC)) { + if (dev->driver->dev_config_set(dev->driver_index, SR_HWCAP_LIMIT_MSEC, &time_msec) != SR_OK) { printf("Failed to configure time limit.\n"); sr_session_destroy(); @@ -894,7 +894,7 @@ static void run_session(void) return; } - if (dev->plugin->dev_config_set(dev->plugin_index, + if (dev->driver->dev_config_set(dev->driver_index, SR_HWCAP_LIMIT_SAMPLES, &limit_samples) != SR_OK) { printf("Failed to configure time-based sample limit.\n"); sr_session_destroy(); @@ -905,7 +905,7 @@ static void run_session(void) if (opt_samples) { if ((sr_parse_sizestring(opt_samples, &limit_samples) != SR_OK) - || (dev->plugin->dev_config_set(dev->plugin_index, + || (dev->driver->dev_config_set(dev->driver_index, SR_HWCAP_LIMIT_SAMPLES, &limit_samples) != SR_OK)) { printf("Failed to configure sample limit.\n"); sr_session_destroy(); @@ -913,7 +913,7 @@ static void run_session(void) } } - if (dev->plugin->dev_config_set(dev->plugin_index, + if (dev->driver->dev_config_set(dev->driver_index, SR_HWCAP_PROBECONFIG, (char *)dev->probes) != SR_OK) { printf("Failed to configure probes.\n"); sr_session_destroy();