Important: The information in this document is obsolete and should not be used for new development.
OpenDictionary
TheOpenDictionaryfunction creates an access path to the specified dictionary file.
FUNCTION OpenDictionary (theFSSpecPtr: FSSpecPtr; accessPermission: SignedByte; VAR dictionaryReference: LongInt) : OSErr;
theFSSpecPtr- A pointer to the file system specification record for the file to open. This record contains the filename, directory, and volume associated with this dictionary file.
accessPermission- The read and write permission for the access path. This permission must follow the File Manager access permission conventions.
dictionaryReference- A number that specifies a particular open dictionary.
DESCRIPTION
TheOpenDictionaryfunction returns, in thedictionaryReferenceparameter, a dictionary reference number--an identifying value that you use to specify the dictionary in subsequent calls to the Dictionary Manager.The data structures accessed through the
dictionaryReferenceparameter are allocated in the current heap. If the same dictionary is to be shared across applications, make sure the current zone is the system zone, so the data structures will be allocated in the system heap.The following constants define the allowed values for the
accessPermissionparameter:
Constant Value Explanation fsRdPerm 1 Request read permission only fsWrPerm 2 Request write permission only fsRdWrPerm 3 Request exclusive read/write permission If the requested permission is not granted,
OpenDictionaryreturns a result code that specifies the type of error.SPECIAL CONSIDERATIONS
OpenDictionarymay move memory; your application should not call this function at interrupt time.RESULT CODES
In addition to the standard File Manager, Memory Manager, and Resource Manager errors,OpenDictionarymay return any of the following result codes.
noErr 0 No error notBTree -410 File is not a dictionary SEE ALSO
File system specification records, File Manager access permissions, and File Manager error codes are described in Inside Macintosh: Files. Memory Manager error codes are described in Inside Macintosh: Memory. Resource Manager error codes are described in Inside Macintosh: More Macintosh Toolbox.For sample code that uses the
OpenDictionaryfunction, see Listing 8-2 on page 8-13.