home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / MachOViewer / Source / RCS / MappedFile.h,v < prev    next >
Encoding:
Text File  |  1994-02-10  |  2.1 KB  |  96 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ediger:1.2;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     94.02.10.22.19.52;  author ediger;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     94.02.07.21.35.26;  author ediger;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @Definition of a memory-mapped file representation.
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @added - (char *)errorString method to assist in error handling
  28. @
  29. text
  30. @#import <stdlib.h>
  31. #import <libc.h>
  32. #import <errno.h>
  33. #import <assert.h>
  34. #import <sys/types.h>
  35. #import <sys/stat.h>
  36. #import <mach/mach.h>
  37. #import <mach/mach_error.h>
  38. #import <objc/Object.h>
  39.  
  40. //H+
  41. //
  42. //    MappedFile - simple memory-mapped file object.
  43. //
  44. //H-
  45.  
  46. /* $Id: MappedFile.h,v 1.1 94/02/07 21:35:26 ediger Exp Locker: ediger $ */
  47. /* $Log:    MappedFile.h,v $
  48.  * Revision 1.1  94/02/07  21:35:26  ediger
  49.  * Initial revision
  50.  *  */
  51.  
  52. @@interface MappedFile: Object
  53. {
  54.     // info that has to be here to map the file.
  55.     char       *FileName;
  56.  
  57.     // info that has to be kept around to unmap the file.
  58.     int         fd;
  59.     char       *mappedAddress;
  60.     struct stat statBuf;
  61.  
  62.     // auxilliary info to find out what the last error was.
  63.     int         lastErrno;          // Unix syscall errno
  64.     kern_return_t lastKernReturn;   // Mach kernel call error
  65. }
  66.  
  67. - init;                          // do a bit of initializing.
  68. - free;                          // clean up and ditch memory consumption.
  69. - filename:(char *)fileName;     // set the name of the file to be mapped.
  70. - (BOOL)map;                     // map the file after it's name is set.
  71. - (BOOL)unmap;                   // unmap a mapped file.
  72. - (char *)address;               // find out at what address file is mapped.
  73. - (char *)filename;              // find out the name of the mapped file.
  74. - (int)size;                     // find out what size of file is mapped.
  75. - (int)lastUnixError;            // find out what last UNIX syscall error was.
  76. - (kern_return_t)lastMachError;  // find out what last Mach syscall error was.
  77. - (char *)errorString;           // get error system error string related to
  78.                                  // last Mach or Unix error.
  79.  
  80. @@end
  81. @
  82.  
  83.  
  84. 1.1
  85. log
  86. @Initial revision
  87. @
  88. text
  89. @d8 1
  90. d17 5
  91. a21 2
  92. /* $Id$ */
  93. /* $Log$ */
  94. d48 2
  95. @
  96.