+
+list2_t* list_from_str (const char* str, const char* delim) {
+ list2_t* ret = NULL;
+ char* tmp = NULL, *p = NULL;
+
+ if (!str || !*str || !delim || !*delim)
+ return (NULL);
+
+ tmp = m_strdup(str);
+ for (p = strtok (tmp, delim); p; p = strtok (NULL, delim)) {
+ list_push_back (&ret, m_strdup(p));
+ }
+ p_delete(&tmp);
+ return (ret);
+}
+