1/*-------------------------------------------------------------------*/
2/*                         List  Functionality                       */
3/*-------------------------------------------------------------------*/
4#ifndef _SHLIST_H_
5#define _SHLIST_H_
6
7typedef struct SHLIST_STRUC {
8  void *data;
9  struct SHLIST_STRUC *next;
10  struct SHLIST_STRUC *prev;
11} SHLIST;
12
13typedef int (*shListCmp)( void *valo, void *valn, void *etalon );
14typedef int (*shListPrint)( void *val );
15typedef void (*shListFree)( void *val );
16typedef int (*shListEqual)( void *val,  void *idata );
17
18void shListInitList( SHLIST *listPtr );
19SHLIST *shListFindItem( SHLIST *head, void *val, shListEqual func );
20SHLIST *shListGetFirstItem( SHLIST *head );
21SHLIST *shListGetNItem( SHLIST *head, unsigned long num );
22SHLIST *shListGetLastItem( SHLIST *head );
23SHLIST *shListGetNextItem( SHLIST *head, SHLIST *item );
24SHLIST *shListGetPrevItem( SHLIST *head, SHLIST *item );
25void shListDelItem( SHLIST *head, SHLIST *item, shListFree func );
26void shListInsFirstItem( SHLIST *head, void *val );
27void shListInsBeforeItem( SHLIST *head, void *val, void *etalon,
28                          shListCmp func );
29void shListInsLastItem( SHLIST *head, void *val );
30void shListDelAllItems( SHLIST *head, shListFree func );
31void shListPrintAllItems( SHLIST *head, shListPrint func );
32unsigned long shListGetCount( SHLIST *head );
33
34#endif
35