Important: The information in this document is obsolete and should not be used for new development.
InitializeDictionary
TheInitializeDictionary
function constructs, for the specified file, the internal B*-tree structure that makes it a dictionary file.
FUNCTION InitializeDictionary (theFSSpecPtr: FSSpecPtr; maximumKeyLength: Integer; keyAttributes: Byte; script: ScriptCode): OSErr;
theFSSpecPtr
- A pointer to a file system specification record. This record contains the filename, directory, and volume associated with this dictionary file.
maximumKeyLength
The maximum length of the keys in the dictionary, including the length byte. The length must be less than or equal to 129.keyAttributes
The search criteria for the keys in the dictionary.- script
- The number that specifies the script system this dictionary supports.
DESCRIPTION
InitializeDictionary
does not open the dictionary file after the Dictionary Manager initializes it. To open and use a dictionary file, use theOpenDictionary
function (see page 8-22).You can set the maximum key length of a dictionary only once; you cannot change
it after the dictionary has been created. To maximize efficiency, keep the length to
a minimum.The
keyAttributes
parameter allows you to specify search criteria. For example, in one script system, it might be desirable to design the search to disregard case and be sensitive to diacritical marks, whereas in another script system these preferences might be reversed in keeping with the character encoding. Two predefined constants are available for the key attributes: thekIsCaseSensitive
constant indicates that search procedures are to be case sensitive, and thekIsNotDiacriticalSensitive
constant specifies that the search procedures are to ignore diacritical marks. To specify a combination of the different attributes, you add the constants together.
Constant Value Explanation kIsCaseSensitive 16 Search is case-sensitive kIsNotDiacriticalSensitive 32 Search is not diacritical-sensitive SPECIAL CONSIDERATIONS
InitializeDictionary
may 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 error codes,InitializeDictionary
may return any of the following result codes.
noEr r
0 No error btNoS pace
-413 Insufficient disk space to store dictionary information keyLe nErr
-416 Maximum key length too great or equal to zero keyAtt rErr
-417 No such key attribute SEE ALSO
Constants for all defined script codes are listed in the chapter "Script Manager" in
this book.File system specification records 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.