home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_03 / 8n03114a < prev    next >
Text File  |  1990-03-20  |  937b  |  36 lines

  1. *****Listing 4*****
  2.  
  3. // LIST.HPP - linked list interface
  4.  
  5. #ifndef _LIST_HPP
  6. #define _LIST_HPP
  7.  
  8. class LIST
  9.    {
  10.    struct listelem
  11.       {
  12.       struct listelem *prev, *next;
  13.       void *data;
  14.       unsigned int size;
  15.       };
  16.    struct listelem *head, *curr, *tail;
  17. public:
  18.    LIST();
  19.    ~LIST();
  20.    void *get_head(unsigned int &sz);
  21.    void *get_curr(unsigned int &sz);
  22.    void *get_tail(unsigned int &sz);
  23.    void *get_prev(unsigned int &sz);
  24.    void *get_next(unsigned int &sz);
  25.    void add_before(void *vptr, unsigned int sz);
  26.    void add_after(void *vptr, unsigned int sz);
  27.    void add_head(void *vptr, unsigned int sz);
  28.    void add_tail(void *vptr, unsigned int sz);
  29.    void delete_curr(void);
  30.    virtual void delete_data(struct listelem *lptr);
  31.    virtual void create_data(struct listelem *lptr);
  32.    virtual void copy_data(struct listelem *lptr, void *from);
  33.    };
  34.  
  35. #endif   // ifndef _LIST_HPP
  36.