aboutsummaryrefslogtreecommitdiffstats
path: root/llist.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2014-01-25 00:07:31 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2014-01-25 00:07:31 +0000
commitb7fe9575ab40a3bcde643a8ae8750ca6fd2aaad7 (patch)
treed220eddc3489f44845e9855e901290f7f712a626 /llist.c
parentbea11309641a93ea51622fc85331d3960011afe4 (diff)
parentd7ca0c3e555ef0b5250873ddce48ccf2326b017a (diff)
downloadwavemon-b7fe9575ab40a3bcde643a8ae8750ca6fd2aaad7.tar.gz
Merge tag 'upstream/0.7.6'
Upstream version 0.7.6
Diffstat (limited to 'llist.c')
-rw-r--r--llist.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/llist.c b/llist.c
index 30fa744..798050a 100644
--- a/llist.c
+++ b/llist.c
@@ -33,7 +33,7 @@
* c = char
* f = float
* s = char *
- * S = char *, case-insensitive and fuzzy (for ll_scan)
+ * S = char *, case-insensitive and fuzzy
* * = void *
*/
@@ -75,7 +75,6 @@ static llist *arg2element(char type, va_list * ap, llist * next)
*((double *)l->e) = va_arg(*ap, double);
break;
case '*':
- l->e = (void *)malloc(sizeof(void *));
l->e = va_arg(*ap, void *);
}
l->next = next;
@@ -199,52 +198,6 @@ void ll_replace(int ld, unsigned long n, const char *format, ...)
}
/*
- * return the position of a given element in list (or -1)
- */
-signed long ll_scan(int ld, const char *format, ...)
-{
- llist *l = lists[ld];
- va_list ap;
- int len, i, rv = -1, int_v;
- double double_v;
- char *string_v;
-
- va_start(ap, format);
- switch (*format) {
- case 'd':
- int_v = va_arg(ap, int);
- for (i = 0; (l = l->next); i++)
- if (*(int *)l->e == int_v)
- rv = i;
- break;
- case 'f':
- double_v = va_arg(ap, double);
- for (i = 0; (l = l->next); i++)
- if (*(double *)l->e == double_v)
- rv = i;
- break;
- case 's':
- string_v = strdup(va_arg(ap, char *));
- for (i = 0; (l = l->next); i++)
- if (!strcmp(l->e, string_v))
- rv = i;
- free(string_v);
- break;
- case 'S':
- string_v = strdup(va_arg(ap, char *));
- len = strlen(string_v);
- for (i = 0; (l = l->next); i++)
- if (strncasecmp(l->e, string_v, len) == 0) {
- rv = i;
- break;
- }
- free(string_v);
- }
- va_end(ap);
- return rv;
-}
-
-/*
* return the number of elements in a given list
*/
unsigned long ll_size(int ld)