Mac OS 9
FileMapping.h
Go to the documentation of this file.
1 
19 #ifndef __FILEMAPPING__
20 #define __FILEMAPPING__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FILES__
27 #include <Files.h>
28 #endif
29 
30 #ifndef __PROCESSES__
31 #include <Processes.h>
32 #endif
33 
34 #if PRAGMA_ONCE
35 #pragma once
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 #if PRAGMA_IMPORT
44 #pragma import on
45 #endif
46 
47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = mac68k
49 #elif PRAGMA_STRUCT_PACKPUSH
50 #pragma pack(push, 2)
51 #elif PRAGMA_STRUCT_PACK
52 #pragma pack(2)
53 #endif
54 
61  typedef struct OpaqueBackingFileID *BackingFileID;
62 
70  typedef UInt32 MappingPrivileges;
71  enum
72  {
73  kInvalidMappedPrivileges = 0x00000000,
74 
79  kCanReadMappedFile = 0x00000001,
85  kCanWriteMappedFile = 0x00000002,
92  (unsigned long)0x80000000,
95  (unsigned long)(kCanReadMappedFile + kCanWriteMappedFile +
97  };
98 
106  typedef UInt32 MappedFileAttributes;
107  enum
108  {
109 
114  kIsMappedScratchFile = 0x00000001
115  };
116 
119  enum
120  {
121 
126  };
127 
137  {
138 
171  };
173 
181  typedef UInt32 FileViewAccess;
182  enum
183  {
184 
207  kFileViewAccessReadWrite = kFileViewAccessReadMask |
210  };
211 
221  typedef OptionBits FileViewOptions;
222 
225  enum
226  {
227 
232  kMapEntireFork = -1
233  };
234 
241  typedef struct OpaqueFileViewID *FileViewID;
242 
245  enum
246  {
247 
252  };
253 
262  {
263 
273  LogicalAddress viewBase;
278  ByteCount viewLength;
298  ByteCount guardLength;
304  };
306 #if CALL_NOT_IN_CARBON
355  OSErr
356  OpenMappedFile(const FSRef *ref, UniCharCount forkNameLength,
357  const UniChar *forkName,
359 
405  OSErr
406  FSpOpenMappedFile(const FSSpec *spec, Boolean mapResFork,
408 
462  OSErr
463  OpenMappedScratchFile(FSVolumeRefNum volume, ByteCount fileSize,
465 
495  OSErr
496  CloseMappedFile(BackingFileID backingFile);
497 
532  OSErr
533  GetMappedFileInformation(BackingFileID backingFile, PBVersion version,
534  MappedFileInformation *mappedFileInfo);
535 
566  OSErr
567  GetNextMappedFile(BackingFileID *backingFile);
568 
603  OSErr
604  SetMappedFileSize(BackingFileID backingFile, UInt16 positionMode,
605  const SInt64 *positionOffset);
606 
634  OSErr
636 
711  OSErr
713  const UInt64 *backingBase,
714  ByteCount backingLength, FileViewAccess access,
715  ByteCount guardLength, FileViewOptions options,
716  LogicalAddress *viewBase, ByteCount *viewLength,
717  FileViewID *theView);
718 
746  OSErr
748 
783  OSErr
784  GetFileViewInformation(FileViewID theView, PBVersion version,
785  FileViewInformation *fileViewInfo);
786 
814  OSErr
815  GetFileViewFromAddress(LogicalAddress address, FileViewID *theView);
816 
847  OSErr
849 
878  OSErr
880 
910  OSErr
912  FileViewID theView,
913  const UInt64 *newBackingBase) ;
914 
915 #endif
917 #if PRAGMA_STRUCT_ALIGN
918 #pragma options align = reset
919 #elif PRAGMA_STRUCT_PACKPUSH
920 #pragma pack(pop)
921 #elif PRAGMA_STRUCT_PACK
922 #pragma pack()
923 #endif
924 
925 #ifdef PRAGMA_IMPORT_OFF
926 #pragma import off
927 #elif PRAGMA_IMPORT
928 #pragma import reset
929 #endif
930 
931 #ifdef __cplusplus
932 }
933 #endif
934 
935 #endif
OSErr SetFileViewAccess(FileViewID theView, FileViewAccess access)
@ kIsMappedScratchFile
Definition: FileMapping.h:114
struct OpaqueFileViewID * FileViewID
Definition: FileMapping.h:241
@ kMapEntireFork
Definition: FileMapping.h:232
@ kFileViewInformationVersion1
Definition: FileMapping.h:251
OptionBits FileViewOptions
Definition: FileMapping.h:221
OSErr MapFileView(BackingFileID backingFile, const UInt64 *backingBase, ByteCount backingLength, FileViewAccess access, ByteCount guardLength, FileViewOptions options, LogicalAddress *viewBase, ByteCount *viewLength, FileViewID *theView)
UInt32 MappedFileAttributes
Definition: FileMapping.h:106
OSErr GetFileViewAccessOptions(FileViewAccess *access, FileViewOptions *options)
OSErr GetNextFileView(FileViewID *theView)
OSErr GetFileViewInformation(FileViewID theView, PBVersion version, FileViewInformation *fileViewInfo)
@ kFileViewAccessExecuteMask
Definition: FileMapping.h:202
@ kFileViewAccessExcluded
Definition: FileMapping.h:204
@ kFileViewAccessReadBit
Definition: FileMapping.h:188
@ kFileViewAccessWriteMask
Definition: FileMapping.h:200
@ kFileViewAccessExecuteBit
Definition: FileMapping.h:198
@ kFileViewAccessWriteBit
Definition: FileMapping.h:193
@ kFileViewAccessReadOnly
Definition: FileMapping.h:205
@ kFileViewAccessReadMask
Definition: FileMapping.h:199
OSErr SetFileViewBackingBase(FileViewID theView, const UInt64 *newBackingBase)
UInt32 FileViewAccess
Definition: FileMapping.h:181
@ kCanWriteMappedFile
Definition: FileMapping.h:85
@ kValidMappingPrivilegesMask
Definition: FileMapping.h:94
@ kCanReadMappedFile
Definition: FileMapping.h:79
@ kNoProcessMappedFile
Definition: FileMapping.h:91
OSErr GetFileViewFromAddress(LogicalAddress address, FileViewID *theView)
@ kMappedFileInformationVersion1
Definition: FileMapping.h:125
OSErr UnmapFileView(FileViewID theView)
OSErr OpenMappedFile(const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName, MappingPrivileges privileges, BackingFileID *backingFile)
struct OpaqueBackingFileID * BackingFileID
Definition: FileMapping.h:61
UInt32 MappingPrivileges
Definition: FileMapping.h:70
File Manager (MFS, HFS, and HFS+) Interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Process Manager Interfaces.
Definition: Files.h:6527
Definition: FileMapping.h:262
FileViewOptions options
Definition: FileMapping.h:303
BackingFileID backingFile
Definition: FileMapping.h:283
FileViewAccess access
Definition: FileMapping.h:293
ByteCount guardLength
Definition: FileMapping.h:298
LogicalAddress viewBase
Definition: FileMapping.h:273
ProcessSerialNumber owningProcess
Definition: FileMapping.h:268
ByteCount viewLength
Definition: FileMapping.h:278
UInt64 backingBase
Definition: FileMapping.h:288
Definition: Files.h:70
Definition: FileMapping.h:137
ProcessSerialNumber owningProcess
Definition: FileMapping.h:143
UInt64 currentSize
Definition: FileMapping.h:165
MappedFileAttributes attributes
Definition: FileMapping.h:170
HFSUniStr255 * forkName
Definition: FileMapping.h:155
MappingPrivileges privileges
Definition: FileMapping.h:160
FSRef * ref
Definition: FileMapping.h:149
Definition: Processes.h:65
Definition: MacTypes.h:110
Definition: MacTypes.h:104