]> sigrok.org Git - sigrok-cli.git/commitdiff
sr/cli/gtk/qt/: s/plugin/driver/.
authorUwe Hermann <redacted>
Tue, 28 Feb 2012 22:52:30 +0000 (23:52 +0100)
committerUwe Hermann <redacted>
Tue, 28 Feb 2012 22:52:30 +0000 (23:52 +0100)
parsers.c
sigrok-cli.c

index cd0a15fe36be42d3e165bba8c2e13a92683bbacb..47f11a0bee454ecbbd139e81161bae273a14a18a 100644 (file)
--- 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 *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;
        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) {
        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)
                 */
                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;
                 * 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;
                                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;
                        if (num_devs == 1) {
                                devs = sr_dev_list();
                                dev = devs->data;
index d34dd5a09ac2830910628b8c76552f5ae7841101..b88250f1dae1df7e6bf5ba4b0c382ab532c9d1ad 100644 (file)
@@ -86,7 +86,7 @@ static GOptionEntry optargs[] = {
 static void show_version(void)
 {
        GSList *l;
 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;
        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");
        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");
 
        }
        printf("\n");
 
@@ -200,7 +200,7 @@ static void show_dev_detail(void)
        }
 
        title = "Supported options:\n";
        }
 
        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;
        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 = 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:
                                        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:
                                        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);
                                        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;
                                                sr_hwcap_options[i].hwcap, 
                                                GINT_TO_POINTER(tmp_bool));
                                break;
@@ -836,7 +836,7 @@ static void run_session(void)
             return;
 
        if (opt_continuous) {
             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;
                        printf("This device does not support continuous sampling.");
                        sr_session_destroy();
                        return;
@@ -868,8 +868,8 @@ static void run_session(void)
                        return;
                }
 
                        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();
                            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;
                        }
 
                                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();
                            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)
 
        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();
                            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();
                  SR_HWCAP_PROBECONFIG, (char *)dev->probes) != SR_OK) {
                printf("Failed to configure probes.\n");
                sr_session_destroy();