projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move all the parameter related functions into the lib-mime.
[apps/madmutt.git]
/
lib
/
list.c
diff --git
a/lib/list.c
b/lib/list.c
index
23dcf26
..
7ef6e6c
100644
(file)
--- a/
lib/list.c
+++ b/
lib/list.c
@@
-11,17
+11,17
@@
#include <string.h>
#include <lib-lib/mem.h>
#include <string.h>
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
#include "list.h"
#include "list.h"
-#include "str.h"
list2_t* list_new (void) {
return p_new(list2_t, 1);
}
void list_del (list2_t** l, list_del_t* del) {
list2_t* list_new (void) {
return p_new(list2_t, 1);
}
void list_del (list2_t** l, list_del_t* del) {
- size_t i = 0;
+ s
s
ize_t i = 0;
if (!l || !*l)
return;
if (del)
if (!l || !*l)
return;
if (del)
@@
-88,16
+88,16
@@
list2_t *list_cpy(list2_t *l) {
return ret;
}
return ret;
}
-list2_t* list_dup (list2_t* l, void* (*dup) (void*)) {
+list2_t* list_dup (list2_t* l, void* (*dup
_f
) (void*)) {
list2_t* ret = NULL;
int i = 0;
list2_t* ret = NULL;
int i = 0;
- if (list_empty(l) || !*dup)
+ if (list_empty(l) || !*dup
_f
)
return (NULL);
ret = list_new ();
ret->length = l->length;
ret->data = p_new(void*, l->length);
for (i = 0; i < l->length; i++)
return (NULL);
ret = list_new ();
ret->length = l->length;
ret->data = p_new(void*, l->length);
for (i = 0; i < l->length; i++)
- ret->data[i] = dup (l->data[i]);
+ ret->data[i] = dup
_f
(l->data[i]);
return (ret);
}
return (ret);
}
@@
-118,9
+118,9
@@
list2_t* list_from_str (const char* str, const char* delim) {
if (!str || !*str || !delim || !*delim)
return (NULL);
if (!str || !*str || !delim || !*delim)
return (NULL);
- tmp =
str_dup
(str);
+ tmp =
m_strdup
(str);
for (p = strtok (tmp, delim); p; p = strtok (NULL, delim)) {
for (p = strtok (tmp, delim); p; p = strtok (NULL, delim)) {
- list_push_back (&ret,
str_dup
(p));
+ list_push_back (&ret,
m_strdup
(p));
}
p_delete(&tmp);
return (ret);
}
p_delete(&tmp);
return (ret);