home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 308_01 / disklist.hpp < prev    next >
C/C++ Source or Header  |  1990-09-22  |  1KB  |  70 lines

  1.  
  2. /*
  3.     TITLE:        Class DiskList;
  4.     DESCRIPTION:    "C++ DiskList class header file";
  5.     VERSION:        1.01;
  6.     DATE:        9/22/90;
  7.     COMPILERS:      Borland Turbo C++ V.1.0;
  8.     KEYWORDS:    linked list header;
  9.     FILENAME:    DiskList.hpp;
  10.     SEE-ALSO:    DiskList.cpp;
  11.  
  12.     AUTHOR:         Michael Kelly
  13.             254 Gold St. Boston, Ma. 02127
  14.             Copyright 1990;
  15.  
  16.     COPYRIGHT:    This code may not be commercially distributed
  17.             without prior arrangement with the author.  It
  18.             may be used by programmers, without royalty, for
  19.             their personal programs and for "one of a kind"
  20.             or "custom" applications, provided that said
  21.             programmers assume all liability concerning
  22.             same.
  23. */
  24.  
  25.  
  26. #if !defined(DISKLIST_HPP)
  27. #define DISKLIST_HPP
  28.  
  29. #include <stdlib.h>
  30. #include <stdio.h>
  31.  
  32. #if !defined(DBL_LIST_HPP)
  33. #include "dbl_list.hpp"
  34. #endif
  35.  
  36. #define DEBUG
  37. #include "debug.h"
  38.  
  39.  
  40. #define DL_ID -2
  41.  
  42. class DiskList  :  public  DoubleList  {
  43.   protected:
  44.     FILE   *fp;
  45.  
  46.     struct DiskLink  {
  47.     long    item_offset;
  48.     size_t    itemsize;
  49.     int    dl_id;
  50.     };
  51.  
  52.     int compare(void *item1, void *item2);
  53.  
  54.   public:
  55.     DiskList(void);
  56.     ~DiskList(void);
  57.  
  58.     Boolean
  59.     add_item(void *item, size_t itemsize, Place place = LastPlace);
  60.     Boolean get_item(void *itembuf);
  61.     const void *get_ptr(void)
  62.     { lerror = INV_OP; return NULL; }
  63.  
  64.     size_t get_size(void);
  65.     virtual Boolean remove_item(void *itembuf);
  66.     int compare_item(void *item1);
  67. };
  68.  
  69. #endif
  70.