]> sigrok.org Git - sigrok-cli.git/commitdiff
cli: remove dead code
authorBert Vermeulen <redacted>
Sun, 22 Jul 2012 14:55:26 +0000 (16:55 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 09:28:59 +0000 (11:28 +0200)
parsers.c
sigrok-cli.c
sigrok-cli.h

index 65a265389f2d0dba79772b8e3cc3e19810bf12cf..8d0bbe5da8df7803c1f74855db7e26617d843897 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -126,66 +126,6 @@ GHashTable *parse_generic_arg(const char *arg, gboolean sep_first)
        return hash;
 }
 
-struct sr_dev *parse_devstring(const char *devstring)
-{
-       struct sr_dev *dev, *d;
-       struct sr_dev_driver **drivers;
-       GSList *devs, *l;
-       int i, num_devs, dev_num, dev_cnt;
-       char *tmp;
-
-       if (!devstring)
-               return NULL;
-
-       dev = NULL;
-       dev_num = strtol(devstring, &tmp, 10);
-       if (tmp != devstring) {
-               /* 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)
-                       return NULL;
-
-               dev_cnt = 0;
-               devs = sr_dev_list();
-               for (l = devs; l; l = l->next) {
-                       d = l->data;
-                       if (sr_dev_has_hwcap(d, SR_HWCAP_DEMO_DEV))
-                               continue;
-                       if (dev_cnt == dev_num) {
-                               if (dev_num == dev_cnt) {
-                                       dev = d;
-                                       break;
-                               }
-                       }
-                       dev_cnt++;
-               }
-       } else {
-               /* select device by driver -- only initialize that driver,
-                * no need to let them all scan
-                */
-               dev = NULL;
-               drivers = sr_driver_list();
-               for (i = 0; drivers[i]; i++) {
-                       if (strcmp(drivers[i]->name, devstring))
-                               continue;
-                       num_devs = sr_driver_init(drivers[i]);
-                       if (num_devs == 1) {
-                               devs = sr_dev_list();
-                               dev = devs->data;
-                       } else if (num_devs > 1) {
-                               printf("driver '%s' found %d devices, select by ID instead.\n",
-                                               devstring, num_devs);
-                       }
-                       /* fall through: selected driver found no devices */
-                       break;
-               }
-       }
-
-       return dev;
-}
-
 char *strcanon(const char *str)
 {
        int p0, p1;
index 814eb1f196d45c7bce1137b37acaaa22625bc4ba..b39dcf6b92225525015548a6cd1a8b9505b5c8aa 100644 (file)
@@ -1214,23 +1214,6 @@ static void load_input_file(void)
        }
 }
 
-int num_real_devs(void)
-{
-       struct sr_dev *dev;
-       GSList *devs, *l;
-       int num_devs;
-
-       num_devs = 0;
-       devs = sr_dev_list();
-       for (l = devs; l; l = l->next) {
-               dev = l->data;
-               if (!sr_dev_has_hwcap(dev, SR_HWCAP_DEMO_DEV))
-                       num_devs++;
-       }
-
-       return num_devs;
-}
-
 static int set_dev_options(struct sr_dev *dev, GHashTable *args)
 {
        GHashTableIter iter;
index 979b008b13472f977c010ee35c7667e1b1221be4..66028cdf6147b99a7270aac401b251a2d9411aef 100644 (file)
@@ -25,7 +25,6 @@ int num_real_devs(void);
 
 /* parsers.c */
 char **parse_probestring(int max_probes, const char *probestring);
-char **sr_parse_triggerstring(struct sr_dev *dev, const char *triggerstring);
 GHashTable *parse_generic_arg(const char *arg, gboolean sep_first);
 struct sr_dev *parse_devstring(const char *devstring);
 uint64_t sr_parse_timestring(const char *timestring);