Important: The Dictionary Manager is deprecated as of Mac OS X v10.5 and is not available to 64-bit applications. Instead, use the APIs presented by Dictionary Services, which are described in Dictionary Services Programming Guide and Dictionary Services Reference.
A function identified as deprecated has been superseded and may become unsupported in the future.
Add a new record to a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMAddRecord ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, Boolean checkOnly, const AEDesc *dataList, DCMUniqueID *newUniqueID );
A reference to the dictionary to which you want to add a record. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the record you want to add.
The size of the keyData
parameter.
The key data of the record you want to add. You are responsible for allocating this buffer.
If true is specified, only a duplication check of records is carried out, and actual addition of records is not carried out.
A pointer to the data contained in the record you want to add. The AEDesc
data structure contains two fields: A four-character code that specifies the type of data in the structure and an opaque storage type that points to the storage for the descriptor data. Each of the data structures in the dataList
array specifies a field name (the four-character code) in the dictionary record and the data associated with that field. You must first call the function DCMCreateFieldInfoRecord
to create this array of data structures. When you create the data list, you must include all of the fields specified by the masks kDCMIndexedFieldMask
, kDCMRequiredFieldMask
, and kDCMIdentifyFieldMask
as attributes of the field properties of the applicable dictionary.
On output, the unique ID of the added record. If the added record is a duplicate record, the function returns the result dcmDupRecordErr
and the unique ID of the existing record is returned in the newUniqueID
parameter.
A result code. See “Dictionary Manager Result Codes.”
When checkOnly
is specified as true
, if duplicate records do not exist, noErr
is returned, and the newUniqueID
value is undefined. When checkOnly
is specified as false
, if the same record exists, only the field data within that record is overwritten, and the unique ID of that record is returned as newUniqueID
, and dcmDupRecordErr
is returned as the return value. If the same record does not exist, the record is added, and the uniqueID of the added record is returned as newUniqueID
, and noErr
is returned as the return value.
Dictionary.h
Closes a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCloseDictionary ( DCMDictionaryRef dictionaryRef );
A reference to the dictionary you want to close. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Compacts a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCompactDictionary ( DCMDictionaryID dictionaryID, DCMProgressFilterUPP progressProc, UInt32 userData );
The ID of the dictionary you want to compact. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
A universal procedure pointer (UPP) to your progress callback function. This callback is not supported.
Data needed by your progress callback function.
A result code. See “Dictionary Manager Result Codes.”
The function DCMCompactDictionary
organizes the contents of a dictionary to reduce the size of the dictionary as much as possible. You cannot add additional records to a dictionary after you have compacted it unless you call the function DCMReorganizeDictionary
to expand the capacity of the dictionary.
Dictionary.h
Obtains the number of dictionaries in a list. (Deprecated in Mac OS X v10.5.)
ItemCount DCMCountObjectIterator ( DCMObjectIterator iterator );
The list of available dictionaries. You obtain this list by calling the function DCMCreateDictionaryIterator
or DCMCreateAccessMethodIterator
.
The number of dictionaries contained in the list specified by the iterator
parameter.
Dictionary.h
Return number of records in a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCountRecord ( DCMDictionaryID dictionaryID, ItemCount *count );
The ID of dictionary whose records you want to count. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
On output, the number of records in the dictionary.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Returns the number of records contained in a list of search results. (Deprecated in Mac OS X v10.5.)
ItemCount DCMCountRecordIterator ( DCMFoundRecordIterator recordIterator );
A reference to list of search results. You obtain a list of search results by calling the function DCMFindRecords
.
The number of records in the list specified by the recordIterator
parameter.
Dictionary.h
Obtains a list of the available access methods. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCreateAccessMethodIterator ( DCMAccessMethodIterator *accessMethodIterator );
On output, a list of access methods.
A result code. See “Dictionary Manager Result Codes.”
You can operate on the list of access methods created by the function DCMCreateAccessMethodIterator
by calling the functions DCMCountObjectIterator
, DCMIterateObject
, DCMResetObjectIterator
, and DCMDisposeObjectIterator
. You use this function along with the function DCMGetAccessMethodIDFromName
to obtain the accessMethodID
that you supply to the function DCMNewDictionary
to create a new dictionary.
Normally you should not need to call this function because the Dictionary Manager handles the mapping of a dictionary to its access method.
Dictionary.h
Obtains a list of the dictionaries available on the system. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCreateDictionaryIterator ( DCMDictionaryIterator *dictionaryIterator );
On output, a reference to the list of available dictionaries. You are responsible for disposing of this list when you no longer need it.
A result code. See “Dictionary Manager Result Codes.”
The function DCMCreateDictionaryIterator
scans the dictionary directories, registers the dictionaries found, and returns a list of dictionaries. In Mac OS X, the Dictionary Manager searches (User's home)/Library/Dictionaries/
, /Library/Dictionaries/
, and their subdirectories. In Mac OS 9, it searches the Extensions folder, Preferences folder, and their subfolders.
Dictionary.h
Creates a field information record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMCreateFieldInfoRecord ( DescType fieldTag, DescType fieldType, ByteCount maxRecordSize, DCMFieldAttributes fieldAttributes, AEDesc *fieldDefaultData, ItemCount numberOfFindMethods, DCMFindMethod findMethods[], AEDesc *fieldInfoRecord );
The tag for the field you want to create.
The data type of the field.
The maximum size of the data in the field.
The attributes associated with the field. See “Field Attributes” for more information.
On input, points to the default data for the field.
The number of search methods associated with the field.
On input, an array of search methods associated with the field. See “Search Methods” for more information.
On output, points to the field information record for the newly-created field.
A result code. See “Dictionary Manager Result Codes.”
You can add multiple fields in the form of an AEDescList
data structure by repeatedly calling the function DCMCreateFieldInfoRecord
. You use the field information record (fieldInfoRecord
) when you call the function DCMNewDictionary
. However, when calling the function for the first time, you must set the descriptorType
of the fieldInfoRecord
to typeNull
.
Dictionary.h
Deletes a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMDeleteDictionary ( DCMDictionaryID dictionaryID );
The ID of dictionary you want to delete. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
A result code. See “Dictionary Manager Result Codes.” Returns the result dcmDictionaryBusyErr
if another application has this dictionary open.
The function DCMDeleteDictionary
deletes the dictionary specified by the dictionaryID
parameter.
Dictionary.h
Delete specified record from the dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMDeleteRecord ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID );
A reference to the dictionary from which you want to delete a record. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the record you want to delete.
The size of the keyData
parameter.
The key data of the record you want to delete. You are responsible for allocating this buffer.
The unique ID of the record you want to delete.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Create a new dictionary based on an existing dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMDeriveNewDictionary ( DCMDictionaryID srcDictionary, const FSSpec *newDictionaryFile, ScriptCode scriptTag, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary );
The ID of dictionary from which you want to derive a dictionary. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
A pointer to an FSSpec
structure that specifies the file name and location for the newly-created dictionary. This is an input parameter.
The script code of the file specified by the newDictionaryFile
parameter.
A Boolean value that specifies whether the dictionary is available through the Dictionary Manager. Pass true
if you do not want the dictionary to be available, false
otherwise. If you set invisible to true
, that dictionary is no longer seen by such functions as DCMCreateDictionaryIterator
, so it becomes a dictionary that cannot be accessed from any application other than the application that created the dictionary.
The number of records that can be stored in the dictionary. You can supply an approximate value if you do not know the exact number.
On output, points to the ID of the newly-created dictionary.
A result code. See “Dictionary Manager Result Codes.”
The function DCMDeriveNewDictionary
creates an new dictionary file based on an existing dictionary specified in the srcDictionary
parameter, with the same field configuration and properties, but does not contain the data from the source. The new dictionary is created with the name and at the location specified by the newDictionaryFile
parameter. The newly-created dictionary is read-write enabled even if the source dictionary is read-only.
Dictionary.h
Disposes of a iterator. (Deprecated in Mac OS X v10.5.)
OSStatus DCMDisposeObjectIterator ( DCMObjectIterator iterator );
The list of available dictionaries that you want to dispose of.You obtain this list by calling the function DCMCreateDictionaryIterator
or DCMCreateAccessMethodIterator
.
A result code. See “Dictionary Manager Result Codes.”
You must dispose of a dictionary iterator when you no longer need it by calling the function DCMDisposeObjectIterator
.
Dictionary.h
Disposes of a list of search results. (Deprecated in Mac OS X v10.5.)
OSStatus DCMDisposeRecordIterator ( DCMFoundRecordIterator recordIterator );
A reference to the list of search results you want to dispose of. You obtain a list of search results by calling the function DCMFindRecords
.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains a list of dictionary records that meet specified criteria. (Deprecated in Mac OS X v10.5.)
OSStatus DCMFindRecords ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMFindMethod findMethod, ItemCount preFetchedDataNum, DCMFieldTag preFetchedData[], ItemCount skipCount, ItemCount maxRecordCount, DCMFoundRecordIterator *recordIterator );
A reference to the dictionary you want to search. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
A tag that specifies the field to search through. See “Field Data Tags” for a list of the fields you can specify for an Apple Japanese dictionary.
The length of the keyword specified by the keyData
parameter.
The string for which you want to search.
The search method to use. See “Search Methods” for a description of the methods you can supply.
The number of items in the preFetchedData
array.
An array of the tags obtained during the search. See “Field Data Tags” for a list of the field tags that can be obtained for an Apple Japanese dictionary.
The number of records you want to skip during the search. You can use this value along with the maxRecordCount
parameter to search through a dictionary in chunks. For example, if you want to obtain 10 matches at a time, the first time you search you should set the skipCount
parameter to 0 and the maxRecordCount
to 10. The second time you search you set skipCount
to 10 and maxRecordCount
to10. Each subsequent time you search, you increment skipCount
by 10, keeping maxRecordCount
set to10.
The maximum number of results to return. Pass 0 if you want all matching records returned. If the number of matching records is smaller than the maximum number of results to return, the search is terminated and the matching records returned in the recordIterator
parameter. See the description of the skipCount
parameter for information on how to use maxRecordCount
to search through a dictionary in chunks.
On return, a reference to list of search results.
A result code. See “Dictionary Manager Result Codes.”If a match is not found, the function returns dcmNoRecordErr
, and the recordIterator
value is undefined.
The function DCMFindRecords
uses the specified key and search method to return a list of matching records. Search results are returned as a reference to a list of matching records. After you obtain this list, you can call the function DCMGetFieldData
to retrieve each result in the list.
You can use the preFetchedData
parameter to obtain a list of tags during the search. Data specified as pre-fetched are actually retrieved at the same time as the search key is retrieved, so you can specify data tags the need to be accessed fast and immediately after searching. In other words, you can avoid accessing and loading data that are not going to be used immediately by omitting those tags from the preFetchedData
list. (You can retrieve those data later by calling the function DCMGetFieldData
.) For example: An application that searches pictures by date, displays the found titles in the list, and shows the picture only if the title is double-clicked, the key is "date", the pre-fetched data is "title", and the "picture" is retrieved later if needed by calling the function DCMGetFieldData
.
You pass the record iterator (recordIterator
) as a parameter to the function DCM DCMCountRecordIterator
to obtain the number of items in the list. You can obtain the individual items in the list by passing the record iterator to the function DCMIterateFoundRecord
. Your application is responsible for disposing of the record iterator when you no longer need it by calling the function DCMDisposeRecordIterator
.
Dictionary.h
Obtains the ID for access method. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetAccessMethodIDFromName ( ConstStr63Param accessMethodName, DCMAccessMethodID *accessMethodID );
The name of access method whose ID you want to obtain.
On output, the ID for the access method specified by the accessMethodName
parameter.
A result code. See “Dictionary Manager Result Codes.”
You can use this function to obtain the accessMethodID
that you supply to the function DCMNewDictionary
to create a new dictionary.
Normally you should not need to call this function because the Dictionary Manager handles the mapping of a dictionary to its access method.
Dictionary.h
Obtains field information for a specified field in a dictionary record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetDictionaryFieldInfo ( DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, AEDesc *fieldInfoRecord );
The ID of dictionary from which you want to obtain field information. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The tag of the field whose field information you want to obtain. If you pass '****'
(typeWildCard
) as the field tag, all of the field information contained in the specified dictionary is returned in the fieldInfoRecord
parameter.
On return, points to the field information for the specified field. You are responsible for disposing of this structure by calling the Apple Event Manager function AEDisposeDesc
.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the ID associated with a dictionary file. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetDictionaryIDFromFile ( const FSSpec *fileRef, DCMDictionaryID *dictionaryID );
The file specification for the dictionary whose ID you want to obtain.
On output, points to the ID for the dictionary specified by the fileRef
parameter.
A result code. See “Dictionary Manager Result Codes.” If the file is not a dictionary, the result dcmNotDictionaryErr
is returned. If the dictionary is not yet registered, the result dcmBadDictionaryErr
is returned.
Dictionary.h
Obtains the dictionary ID associated with a dictionary reference. (Deprecated in Mac OS X v10.5.)
DCMDictionaryID DCMGetDictionaryIDFromRef ( DCMDictionaryRef dictionaryRef );
A reference to the dictionary whose ID you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
On return, the ID of the dictionary specified by the dictionaryRef
parameter. If dictionaryRef
is invalid, the result kDCMInvalidObjectID
is returned. See page for a description of the DCMDictionaryID
data type.
Dictionary.h
Obtains the data associated with a property tag. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetDictionaryProperty ( DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount maxPropertySize, ByteCount *actualSize, LogicalAddress propertyValue );
The ID of dictionary whose property you want to obtain. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The property tag whose data you want to obtain.
The size of the data specified by the propertyValue
parameter.
On output, the actual size of the data specified by the propertyValue
parameter.
On output, points to the property data.
A result code. See “Dictionary Manager Result Codes.” Returns the result dcmBadPropertyErr
if the property tag does not exist.
If you don’t know the size of the property whose data you want to obtain, you need to call this function twice as follows:
The first time you call the function DCMGetProperty
, pass the dictionary ID, the property tag, 0
for the maxPropertySize
parameter and Null
for propertyValue
. Then allocate a propertyValue
buffer of the size returned by the actualSize
parameter.
The second time you call the function DCMGetProperty
, pass the dictionary ID, the property tag, the correct size for the maxPropertySize
parameter, and the propertyValue
buffer of the appropriate size.
Dictionary.h
Obtains a list of property tags from a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetDictionaryPropertyList ( DCMDictionaryID dictionaryID, ItemCount maxPropertyNum, ItemCount *numProperties, DCMFieldTag propertyTag[] );
The ID of dictionary whose list of property tags you want to obtain. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The maximum number of property tags in the list.
On output, the number of properties actually contained in the dictionary.
On output, an array of the property tags contained in the dictionary. You are responsible for allocating an array of the appropriate size.
A result code. See “Dictionary Manager Result Codes.”
The function DCMGetDictionaryPropertyList
returns a list of property tags in the specified dictionary. You need to call this function twice. The first time you call the function to get the number of properties. Then you must allocate a propertyTag
array of the appropriate size. You call the function a second time to get the actual list of tags.
Dictionary.h
Obtains write access for an open dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetDictionaryWriteAccess ( DCMDictionaryRef dictionaryRef, Duration timeOutDuration );
A reference to the dictionary for which you want to obtain write access. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The maximum amount of time to wait for write access. This parameter is currently not used.
A result code. See “Dictionary Manager Result Codes.” Returns the result dcmPermissionErr
if the dictionary is read-only dictionary or if another application has write access.
When you call the function DCMOpenDictionary
, the dictionary opens with read-only access. You must call the function DCMGetDictionaryWriteAccess
to obtain write privileges. You can obtain write access only if a dictionary is already opened and no other application has write access to that dictionary. You should release write privileges as soon as you no longer need write access, by calling the function DCMReleaseDictionaryWriteAccess
.
Dictionary.h
Obtains the field attributes for a field information record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldAttributes ( const AEDesc *fieldInfoRecord, DCMFieldAttributes *attributes );
On input, points to the field information record whose attributes you want to obtain.
On output, points to the attributes obtained from the field information record. See “Field Attributes”for more information.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains data from one or more fields in a specified record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldData ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount numOfData, const DCMFieldTag dataTag[], AEDesc *dataList );
A reference to the dictionary that contains the field data you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
A field tag that specifies the data you want to obtain.
The size of the keyData
parameter.
The key data of the record you whose field you want to obtain. You are responsible for allocating this buffer.
The unique ID of the record whose field you want to obtain.
The number of data fields tags in the dataTag
array.
A list of the data field to obtain.
On return, points to a list of obtained data. The data obtained is returned in t as an AERecord
data structure. You can retrieve data from specific field using the Apple Event Manager function AEGetKeyPtr
. You are responsible for disposing of the dataList
array by calling the Apple Event Manager function AEDisposeDesc
.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains default data for a field information record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldDefaultData ( const AEDesc *fieldInfoRecord, DescType desiredType, AEDesc *fieldDefaultData );
On input, points to the field information record whose default data you want to obtain.
The data type of the default data.
On output, points to the default data obtained from the field information record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the search methods for a field information record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldFindMethods ( const AEDesc *fieldInfoRecord, ItemCount findMethodsArrayMaxSize, DCMFindMethod findMethods[], ItemCount *actualNumberOfFindMethods );
On input, points to the field information record whose search methods you want to obtain.
The number of elements in the findMethods
array.
On output, an array of search methods obtained from the field information record. See “Search Methods” for more information.
On output, the actual number of search methods obtained from the field information array.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the maximum data size for a field in a dictionary record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldMaxRecordSize ( const AEDesc *fieldInfoRecord, ByteCount *maxRecordSize );
On input, points to the field information record whose maximum data size you want to obtain.
On output, points to the maximum data size obtained from the field information record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the field tag and type associated with a field information record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFieldTagAndType ( const AEDesc *fieldInfoRecord, DCMFieldTag *fieldTag, DCMFieldType *fieldType );
On input, points to the field information record whose field tag and type you want to obtain.
On output, points to the field tag obtained from the field information record.
On output, points to the field tag type obtained from the field information record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the file specification associated with a dictionary ID. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetFileFromDictionaryID ( DCMDictionaryID dictionaryID, FSSpec *fileRef );
The ID of the dictionary whose file specification you want to obtain. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
On output, points to the file specification for the dictionary specified by the dictionaryID
parameter.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the next specified record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetNextRecord ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *nextKeySize, LogicalAddress nextKeyData, DCMUniqueID *nextUniqueID );
A reference to the dictionary whose record you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the data you want to obtain.
The size of the keyData
parameter. If you pass 0
, the first record in the dictionary is returned.
The key data of the reference record.
The unique ID of the reference record.
The size of the buffer for the nextKeyData
parameter.
On output, the actual size of the buffer for the nextKeyData
parameter.
On output, points to the next key of the specified record. You must allocate this buffer.
On output, the unique ID of the found record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Return records in a specified order within the dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetNthRecord ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ItemCount serialNum, ByteCount maxKeySize, ByteCount *keySize, LogicalAddress keyData, DCMUniqueID *uniqueID );
A reference to the dictionary whose record you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the data you want to obtain.
A value that specifies the location of the record within the dictionary. You can obtain this value by calling the function DCMGetRecordSequenceNumber
.
The maximum size of the keyData
parameter.
On output, the size of the keyData
parameter.
The key data of the record you want to obtain. You are responsible for allocating this buffer.
On output, the unique ID of the found record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the previous record. Return the record previous to the specified record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetPrevRecord ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *prevKeySize, LogicalAddress prevKeyData, DCMUniqueID *prevUniqueID );
A reference to the dictionary whose record you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the data you want to obtain.
The size of the keyData
parameter. If you pass 0
, the last record in the dictionary is returned.
The key data of the reference record.
The unique ID of the record reference record.
The size of the buffer for the prevKeyData
parameter.
On output, the actual size of the buffer for the prevKeyData
parameter.
On output, points to the previous key of the specified record. You must allocate this buffer.
On output, the unique ID of the found record.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Obtains the sequence number for the specified record in a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMGetRecordSequenceNumber ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount *sequenceNum );
A reference to the dictionary whose record sequence number you want to obtain. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
The field tag that specifies the data you want to obtain.
The size of the keyData
parameter.
The key data of the record whose sequence number you want to obtain.
The unique ID of the record whose sequence number you want to obtain.
On output, a value that specifies the order of the record in the dictionary. The first record in a dictionary has the value 1. Subsequent records are numbered sequentially.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Retrieves one record from a list of search results. (Deprecated in Mac OS X v10.5.)
OSStatus DCMIterateFoundRecord ( DCMFoundRecordIterator recordIterator, ByteCount maxKeySize, ByteCount *actualKeySize, LogicalAddress keyData, DCMUniqueID *uniqueID, AEDesc *dataList );
A reference to list of search results. You obtain a list of search results by calling the function DCMFindRecords
.
The size of the keyData
parameter.
On output, the actual size of the buffer needed for the data specified by the keyData
parameter.
On output, the key of the retrieved data.
On output, the unique ID of the retrieved record. This value is guaranteed to be unique among records with the same key data; but it is not unique among all records in the dictionary. You can use the unique ID in conjunction with the retrieved key data to specify individual records within the dictionary when you call the functions DCMGetNextRecord
, DCMGetPrevRecord
, DCMGetRecordSequenceNumber
, DCMDeleteRecord
, DCMGetFieldData
, and DCMSetFieldData
.
On output, the data associated with the key specified by the keyData
parameter.
A result code. See “Dictionary Manager Result Codes.” The function returns the result dcmIterationCompleteErr
when the final record is retrieved.
The function DCMIterateFoundRecord
retrieves one record from a list of search results referenced by a record iterator. You can retrieve all of the records referenced by a record iterator by repeatedly calling the DCMIterateFoundRecord
function.
The data associated with the fields specified in the preFetchedData
parameter is returned to dataList
in the form of an AERecord
. (See DCMFindRecords
for more information on pre-fetched data). It is possible to retrieve data by specifying the field tag and data type, and use the AEGetKeyPtr
and so forth of the Apple Event Manager. You application is responsible for disposing of dataList
by calling the Apple Event Manager function AEDisposeDesc
.
Only pre-fetched data can be retrieved here since these data are already retrieved. Other data can be retrieved later by calling the function DCMGetFieldData
.
Dictionary.h
Obtains the object ID for a dictionary from a list of available dictionaries. (Deprecated in Mac OS X v10.5.)
OSStatus DCMIterateObject ( DCMObjectIterator iterator, DCMObjectID *objectID );
The list of available dictionaries. You obtain this list by calling the function DCMCreateDictionaryIterator
or DCMCreateAccessMethodIterator
.
On output, the object ID of the dictionary.
A result code. See “Dictionary Manager Result Codes.”
The first time you call the function DCMIterateObject
it retrieves the object ID of the first dictionary in the list. The next time you call the function, it retrieves the object ID of the next dictionary in the list. You can obtain all object IDs by repeatedly calling this function. If you call the function after you obtain the object ID for the last dictionary, the function returns the result dcmIterationCompleteErr
.
You can reset the iterator to the first dictionary in the list by calling the function DCMResetObjectIterator
. When you no longer need the iterator, you must dispose of it by calling the function DCMDisposeObjectIterator
.
Dictionary.h
Obtains the version number of the Dictionary Manager. (Deprecated in Mac OS X v10.5.)
UInt32 DCMLibraryVersion ( void );
The library version number.
The function DCMLibraryVersion
returns the version of the installed Dictionary Manager in the same format as the 'vers'
resource. That is, the version number is returned in Binary-Coded Decimal (BCD) format in the high-order word, and the release stage information is returned in the low-order word. For example, the version 1.1.1 library returns 0x01118000.
Dictionary.h
Creates a new dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMNewDictionary ( DCMAccessMethodID accessMethodID, const FSSpec *newDictionaryFile, ScriptCode scriptTag, const AEDesc *listOfFieldInfoRecords, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary );
The ID of access method to use for the dictionary. You can obtain an access method ID by calling the function DCMGetAccessMethodIDFromName
.
On output, a pointer to an FSSpec
structure that specifies the dictionary file to be created.
The code of the script system in which the filename of the dictionary file is to be displayed.
A pointer to an array of AEDesc
data structures. The AEDesc
data structure contains two fields: A four-character code that specifies the type of data in the structure and an opaque storage type that points to the storage for the descriptor data. Each of the data structures in the listOfFieldInfoRecords
array specifies a field name (the four-character code) in the dictionary record and the data associated with that field. You must first call the function DCMCreateFieldInfoRecord
to create this array of data structures.
A Boolean value that specifies whether the dictionary is available through the Dictionary Manager. Pass true
if you do not want the dictionary to be available, false
otherwise. If you set invisible to true
, that dictionary is no longer seen by such functions as DCMCreateDictionaryIterator
, so it becomes a dictionary that cannot be accessed from any application other than the application that created the dictionary.
The number of records that can be stored in the dictionary. You can supply an approximate value if you do not know the exact number.
On output, points to the ID of the newly-created dictionary.
A result code. See “Dictionary Manager Result Codes.”
The function DCMNewDictionary
creates a new dictionary file and registers that dictionary with the Dictionary Manager. You need to specify the access method to use in creating the dictionary. The Dictionary Manager does not operate directly on a dictionary. Instead it accesses dictionaries using the access method specified for the dictionary. The access method mediates between the dictionary and the Dictionary Manager, so that the Dictionary Manager does not need to know anything about the physical format of the dictionary. As a result, the dictionary can have an free-form internal structure. You can also to use an existing dictionary as long as the dictionary has its own access method.
Dictionary.h
Opens a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMOpenDictionary ( DCMDictionaryID dictionaryID, ByteCount protectKeySize, ConstLogicalAddress protectKey, DCMDictionaryRef *dictionaryRef );
The ID of the dictionary you want to open. You obtain a dictionary ID when you register a dictionary by calling the function DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The size of the keyword specified by the protectKey
parameter. This parameter is optional. Pass 0
if you do not plan to provide a password.
The keyword to use when opening the dictionary. An access method can use the protectKey
parameter as a password to restrict access to the dictionary. This parameter is optional. Pass NULL
if you do not plan to provide a password.
On output, a reference to the opened dictionary.
A result code. See “Dictionary Manager Result Codes.”
The function DCMOpenDictionary
opens the dictionary specified by the dictionary ID and obtains a reference to the dictionary (dictionaryRef
). You can pass this reference as a parameter to other Dictionary Manager functions to access the records in the dictionary.
Dictionary.h
Registers a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMRegisterDictionaryFile ( const FSSpec *dictionaryFile, DCMDictionaryID *dictionaryID );
The file specification for the dictionary you want to register.
On output, points to the ID of the registered dictionary. A dictionary ID is not persistent across system restarts.
A result code. See “Dictionary Manager Result Codes.”
You should use this function only when the target dictionary is not in default location (seeDCMCreateDictionaryIterator
). Otherwise, dictionaries should be already registered and you can obtain the dictionaryID
by calling the function DCMGetDictionaryIDFromFile
or DCMCreateDictionaryIterator
.
You can only use registered dictionaries. You pass the dictionary ID obtained from the function DCMRegisterDictionaryFile
when you call other Dictionary Manager functions.
Dictionary.h
Releases write access to a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMReleaseDictionaryWriteAccess ( DCMDictionaryRef dictionaryRef, Boolean commitTransaction );
A reference to the dictionary for which you want to release write access. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
A Boolean value that specifies whether or not to write changed to the dictionary. Pass true
to write changes to the dictionary. Pass false
to cancel changes. The dictionary must support transaction processing for this parameter to have an effect. This parameter is currently not used.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Reorganizes a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMReorganizeDictionary ( DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressFilterUPP progressProc, UInt32 userData );
The ID of dictionary you want to reorganize. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The number of additional records you want to add. This number can be approximate.
A universal procedure pointer (UPP) to a progress callback function. This callback is not supported.
Data needed by your progress callback function.
A result code. See “Dictionary Manager Result Codes.”
The function DCMReorganizeDictionary
reorganizes the contents of the dictionary specified by the dictionaryID
parameter, expanding the dictionary to allow for the additional number of records specified by the extraCapacity
parameter.
Dictionary.h
Resets an iterator to the start of the dictionary list. (Deprecated in Mac OS X v10.5.)
OSStatus DCMResetObjectIterator ( DCMObjectIterator iterator );
The list of available dictionaries. You obtain this list by calling the function DCMCreateDictionaryIterator
or DCMCreateAccessMethodIterator
.
A result code. See “Dictionary Manager Result Codes.”
If you want to retrieve the object ID for a dictionary in the list, call the function DCMIterateObject
. When you no longer need the iterator, you must dispose of it by calling the function DCMDisposeObjectIterator
.
Dictionary.h
Sets a property for a dictionary. Set the properties to a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMSetDictionaryProperty ( DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue );
The ID of dictionary whose property you want to set. You obtain a dictionary ID when you call the functions DCMRegisterDictionaryFile
or DCMGetDictionaryIDFromFile
.
The property tag whose data you want to set.
The size of data pointed to by the propertyValue
parameter.
A pointer to the property data to be set.
A result code. See “Dictionary Manager Result Codes.” Returns the result dcmPermissionErr
if the property already exists and it is a read-only property.
If the specified properties already exists and it is a writable property, the property data is replaced. If the property does not exist, it is created.
Dictionary.h
Set the data to a specific field of a specified record. (Deprecated in Mac OS X v10.5.)
OSStatus DCMSetFieldData ( DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, const AEDesc *dataList );
A reference to the dictionary that contains the field data you want to set. You obtain a dictionary reference when you call the function DCMOpenDictionary
.
Tag of applicable key field.
The size of the keyData
parameter.
The key data of the record you whose field you want to set.
The unique ID of the record whose field you want to obtain.
A pointer to the list of data you want to set. The AEDesc
data structure contains two fields: A four-character code that specifies the type of data in the structure and an opaque storage type that points to the storage for the descriptor data. Each of the data structures in the dataList
array specifies a field name (the four-character code) in the dictionary record and the data associated with that field. You must first call the function DCMCreateFieldInfoRecord
to create this array of data structures.
A result code. See “Dictionary Manager Result Codes.”
Dictionary.h
Unregisters a dictionary. (Deprecated in Mac OS X v10.5.)
OSStatus DCMUnregisterDictionary ( DCMDictionaryID dictionaryID );
A result code. See “Dictionary Manager Result Codes.” Returns dcmDictionaryBusyErr
if the dictionary is in use by another client.
You should use this function only for dictionaries that you registered by calling the function DCMRegisterDictionaryFile
.
Dictionary.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-12-11)