}
unsigned int ptr_hash(const void*o)
{
- return string_hash3(&o, sizeof(o));
+ return string_hash3((const char*)&o, sizeof(o));
}
void* ptr_dup(const void*o)
{
}
*list = 0;
}
+void list_deep_free_(void*_list)
+{
+ commonlist_t**list = (commonlist_t**)_list;
+ commonlist_t*l = *list;
+ while(l) {
+ commonlist_t*next = l->next;
+ if(l->entry) {
+ free(l->entry);l->entry=0;
+ }
+ free(l);
+ l = next;
+ }
+ *list = 0;
+}
void*list_clone_(void*_list)
{
commonlist_t*l = *(commonlist_t**)_list;
void list_append_(void*_list, void*entry);
void list_prepend_(void*_list, void*entry);
void list_free_(void*_list);
+void list_deep_free_(void*_list);
void list_concat_(void*l1, void*l2);
#define list_new() ((void*)0)
#define list_append(list, e) {sizeof((list)->next);list_append_(&(list),(e));}
#define list_concat(l1, l2) {sizeof((l1)->next);sizeof((l2)->next);list_concat_(&(l1),&(l2));}
#define list_prepend(list, e) {sizeof((list)->next);list_prepend_(&(list),(e));}
#define list_free(list) {sizeof((list)->next);list_free_(&(list));}
+#define list_deep_free(list) {sizeof((list)->next);list_deep_free_(&(list));}
#define list_clone(list) (sizeof((list)->next),list_clone_(&(list)))
#define list_length(list) (sizeof((list)->next),list_length_(list))