2004-08-09 21:15:05 +01:00
|
|
|
#ifndef GENERICLIST
|
|
|
|
#define GENERICLIST
|
|
|
|
|
|
|
|
struct list_struct
|
|
|
|
{
|
|
|
|
struct list_struct *next;
|
|
|
|
struct list_struct *prev;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct list_struct *List;
|
|
|
|
|
|
|
|
List list_create (const void *data);
|
|
|
|
List list_rewind (List list);
|
2004-08-16 10:50:37 +01:00
|
|
|
List list_forward (List list);
|
2004-08-09 21:15:05 +01:00
|
|
|
List list_insert (List list, const void *data);
|
|
|
|
List list_add (List list, const void *data);
|
|
|
|
List list_append (List list, const void *data);
|
|
|
|
List list_delete (List list);
|
|
|
|
int in_list (List list, const void *data);
|
|
|
|
int list_iterate (List list, int (*func) ());
|
|
|
|
List list_duplicate (List list);
|
|
|
|
void list_destroy (List list);
|
2004-08-09 22:44:16 +01:00
|
|
|
List list_shift (List list, int n);
|
|
|
|
int list_length (List list);
|
2004-08-09 21:15:05 +01:00
|
|
|
|
|
|
|
#endif
|