19 #ifndef __DICTIONARY__
20 #define __DICTIONARY__
30 #ifndef __AEREGISTRY__
34 #ifndef __CODEFRAGMENTS__
55 #if PRAGMA_STRUCT_ALIGN
56 #pragma options align = power
57 #elif PRAGMA_STRUCT_PACKPUSH
59 #elif PRAGMA_STRUCT_PACK
73 kDictionaryFileType = FOUR_CHAR_CODE(
'dict'),
74 kDCMDictionaryHeaderSignature = FOUR_CHAR_CODE(
'dict'),
75 kDCMDictionaryHeaderVersion = 2
80 kDCMAnyFieldTag = typeWildCard,
81 kDCMAnyFieldType = typeWildCard
89 keyDCMFieldTag = FOUR_CHAR_CODE(
'ftag'),
90 keyDCMFieldType = FOUR_CHAR_CODE(
'ftyp'),
91 keyDCMMaxRecordSize = FOUR_CHAR_CODE(
'mrsz'),
92 keyDCMFieldAttributes = FOUR_CHAR_CODE(
'fatr'),
93 keyDCMFieldDefaultData = FOUR_CHAR_CODE(
'fdef'),
94 keyDCMFieldName = FOUR_CHAR_CODE(
'fnam'),
95 keyDCMFieldFindMethods =
96 FOUR_CHAR_CODE(
'ffnd')
104 typeDCMFieldAttributes = FOUR_CHAR_CODE(
'fatr'),
105 typeDCMFindMethod = FOUR_CHAR_CODE(
'fmth')
113 kDCMIndexedFieldMask = 0x00000001,
114 kDCMRequiredFieldMask = 0x00000002,
115 kDCMIdentifyFieldMask = 0x00000004,
116 kDCMFixedSizeFieldMask = 0x00000008,
117 kDCMHiddenFieldMask = (long)0x80000000
120 typedef OptionBits DCMFieldAttributes;
126 pDCMAccessMethod = FOUR_CHAR_CODE(
'amtd'),
127 pDCMPermission = FOUR_CHAR_CODE(
'perm'),
128 pDCMListing = FOUR_CHAR_CODE(
'list'),
129 pDCMMaintenance = FOUR_CHAR_CODE(
'mtnc'),
130 pDCMLocale = FOUR_CHAR_CODE(
'locl'),
133 pDCMCopyright = FOUR_CHAR_CODE(
'info')
141 kDCMReadOnlyDictionary = 0,
142 kDCMReadWriteDictionary = 1
150 kDCMAllowListing = 0,
151 kDCMProhibitListing = 1
159 kDCMUserDictionaryClass = 0,
160 kDCMSpecificDictionaryClass = 1,
161 kDCMBasicDictionaryClass = 2
173 kDCMFindMethodForwardTrie =
174 FOUR_CHAR_CODE(
'ftri'),
175 kDCMFindMethodBackwardTrie =
176 FOUR_CHAR_CODE(
'btri')
179 typedef OSType DCMFindMethod;
185 kDCMCanUseFileDictionaryMask = 0x00000001,
186 kDCMCanUseMemoryDictionaryMask = 0x00000002,
187 kDCMCanStreamDictionaryMask = 0x00000004,
188 kDCMCanHaveMultipleIndexMask = 0x00000008,
189 kDCMCanModifyDictionaryMask = 0x00000010,
190 kDCMCanCreateDictionaryMask = 0x00000020,
191 kDCMCanAddDictionaryFieldMask = 0x00000040,
192 kDCMCanUseTransactionMask = 0x00000080
195 typedef OptionBits DCMAccessMethodFeature;
196 typedef UInt32 DCMUniqueID;
197 typedef struct OpaqueDCMObjectID *DCMObjectID;
198 typedef DCMObjectID DCMAccessMethodID;
199 typedef DCMObjectID DCMDictionaryID;
200 #define kDCMInvalidObjectID ((DCMObjectID)kInvalidID)
201 typedef struct OpaqueDCMObjectRef *DCMObjectRef;
202 typedef DCMObjectRef DCMDictionaryRef;
203 typedef DCMObjectRef DCMDictionaryStreamRef;
204 #define kDCMInvalidObjectRef ((DCMObjectRef)kInvalidID)
205 typedef struct OpaqueDCMObjectIterator *DCMObjectIterator;
206 typedef DCMObjectIterator DCMAccessMethodIterator;
207 typedef DCMObjectIterator DCMDictionaryIterator;
208 typedef struct OpaqueDCMFoundRecordIterator *DCMFoundRecordIterator;
219 FourCharCode headerSignature;
220 UInt32 headerVersion;
221 ByteCount headerSize;
229 DCMProgressFilterProcPtr)(
Boolean determinateProcess,
230 UInt16 percentageComplete,
232 typedef STACK_UPP_TYPE(DCMProgressFilterProcPtr) DCMProgressFilterUPP;
233 #if CALL_NOT_IN_CARBON
244 #if !OPAQUE_UPP_TYPES
247 uppDCMProgressFilterProcInfo = 0x00000E50
250 inline DCMProgressFilterUPP
254 (ProcPtr)(userRoutine), uppDCMProgressFilterProcInfo,
255 GetCurrentArchitecture());
258 #define NewDCMProgressFilterUPP(userRoutine) \
259 (DCMProgressFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
260 uppDCMProgressFilterProcInfo, \
261 GetCurrentArchitecture())
275 #if !OPAQUE_UPP_TYPES
282 #define DisposeDCMProgressFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
296 UInt16 percentageComplete, UInt32 callbackUD,
297 DCMProgressFilterUPP userUPP);
298 #if !OPAQUE_UPP_TYPES
301 UInt16 percentageComplete,
303 DCMProgressFilterUPP userUPP)
305 return (
Boolean)CALL_THREE_PARAMETER_UPP(
306 userUPP, uppDCMProgressFilterProcInfo, determinateProcess,
307 percentageComplete, callbackUD);
310 #define InvokeDCMProgressFilterUPP(determinateProcess, percentageComplete, \
311 callbackUD, userUPP) \
312 (Boolean) CALL_THREE_PARAMETER_UPP((userUPP), uppDCMProgressFilterProcInfo, \
313 (determinateProcess), \
314 (percentageComplete), (callbackUD))
320 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
322 #define NewDCMProgressFilterProc(userRoutine) \
323 NewDCMProgressFilterUPP(userRoutine)
324 #define CallDCMProgressFilterProc(userRoutine, determinateProcess, \
325 percentageComplete, callbackUD) \
326 InvokeDCMProgressFilterUPP(determinateProcess, percentageComplete, \
327 callbackUD, userRoutine)
357 const FSSpec *newDictionaryFile, ScriptCode scriptTag,
359 ItemCount recordCapacity, DCMDictionaryID *newDictionary);
371 const FSSpec *newDictionaryFile, ScriptCode scriptTag,
372 Boolean invisible, ItemCount recordCapacity,
373 DCMDictionaryID *newDictionary);
399 DCMDictionaryID *dictionaryID);
425 ConstLogicalAddress protectKey,
426 DCMDictionaryRef *dictionaryRef);
452 Duration timeOutDuration);
479 ByteCount keySize, ConstLogicalAddress keyData,
480 DCMFindMethod findMethod, ItemCount preFetchedDataNum,
482 ItemCount maxRecordCount,
483 DCMFoundRecordIterator *recordIterator);
506 ByteCount maxKeySize, ByteCount *actualKeySize,
507 LogicalAddress keyData, DCMUniqueID *uniqueID,
546 ConstLogicalAddress keyData, DCMUniqueID uniqueID,
547 ItemCount *sequenceNum);
559 ItemCount
serialNum, ByteCount maxKeySize, ByteCount *keySize,
560 LogicalAddress keyData, DCMUniqueID *uniqueID);
572 ByteCount keySize, ConstLogicalAddress keyData,
573 DCMUniqueID uniqueID, ByteCount maxKeySize,
574 ByteCount *nextKeySize, LogicalAddress nextKeyData,
575 DCMUniqueID *nextUniqueID);
587 ByteCount keySize, ConstLogicalAddress keyData,
588 DCMUniqueID uniqueID, ByteCount maxKeySize,
589 ByteCount *prevKeySize, LogicalAddress prevKeyData,
590 DCMUniqueID *prevUniqueID);
605 ByteCount keySize, ConstLogicalAddress keyData,
606 DCMUniqueID uniqueID, ItemCount numOfData,
619 ByteCount keySize, ConstLogicalAddress keyData,
620 DCMUniqueID uniqueID,
const AEDesc *dataList);
635 ByteCount keySize, ConstLogicalAddress keyData,
Boolean checkOnly,
636 const AEDesc *dataList, DCMUniqueID *newUniqueID);
648 ByteCount keySize, ConstLogicalAddress keyData,
649 DCMUniqueID uniqueID);
664 DCMProgressFilterUPP progressProc, UInt32 userData);
676 DCMProgressFilterUPP progressProc, UInt32 userData);
702 DCMDictionaryID *dictionaryID);
743 ByteCount maxPropertySize, ByteCount *actualSize,
744 LogicalAddress propertyValue);
756 ByteCount propertySize,
757 ConstLogicalAddress propertyValue);
769 ItemCount maxPropertyNum, ItemCount *numProperties,
860 DCMAccessMethodID *accessMethodID);
875 ByteCount maxRecordSize,
876 DCMFieldAttributes fieldAttributes,
878 ItemCount numberOfFindMethods,
879 DCMFindMethod findMethods[],
AEDesc *fieldInfoRecord);
891 DCMFieldType *fieldType);
903 ByteCount *maxRecordSize);
915 DCMFieldAttributes *attributes);
927 AEDesc *fieldDefaultData);
939 ItemCount findMethodsArrayMaxSize,
940 DCMFindMethod findMethods[],
941 ItemCount *actualNumberOfFindMethods);
946 #if TARGET_RT_MAC_CFM
948 inline pascal
Boolean DCMDictionaryManagerAvailable()
953 #define DCMDictionaryManagerAvailable() ((DCMLibraryVersion != (void*)kUnresolvedCFragSymbolAddress)
955 #elif TARGET_RT_MAC_MACHO
958 inline pascal
Boolean DCMDictionaryManagerAvailable() {
return true; }
960 #define DCMDictionaryManagerAvailable() (true)
972 #define kAppleJapaneseDefaultAccessMethodName \
973 "\pDAM:Apple Backward Trie Access Method"
979 kMaxYomiLengthInAppleJapaneseDictionary = 40,
980 kMaxKanjiLengthInAppleJapaneseDictionary = 64
988 kDCMJapaneseYomiTag = FOUR_CHAR_CODE(
'yomi'),
989 kDCMJapaneseHyokiTag = FOUR_CHAR_CODE(
'hyok'),
990 kDCMJapaneseHinshiTag = FOUR_CHAR_CODE(
'hins'),
991 kDCMJapaneseWeightTag = FOUR_CHAR_CODE(
'hind'),
992 kDCMJapanesePhoneticTag = FOUR_CHAR_CODE(
'hton'),
993 kDCMJapaneseAccentTag = FOUR_CHAR_CODE(
'acnt'),
994 kDCMJapaneseOnKunReadingTag = FOUR_CHAR_CODE(
'OnKn'),
995 kDCMJapaneseFukugouInfoTag = FOUR_CHAR_CODE(
'fuku')
1002 kDCMJapaneseHinshiType = FOUR_CHAR_CODE(
'hins'),
1003 kDCMJapaneseWeightType = typeShortInteger,
1005 kDCMJapaneseAccentType = FOUR_CHAR_CODE(
'byte'),
1007 kDCMJapaneseFukugouInfoType = FOUR_CHAR_CODE(
'fuku')
1016 #if PRAGMA_STRUCT_ALIGN
1017 #pragma options align = reset
1018 #pragma options align = mac68k
1028 kInsertOrReplace = 2
1035 typedef short DictionaryDataInsertMode;
1039 kIsCaseSensitive = 0x10,
1040 kIsNotDiacriticalSensitive = 0x20
1053 typedef SInt8 DictionaryEntryAttribute;
1057 FSSpec dictionaryFSSpec;
1058 SInt32 numberOfRecords;
1059 SInt32 currentGarbageSize;
1061 SInt16 maximumKeyLength;
1062 SInt8 keyAttributes;
1068 DictionaryEntryAttribute datTable[1];
1072 #if CALL_NOT_IN_CARBON
1083 SInt8 keyAttributes, ScriptCode script);
1095 SInt32 *dictionaryReference);
1118 Handle recordDataHandle,
1119 DictionaryDataInsertMode whichMode);
1142 SInt32 dictionaryReference, ConstStr255Param key,
1144 Handle recordDataHandle);
1156 SInt32 dictionaryReference, SInt32 recordIndex,
1158 Str255 recordKey, Handle recordDataHandle);
1185 #if PRAGMA_STRUCT_ALIGN
1186 #pragma options align = reset
1187 #elif PRAGMA_STRUCT_PACKPUSH
1189 #elif PRAGMA_STRUCT_PACK
1193 #ifdef PRAGMA_IMPORT_OFF
1196 #pragma import reset
ResType DescType
Definition: AEDataModel.h:165
AppleEvents Registry Interface.
@ kAEBeginsWith
Definition: AERegistry.h:150
@ kAEContains
Definition: AERegistry.h:159
@ typeUnicodeText
Definition: AERegistry.h:765
@ kAEEndsWith
Definition: AERegistry.h:177
@ kAEEquals
Definition: AERegistry.h:179
@ pClass
Definition: AERegistry.h:450
Public Code Fragment Manager Interfaces.
OSStatus DCMGetDictionaryPropertyList(DCMDictionaryID dictionaryID, ItemCount maxPropertyNum, ItemCount *numProperties, DCMFieldTag propertyTag[])
OSStatus DCMCompactDictionary(DCMDictionaryID dictionaryID, DCMProgressFilterUPP progressProc, UInt32 userData)
OSStatus DCMGetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount numOfData, const DCMFieldTag dataTag[], AEDesc *dataList)
OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
DescType DCMFieldTag
Definition: Dictionary.h:212
OSStatus DCMSetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, const AEDesc *dataList)
OSStatus DCMResetObjectIterator(DCMObjectIterator iterator)
OSStatus DCMGetDictionaryFieldInfo(DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, AEDesc *fieldInfoRecord)
OSStatus DCMRegisterDictionaryFile(const FSSpec *dictionaryFile, DCMDictionaryID *dictionaryID)
OSStatus DCMGetFieldFindMethods(const AEDesc *fieldInfoRecord, ItemCount findMethodsArrayMaxSize, DCMFindMethod findMethods[], ItemCount *actualNumberOfFindMethods)
OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
OSStatus DCMCloseDictionary(DCMDictionaryRef dictionaryRef)
ItemCount DCMCountRecordIterator(DCMFoundRecordIterator recordIterator)
OSStatus DCMFindRecords(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMFindMethod findMethod, ItemCount preFetchedDataNum, DCMFieldTag preFetchedData[], ItemCount skipCount, ItemCount maxRecordCount, DCMFoundRecordIterator *recordIterator)
OSStatus DCMSetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue)
OSStatus DCMNewDictionary(DCMAccessMethodID accessMethodID, const FSSpec *newDictionaryFile, ScriptCode scriptTag, const AEDesc *listOfFieldInfoRecords, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary)
OSStatus DCMGetAccessMethodIDFromName(ConstStr63Param accessMethodName, DCMAccessMethodID *accessMethodID)
void DisposeDCMProgressFilterUPP(DCMProgressFilterUPP userUPP)
OSStatus DCMGetPrevRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *prevKeySize, LogicalAddress prevKeyData, DCMUniqueID *prevUniqueID)
OSStatus DCMOpenDictionary(DCMDictionaryID dictionaryID, ByteCount protectKeySize, ConstLogicalAddress protectKey, DCMDictionaryRef *dictionaryRef)
OSStatus DCMGetRecordSequenceNumber(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount *sequenceNum)
OSErr CloseDictionary(SInt32 dictionaryReference)
OSStatus DCMGetFieldDefaultData(const AEDesc *fieldInfoRecord, DescType desiredType, AEDesc *fieldDefaultData)
OSStatus DCMUnregisterDictionary(DCMDictionaryID dictionaryID)
OSStatus DCMDeleteDictionary(DCMDictionaryID dictionaryID)
OSStatus DCMGetFieldAttributes(const AEDesc *fieldInfoRecord, DCMFieldAttributes *attributes)
OSStatus DCMCountRecord(DCMDictionaryID dictionaryID, ItemCount *count)
OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
OSStatus DCMReorganizeDictionary(DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressFilterUPP progressProc, UInt32 userData)
OSStatus DCMGetNthRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ItemCount serialNum, ByteCount maxKeySize, ByteCount *keySize, LogicalAddress keyData, DCMUniqueID *uniqueID)
OSStatus DCMIterateObject(DCMObjectIterator iterator, DCMObjectID *objectID)
OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
OSStatus DCMGetFileFromDictionaryID(DCMDictionaryID dictionaryID, FSSpec *fileRef)
ItemCount DCMCountObjectIterator(DCMObjectIterator iterator)
OSStatus DCMCreateDictionaryIterator(DCMDictionaryIterator *dictionaryIterator)
DCMProgressFilterUPP NewDCMProgressFilterUPP(DCMProgressFilterProcPtr userRoutine)
OSStatus DCMDeriveNewDictionary(DCMDictionaryID srcDictionary, const FSSpec *newDictionaryFile, ScriptCode scriptTag, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary)
Boolean InvokeDCMProgressFilterUPP(Boolean determinateProcess, UInt16 percentageComplete, UInt32 callbackUD, DCMProgressFilterUPP userUPP)
OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
OSStatus DCMGetDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Duration timeOutDuration)
typedef CALLBACK_API(Boolean, DCMProgressFilterProcPtr)(Boolean determinateProcess
OSStatus DCMDeleteRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID)
OSStatus DCMGetDictionaryIDFromFile(const FSSpec *fileRef, DCMDictionaryID *dictionaryID)
OSStatus DCMGetNextRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *nextKeySize, LogicalAddress nextKeyData, DCMUniqueID *nextUniqueID)
OSStatus DCMGetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount maxPropertySize, ByteCount *actualSize, LogicalAddress propertyValue)
OSStatus DCMDisposeObjectIterator(DCMObjectIterator iterator)
OSErr CompactDictionary(SInt32 dictionaryReference)
OSStatus DCMCreateFieldInfoRecord(DescType fieldTag, DescType fieldType, ByteCount maxRecordSize, DCMFieldAttributes fieldAttributes, AEDesc *fieldDefaultData, ItemCount numberOfFindMethods, DCMFindMethod findMethods[], AEDesc *fieldInfoRecord)
OSStatus DCMGetFieldTagAndType(const AEDesc *fieldInfoRecord, DCMFieldTag *fieldTag, DCMFieldType *fieldType)
DCMDictionaryID DCMGetDictionaryIDFromRef(DCMDictionaryRef dictionaryRef)
OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
UInt32 DCMLibraryVersion(void)
OSStatus DCMIterateFoundRecord(DCMFoundRecordIterator recordIterator, ByteCount maxKeySize, ByteCount *actualKeySize, LogicalAddress keyData, DCMUniqueID *uniqueID, AEDesc *dataList)
OSStatus DCMAddRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, Boolean checkOnly, const AEDesc *dataList, DCMUniqueID *newUniqueID)
OSStatus DCMReleaseDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Boolean commitTransaction)
OSStatus DCMGetFieldMaxRecordSize(const AEDesc *fieldInfoRecord, ByteCount *maxRecordSize)
OSStatus DCMCreateAccessMethodIterator(DCMAccessMethodIterator *accessMethodIterator)
OSStatus DCMDisposeRecordIterator(DCMFoundRecordIterator recordIterator)
File Manager (MFS, HFS, and HFS+) Interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
@ serialNum
Definition: ROMDefs.h:264
Definition: AEDataModel.h:175
Definition: Dictionary.h:1066