X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=parsers.c;h=a01f041802c20eceed66754c27542deff5be925b;hp=cd0a15fe36be42d3e165bba8c2e13a92683bbacb;hb=2d6ff326914f965ea5ee187213e8f2116c120d48;hpb=bc8e240025339710ddf4f9f0827275ae9a1fe9b7 diff --git a/parsers.c b/parsers.c index cd0a15f..a01f041 100644 --- a/parsers.c +++ b/parsers.c @@ -44,8 +44,7 @@ char **parse_probestring(int max_probes, const char *probestring) range = g_strsplit(tokens[i], "-", 2); if (!range[0] || !range[1] || range[2]) { /* Need exactly two arguments. */ - printf("Invalid probe syntax '%s'.\n", - tokens[i]); + g_critical("Invalid probe syntax '%s'.", tokens[i]); error = TRUE; break; } @@ -53,8 +52,7 @@ char **parse_probestring(int max_probes, const char *probestring) b = strtol(range[0], NULL, 10); e = strtol(range[1], NULL, 10); if (b < 1 || e > max_probes || b >= e) { - printf("Invalid probe range '%s'.\n", - tokens[i]); + g_critical("Invalid probe range '%s'.", tokens[i]); error = TRUE; break; } @@ -67,7 +65,7 @@ char **parse_probestring(int max_probes, const char *probestring) } else { tmp = strtol(tokens[i], NULL, 10); if (tmp < 1 || tmp > max_probes) { - printf("Invalid probe %d.\n", tmp); + g_critical("Invalid probe %d.", tmp); error = TRUE; break; } @@ -127,7 +125,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 +136,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 +162,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_driver_list(); + for (i = 0; drivers[i]; i++) { + if (strcmp(drivers[i]->name, devstring)) continue; - num_devs = sr_hw_init(plugins[i]); + num_devs = sr_driver_init(drivers[i]); if (num_devs == 1) { devs = sr_dev_list(); dev = devs->data;