home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / isam / include / diskmgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  651 b   |  38 lines

  1. // DISKMGR.H - DiskMgr Class Header
  2.  
  3. #ifndef DISKMGR_H
  4. #define DISKMGR_H
  5.  
  6. #include <io.h>
  7. #include <share.h>
  8.  
  9. #define IM_OK 0
  10. #define IM_ERROR (-1)
  11.  
  12. const caReadWrite = 0;
  13. const caNoCache   = 1;
  14.  
  15.  
  16. class DiskMgr
  17.     {
  18. private:
  19.  
  20.     int cache; // Cache type
  21.     void flush(int x);
  22.  
  23. public:
  24.  
  25.     DiskMgr(int ctype = caReadWrite);
  26.     ~DiskMgr(void);
  27.     int open(const char *path, int access)
  28.         {
  29.         return sopen(path, access, SH_DENYRW);
  30.         }
  31.     int close(int handle);
  32.     int read(int handle, void *buf, long start, unsigned len);
  33.     int write(int handle, void *buf, long start, unsigned len);
  34.     long seek(int fd, long offset);
  35.     };
  36.  
  37. #endif
  38.