home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WLLIST.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  2KB  |  54 lines

  1. /*
  2.  * wllist.h -- External definitions for wllist.c
  3.  *
  4.  */
  5.  
  6. #ifndef _WLLIST_HPP_INCLUDED
  7. #define _WLLIST_HPP_INCLUDED
  8.  
  9. #ifndef _WNO_PRAGMA_PUSH
  10. #pragma pack(push,8);
  11. #pragma enum int;
  12. #endif
  13.  
  14. /* Generic list link field */
  15.  
  16. typedef struct wllist_link   *   wllist_link_p;
  17. typedef struct wllist_header *   wllist_header_p;
  18.  
  19. typedef struct wllist_link {
  20.     wllist_link_p prev, next;
  21. } wllist_link;
  22.  
  23. typedef struct wllist_header {
  24.     wllist_link_p first;
  25.     wllist_link_p last;
  26. } wllist_header;
  27.  
  28. #define WLLNext( x )           (void *)(((wllist_link_p)(x))->next)
  29. #define WLLPrev( x )           (void *)(((wllist_link_p)(x))->prev)
  30. #define WLLFirst( x )          (void *)(((wllist_header_p)(x))->first)
  31. #define WLLLast( x )           (void *)(((wllist_header_p)(x))->last)
  32.  
  33. #define WLListRemoveFirst(x)   (void *)WLListDelete(x,WLLFirst(x))
  34.  
  35. #ifndef _WDECL_HPP_INCLUDED
  36. #  include "wdecl.hpp"
  37. #endif
  38.  
  39. extern WCMDECLSPEC void WCMDEF WLListNew( wllist_header_p top );
  40. extern WCMDECLSPEC void WCMDEF WLListPrefix( wllist_header_p top, void * entry );
  41. extern WCMDECLSPEC void WCMDEF WLListSuffix( wllist_header_p top, void * entry );
  42. extern WCMDECLSPEC void * WCMDEF WLListDelete( wllist_header_p top, void * entry );
  43. extern WCMDECLSPEC void WCMDEF WLListInsert( wllist_header_p top, void * prev,
  44.                                              void * entry );
  45. extern WCMDECLSPEC void WCMDEF WLListKill( wllist_header_p top, void (*free)( void * ) );
  46. extern WCMDECLSPEC void WCMDEF WLListFree( void *first, void (*free)( void * ) );
  47.  
  48. #ifndef _WNO_PRAGMA_PUSH
  49. #pragma enum pop;
  50. #pragma pack(pop);
  51. #endif
  52.  
  53. #endif /* _WLLIST_HPP_INCLUDED */
  54.