* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "sigrok-cli.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "sigrok-cli.h"
-struct sr_probe *find_probe(GSList *probelist, const char *probename)
+static struct sr_probe *find_probe(GSList *probelist, const char *probename)
{
struct sr_probe *probe;
GSList *l;
char **tokens, **range, **names, *eptr, str[8];
if (!probestring || !probestring[0])
- /* All probes are enabled by default by the driver. */
- return NULL;
+ /* Use all probes by default. */
+ return g_slist_copy(sdi->probes);
ret = SR_OK;
range = NULL;
if (!names[0] || (names[1] && names[2])) {
/* Need one or two arguments. */
g_critical("Invalid probe '%s'.", tokens[i]);
+ g_strfreev(names);
ret = SR_ERR;
break;
}
probe = find_probe(sdi->probes, names[0]);
if (!probe) {
g_critical("unknown probe '%s'.", names[0]);
+ g_strfreev(names);
ret = SR_ERR;
break;
}
}
probelist = g_slist_append(probelist, probe);
- if (names)
- g_strfreev(names);
+ g_strfreev(names);
}
}
return hash;
}
-char *strcanon(const char *str)
+static char *strcanon(const char *str)
{
int p0, p1;
char *s;