/*---------------------------------------------------------------------- File : sclists.h Contents: operations on singly connected lists Author : Christian Borgelt History : 23.02.1998 file created from file lists.h 02.03.1998 type definitions moved to sclists.c 03.03.1998 function scl_search added 21.06.1998 deletion function stored in list body 02.09.1998 client data added to functions ----------------------------------------------------------------------*/ #ifndef __SCLISTS__ #define __SCLISTS__ /*-------------------------------------------------------------------- Type Definitions --------------------------------------------------------------------*/ typedef struct sclist SCLIST; /* a singly connected list */ typedef void SCL_DELFN (void *p); typedef void SCL_APPFN (void *call, void *client); typedef int SCL_CMPFN (const void *p1, const void *p2, void *client); /* list element functions */ /*-------------------------------------------------------------------- Functions --------------------------------------------------------------------*/ SCLIST* scl_create (SCL_DELFN delfn); void scl_delete (SCLIST *list); int scl_len (SCLIST *list); void* scl_reset (SCLIST *list); void* scl_insert (SCLIST *list, unsigned int size); void* scl_get (SCLIST *list, int move); void scl_remove (SCLIST *list, int all); void* scl_search (SCLIST *list, const void *datum, SCL_CMPFN cmpfn, void *client); void scl_apply (SCLIST *list, SCL_APPFN appfn, void *client); void scl_sort (SCLIST *list, SCL_CMPFN cmpfn, void *client); int scl_merge (SCLIST *dst, SCLIST *src); #endif