home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols ;
- locks ediger:1.2;
- comment @ * @;
-
-
- 1.2
- date 94.02.10.22.19.52; author ediger; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 94.02.07.21.35.26; author ediger; state Exp;
- branches ;
- next ;
-
-
- desc
- @Definition of a memory-mapped file representation.
- @
-
-
- 1.2
- log
- @added - (char *)errorString method to assist in error handling
- @
- text
- @#import <stdlib.h>
- #import <libc.h>
- #import <errno.h>
- #import <assert.h>
- #import <sys/types.h>
- #import <sys/stat.h>
- #import <mach/mach.h>
- #import <mach/mach_error.h>
- #import <objc/Object.h>
-
- //H+
- //
- // MappedFile - simple memory-mapped file object.
- //
- //H-
-
- /* $Id: MappedFile.h,v 1.1 94/02/07 21:35:26 ediger Exp Locker: ediger $ */
- /* $Log: MappedFile.h,v $
- * Revision 1.1 94/02/07 21:35:26 ediger
- * Initial revision
- * */
-
- @@interface MappedFile: Object
- {
- // info that has to be here to map the file.
- char *FileName;
-
- // info that has to be kept around to unmap the file.
- int fd;
- char *mappedAddress;
- struct stat statBuf;
-
- // auxilliary info to find out what the last error was.
- int lastErrno; // Unix syscall errno
- kern_return_t lastKernReturn; // Mach kernel call error
- }
-
- - init; // do a bit of initializing.
- - free; // clean up and ditch memory consumption.
- - filename:(char *)fileName; // set the name of the file to be mapped.
- - (BOOL)map; // map the file after it's name is set.
- - (BOOL)unmap; // unmap a mapped file.
- - (char *)address; // find out at what address file is mapped.
- - (char *)filename; // find out the name of the mapped file.
- - (int)size; // find out what size of file is mapped.
- - (int)lastUnixError; // find out what last UNIX syscall error was.
- - (kern_return_t)lastMachError; // find out what last Mach syscall error was.
- - (char *)errorString; // get error system error string related to
- // last Mach or Unix error.
-
- @@end
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d8 1
- d17 5
- a21 2
- /* $Id$ */
- /* $Log$ */
- d48 2
- @
-