#ifndef __LIBADT_SLIST_H #define __LIBADT_SLIST_H #include #include #include #include "debug.h" #include "mmm.h" //use stack memallocation features. need to make some changes in api typedef struct ListNode { struct ListNode *next; void *val; } ListNode; typedef struct List { int count; ListNode *first; ListNode *last; } List; struct List* llist_new(); struct ListNode* llist_newn( void* ); //#define __LLIST_NEW() //#define __LLIST_NEWN() int llist_length( struct List* ); int llist_index( struct List*, void* ); //llist_find( struct List ); //find by pointer //find by value void llist_reverse( struct List** ); void llist_append( struct List*, void* ); void llist_appendn( struct List**, void*, struct ListNode* ); //#define __LIST_APPEND() void* llist_pop( struct List* ); void llist_push( struct List*, void* ); void llist_free( struct List* ); void llist_freen( struct ListNode* ); //void llist_merge( struct List**, struct List* ); //void llist_compare( struct List //void llist_split( struct List*, //void llist_splitn( struct List*, struct ListNode* //void llist_splitp( struct List*, void* //void llist_splitc( struct List*, void (*)(void*) //void llist_sort( //sort by pointer //sort by value #define llist_first(A) ((A)->first) #define llist_last(A) ((A)->last) //#define LLIST_FOREACH() //#define LLIST_FOREACH_PREV() //#define llist_islastn(A) () //#define llist_isfirstn(A) () //#define llist_getfirstn(A) ((A)) //#define llist_getlastn(A) () #endif