4
Contains: Dictionary Manager Interfaces
6
Version: Technology: System 7
7
Release: Universal Interfaces 3.4.2
9
Copyright: � 1992-2002 by Apple Computer, Inc., all rights reserved.
11
Bugs?: For bug reports, consult the following page on
14
http://www.freepascal.org/bugs.html
20
Modified for use with Free Pascal
22
Please report any bugs to <gpc@microbizz.nl>
33
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
34
{$setc GAP_INTERFACES_VERSION := $0200}
36
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
37
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
40
{$ifc defined CPUPOWERPC and defined CPUI386}
41
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
43
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
44
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
47
{$ifc not defined __ppc__ and defined CPUPOWERPC}
52
{$ifc not defined __i386__ and defined CPUI386}
58
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
59
{$error Conflicting definitions for __ppc__ and __i386__}
62
{$ifc defined __ppc__ and __ppc__}
63
{$setc TARGET_CPU_PPC := TRUE}
64
{$setc TARGET_CPU_X86 := FALSE}
65
{$elifc defined __i386__ and __i386__}
66
{$setc TARGET_CPU_PPC := FALSE}
67
{$setc TARGET_CPU_X86 := TRUE}
69
{$error Neither __ppc__ nor __i386__ is defined.}
71
{$setc TARGET_CPU_PPC_64 := FALSE}
73
{$ifc defined FPC_BIG_ENDIAN}
74
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
75
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
76
{$elifc defined FPC_LITTLE_ENDIAN}
77
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
78
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
80
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
82
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
83
{$setc CALL_NOT_IN_CARBON := FALSE}
84
{$setc OLDROUTINENAMES := FALSE}
85
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
86
{$setc OPAQUE_UPP_TYPES := TRUE}
87
{$setc OTCARBONAPPLICATION := TRUE}
88
{$setc OTKERNEL := FALSE}
89
{$setc PM_USE_SESSION_APIS := TRUE}
90
{$setc TARGET_API_MAC_CARBON := TRUE}
91
{$setc TARGET_API_MAC_OS8 := FALSE}
92
{$setc TARGET_API_MAC_OSX := TRUE}
93
{$setc TARGET_CARBON := TRUE}
94
{$setc TARGET_CPU_68K := FALSE}
95
{$setc TARGET_CPU_MIPS := FALSE}
96
{$setc TARGET_CPU_SPARC := FALSE}
97
{$setc TARGET_OS_MAC := TRUE}
98
{$setc TARGET_OS_UNIX := FALSE}
99
{$setc TARGET_OS_WIN32 := FALSE}
100
{$setc TARGET_RT_MAC_68881 := FALSE}
101
{$setc TARGET_RT_MAC_CFM := FALSE}
102
{$setc TARGET_RT_MAC_MACHO := TRUE}
103
{$setc TYPED_FUNCTION_POINTERS := TRUE}
104
{$setc TYPE_BOOL := FALSE}
105
{$setc TYPE_EXTENDED := FALSE}
106
{$setc TYPE_LONGLONG := TRUE}
107
uses MacTypes,AEDataModel,Files,AERegistry,CodeFragments,MacErrors;
113
=============================================================================================
114
Modern Dictionary Manager
115
=============================================================================================
118
Dictionary information
122
kDictionaryFileType = $64696374 (* 'dict' *);
123
kDCMDictionaryHeaderSignature = $64696374 (* 'dict' *);
124
kDCMDictionaryHeaderVersion = 2;
126
kDCMAnyFieldTag = $2A2A2A2A (* '****' *);
127
kDCMAnyFieldType = $2A2A2A2A (* '****' *);
130
Contents of a Field Info Record (an AERecord)
132
keyDCMFieldTag = $66746167 (* 'ftag' *); { typeEnumeration }
133
keyDCMFieldType = $66747970 (* 'ftyp' *); { typeEnumeration }
134
keyDCMMaxRecordSize = $6D72737A (* 'mrsz' *); { typeMagnitude }
135
keyDCMFieldAttributes = $66617472 (* 'fatr' *);
136
keyDCMFieldDefaultData = $66646566 (* 'fdef' *);
137
keyDCMFieldName = $666E616D (* 'fnam' *); { typeChar }
138
keyDCMFieldFindMethods = $66666E64 (* 'ffnd' *); { typeAEList of typeDCMFindMethod }
141
Special types for fields of a Field Info Record
143
typeDCMFieldAttributes = $66617472 (* 'fatr' *);
144
typeDCMFindMethod = $666D7468 (* 'fmth' *);
150
kDCMIndexedFieldMask = $00000001;
151
kDCMRequiredFieldMask = $00000002;
152
kDCMIdentifyFieldMask = $00000004;
153
kDCMFixedSizeFieldMask = $00000008;
154
kDCMHiddenFieldMask = $80000000;
158
DCMFieldAttributes = OptionBits;
160
Standard dictionary properties
164
pDCMAccessMethod = $616D7464 (* 'amtd' *); { data type: typeChar ReadOnly }
165
pDCMPermission = $7065726D (* 'perm' *); { data type: typeUInt16 }
166
pDCMListing = $6C697374 (* 'list' *); { data type: typeUInt16 }
167
pDCMMaintenance = $6D746E63 (* 'mtnc' *); { data type: typeUInt16 }
168
pDCMLocale = $6C6F636C (* 'locl' *); { data type: typeUInt32. Optional; default = kLocaleIdentifierWildCard }
169
pDCMClass = $70636C73 (* 'pcls' *); { data type: typeUInt16 }
170
pDCMCopyright = $696E666F (* 'info' *); { data type: typeChar }
173
pDCMPermission property constants
175
kDCMReadOnlyDictionary = 0;
176
kDCMReadWriteDictionary = 1;
179
pDCMListing property constants
181
kDCMAllowListing = 0;
182
kDCMProhibitListing = 1;
185
pDCMClass property constants
187
kDCMUserDictionaryClass = 0;
188
kDCMSpecificDictionaryClass = 1;
189
kDCMBasicDictionaryClass = 2;
192
Standard search method
194
kDCMFindMethodExactMatch = $3D202020 (* '= ' *);
195
kDCMFindMethodBeginningMatch = $62677774 (* 'bgwt' *);
196
kDCMFindMethodContainsMatch = $636F6E74 (* 'cont' *);
197
kDCMFindMethodEndingMatch = $656E6473 (* 'ends' *);
198
kDCMFindMethodForwardTrie = $66747269 (* 'ftri' *); { used for morphological analysis }
199
kDCMFindMethodBackwardTrie = $62747269 (* 'btri' *); { used for morphological analysis }
203
DCMFindMethod = OSType;
205
AccessMethod features
209
kDCMCanUseFileDictionaryMask = $00000001;
210
kDCMCanUseMemoryDictionaryMask = $00000002;
211
kDCMCanStreamDictionaryMask = $00000004;
212
kDCMCanHaveMultipleIndexMask = $00000008;
213
kDCMCanModifyDictionaryMask = $00000010;
214
kDCMCanCreateDictionaryMask = $00000020;
215
kDCMCanAddDictionaryFieldMask = $00000040;
216
kDCMCanUseTransactionMask = $00000080;
220
DCMAccessMethodFeature = OptionBits;
221
DCMUniqueID = UInt32;
222
DCMObjectID = ^SInt32; { an opaque 32-bit type }
223
DCMObjectIDPtr = ^DCMObjectID; { when a var xx:DCMObjectID parameter can be nil, it is changed to xx: DCMObjectIDPtr }
224
DCMAccessMethodID = DCMObjectID;
225
DCMDictionaryID = DCMObjectID;
226
DCMObjectRef = ^SInt32; { an opaque 32-bit type }
227
DCMObjectRefPtr = ^DCMObjectRef; { when a var xx:DCMObjectRef parameter can be nil, it is changed to xx: DCMObjectRefPtr }
228
DCMDictionaryRef = DCMObjectRef;
229
DCMDictionaryStreamRef = DCMObjectRef;
230
DCMObjectIterator = ^SInt32; { an opaque 32-bit type }
231
DCMObjectIteratorPtr = ^DCMObjectIterator; { when a var xx:DCMObjectIterator parameter can be nil, it is changed to xx: DCMObjectIteratorPtr }
232
DCMAccessMethodIterator = DCMObjectIterator;
233
DCMDictionaryIterator = DCMObjectIterator;
234
DCMFoundRecordIterator = ^SInt32; { an opaque 32-bit type }
235
DCMFoundRecordIteratorPtr = ^DCMFoundRecordIterator; { when a var xx:DCMFoundRecordIterator parameter can be nil, it is changed to xx: DCMFoundRecordIteratorPtr }
237
Field specification declarations
239
DCMFieldTag = DescType;
240
DCMFieldTagPtr = ^DCMFieldTag;
241
DCMFieldType = DescType;
243
Dictionary header information
245
DCMDictionaryHeaderPtr = ^DCMDictionaryHeader;
246
DCMDictionaryHeader = record
247
headerSignature: FourCharCode;
248
headerVersion: UInt32;
249
headerSize: ByteCount;
256
{$ifc TYPED_FUNCTION_POINTERS}
257
DCMProgressFilterProcPtr = function(determinateProcess: boolean; percentageComplete: UInt16; callbackUD: UInt32): boolean;
259
DCMProgressFilterProcPtr = ProcPtr;
262
{$ifc OPAQUE_UPP_TYPES}
263
DCMProgressFilterUPP = ^SInt32; { an opaque UPP }
265
DCMProgressFilterUPP = UniversalProcPtr;
269
uppDCMProgressFilterProcInfo = $00000E50;
270
{$ifc CALL_NOT_IN_CARBON}
272
* NewDCMProgressFilterUPP()
275
* Non-Carbon CFM: available as macro/inline
276
* CarbonLib: not available
277
* Mac OS X: not available
279
function NewDCMProgressFilterUPP(userRoutine: DCMProgressFilterProcPtr): DCMProgressFilterUPP; external name '_NewDCMProgressFilterUPP'; { old name was NewDCMProgressFilterProc }
281
* DisposeDCMProgressFilterUPP()
284
* Non-Carbon CFM: available as macro/inline
285
* CarbonLib: not available
286
* Mac OS X: not available
288
procedure DisposeDCMProgressFilterUPP(userUPP: DCMProgressFilterUPP); external name '_DisposeDCMProgressFilterUPP';
290
* InvokeDCMProgressFilterUPP()
293
* Non-Carbon CFM: available as macro/inline
294
* CarbonLib: not available
295
* Mac OS X: not available
297
function InvokeDCMProgressFilterUPP(determinateProcess: boolean; percentageComplete: UInt16; callbackUD: UInt32; userRoutine: DCMProgressFilterUPP): boolean; external name '_InvokeDCMProgressFilterUPP'; { old name was CallDCMProgressFilterProc }
298
{$endc} {CALL_NOT_IN_CARBON}
304
* DCMLibraryVersion()
307
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
308
* CarbonLib: in CarbonLib 1.0 and later
309
* Mac OS X: in version 10.0 and later
311
function DCMLibraryVersion: UInt32; external name '_DCMLibraryVersion';
314
Create/delete dictionary
320
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
321
* CarbonLib: in CarbonLib 1.0 and later
322
* Mac OS X: in version 10.0 and later
324
function DCMNewDictionary(accessMethodID: DCMAccessMethodID; const (*var*) newDictionaryFile: FSSpec; scriptTag: ScriptCode; const (*var*) listOfFieldInfoRecords: AEDesc; invisible: boolean; recordCapacity: ItemCount; var newDictionary: DCMDictionaryID): OSStatus; external name '_DCMNewDictionary';
327
* DCMDeriveNewDictionary()
330
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
331
* CarbonLib: in CarbonLib 1.0 and later
332
* Mac OS X: in version 10.0 and later
334
function DCMDeriveNewDictionary(srcDictionary: DCMDictionaryID; const (*var*) newDictionaryFile: FSSpec; scriptTag: ScriptCode; invisible: boolean; recordCapacity: ItemCount; var newDictionary: DCMDictionaryID): OSStatus; external name '_DCMDeriveNewDictionary';
337
* DCMDeleteDictionary()
340
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
341
* CarbonLib: in CarbonLib 1.0 and later
342
* Mac OS X: in version 10.0 and later
344
function DCMDeleteDictionary(dictionaryID: DCMDictionaryID): OSStatus; external name '_DCMDeleteDictionary';
350
* DCMRegisterDictionaryFile()
353
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
354
* CarbonLib: in CarbonLib 1.0 and later
355
* Mac OS X: in version 10.0 and later
357
function DCMRegisterDictionaryFile(const (*var*) dictionaryFile: FSSpec; var dictionaryID: DCMDictionaryID): OSStatus; external name '_DCMRegisterDictionaryFile';
360
* DCMUnregisterDictionary()
363
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
364
* CarbonLib: in CarbonLib 1.0 and later
365
* Mac OS X: in version 10.0 and later
367
function DCMUnregisterDictionary(dictionaryID: DCMDictionaryID): OSStatus; external name '_DCMUnregisterDictionary';
373
* DCMOpenDictionary()
376
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
377
* CarbonLib: in CarbonLib 1.0 and later
378
* Mac OS X: in version 10.0 and later
380
function DCMOpenDictionary(dictionaryID: DCMDictionaryID; protectKeySize: ByteCount; protectKey: ConstLogicalAddress; var dictionaryRef: DCMDictionaryRef): OSStatus; external name '_DCMOpenDictionary';
383
* DCMCloseDictionary()
386
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
387
* CarbonLib: in CarbonLib 1.0 and later
388
* Mac OS X: in version 10.0 and later
390
function DCMCloseDictionary(dictionaryRef: DCMDictionaryRef): OSStatus; external name '_DCMCloseDictionary';
393
Change access privilege
396
* DCMGetDictionaryWriteAccess()
399
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
400
* CarbonLib: in CarbonLib 1.0 and later
401
* Mac OS X: in version 10.0 and later
403
function DCMGetDictionaryWriteAccess(dictionaryRef: DCMDictionaryRef; timeOutDuration: Duration): OSStatus; external name '_DCMGetDictionaryWriteAccess';
406
* DCMReleaseDictionaryWriteAccess()
409
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
410
* CarbonLib: in CarbonLib 1.0 and later
411
* Mac OS X: in version 10.0 and later
413
function DCMReleaseDictionaryWriteAccess(dictionaryRef: DCMDictionaryRef; commitTransaction: boolean): OSStatus; external name '_DCMReleaseDictionaryWriteAccess';
422
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
423
* CarbonLib: in CarbonLib 1.0 and later
424
* Mac OS X: in version 10.0 and later
426
function DCMFindRecords(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; findMethod: DCMFindMethod; preFetchedDataNum: ItemCount; preFetchedData: DCMFieldTagPtr; skipCount: ItemCount; maxRecordCount: ItemCount; var recordIterator: DCMFoundRecordIterator): OSStatus; external name '_DCMFindRecords';
429
* DCMCountRecordIterator()
432
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
433
* CarbonLib: in CarbonLib 1.0 and later
434
* Mac OS X: in version 10.0 and later
436
function DCMCountRecordIterator(recordIterator: DCMFoundRecordIterator): ItemCount; external name '_DCMCountRecordIterator';
439
* DCMIterateFoundRecord()
442
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
443
* CarbonLib: in CarbonLib 1.0 and later
444
* Mac OS X: in version 10.0 and later
446
function DCMIterateFoundRecord(recordIterator: DCMFoundRecordIterator; maxKeySize: ByteCount; var actualKeySize: ByteCount; keyData: LogicalAddress; var uniqueID: DCMUniqueID; var dataList: AEDesc): OSStatus; external name '_DCMIterateFoundRecord';
449
* DCMDisposeRecordIterator()
452
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
453
* CarbonLib: in CarbonLib 1.0 and later
454
* Mac OS X: in version 10.0 and later
456
function DCMDisposeRecordIterator(recordIterator: DCMFoundRecordIterator): OSStatus; external name '_DCMDisposeRecordIterator';
465
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
466
* CarbonLib: in CarbonLib 1.0 and later
467
* Mac OS X: in version 10.0 and later
469
function DCMCountRecord(dictionaryID: DCMDictionaryID; var count: ItemCount): OSStatus; external name '_DCMCountRecord';
472
* DCMGetRecordSequenceNumber()
475
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
476
* CarbonLib: in CarbonLib 1.0 and later
477
* Mac OS X: in version 10.0 and later
479
function DCMGetRecordSequenceNumber(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; var sequenceNum: ItemCount): OSStatus; external name '_DCMGetRecordSequenceNumber';
485
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
486
* CarbonLib: in CarbonLib 1.0 and later
487
* Mac OS X: in version 10.0 and later
489
function DCMGetNthRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; serialNum: ItemCount; maxKeySize: ByteCount; var keySize: ByteCount; keyData: LogicalAddress; var uniqueID: DCMUniqueID): OSStatus; external name '_DCMGetNthRecord';
495
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
496
* CarbonLib: in CarbonLib 1.0 and later
497
* Mac OS X: in version 10.0 and later
499
function DCMGetNextRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; maxKeySize: ByteCount; var nextKeySize: ByteCount; nextKeyData: LogicalAddress; var nextUniqueID: DCMUniqueID): OSStatus; external name '_DCMGetNextRecord';
505
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
506
* CarbonLib: in CarbonLib 1.0 and later
507
* Mac OS X: in version 10.0 and later
509
function DCMGetPrevRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; maxKeySize: ByteCount; var prevKeySize: ByteCount; prevKeyData: LogicalAddress; var prevUniqueID: DCMUniqueID): OSStatus; external name '_DCMGetPrevRecord';
518
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
519
* CarbonLib: in CarbonLib 1.0 and later
520
* Mac OS X: in version 10.0 and later
522
function DCMGetFieldData(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; numOfData: ItemCount; dataTag: DCMFieldTagPtr; var dataList: AEDesc): OSStatus; external name '_DCMGetFieldData';
528
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
529
* CarbonLib: in CarbonLib 1.0 and later
530
* Mac OS X: in version 10.0 and later
532
function DCMSetFieldData(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID; const (*var*) dataList: AEDesc): OSStatus; external name '_DCMSetFieldData';
541
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
542
* CarbonLib: in CarbonLib 1.0 and later
543
* Mac OS X: in version 10.0 and later
545
function DCMAddRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; checkOnly: boolean; const (*var*) dataList: AEDesc; var newUniqueID: DCMUniqueID): OSStatus; external name '_DCMAddRecord';
551
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
552
* CarbonLib: in CarbonLib 1.0 and later
553
* Mac OS X: in version 10.0 and later
555
function DCMDeleteRecord(dictionaryRef: DCMDictionaryRef; keyFieldTag: DCMFieldTag; keySize: ByteCount; keyData: ConstLogicalAddress; uniqueID: DCMUniqueID): OSStatus; external name '_DCMDeleteRecord';
558
Reorganize/compact dictionary
561
* DCMReorganizeDictionary()
564
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
565
* CarbonLib: in CarbonLib 1.0 and later
566
* Mac OS X: in version 10.0 and later
568
function DCMReorganizeDictionary(dictionaryID: DCMDictionaryID; extraCapacity: ItemCount; progressProc: DCMProgressFilterUPP; userData: UInt32): OSStatus; external name '_DCMReorganizeDictionary';
571
* DCMCompactDictionary()
574
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
575
* CarbonLib: in CarbonLib 1.0 and later
576
* Mac OS X: in version 10.0 and later
578
function DCMCompactDictionary(dictionaryID: DCMDictionaryID; progressProc: DCMProgressFilterUPP; userData: UInt32): OSStatus; external name '_DCMCompactDictionary';
581
DictionaryID utilities
584
* DCMGetFileFromDictionaryID()
587
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
588
* CarbonLib: in CarbonLib 1.0 and later
589
* Mac OS X: in version 10.0 and later
591
function DCMGetFileFromDictionaryID(dictionaryID: DCMDictionaryID; var fileRef: FSSpec): OSStatus; external name '_DCMGetFileFromDictionaryID';
594
* DCMGetDictionaryIDFromFile()
597
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
598
* CarbonLib: in CarbonLib 1.0 and later
599
* Mac OS X: in version 10.0 and later
601
function DCMGetDictionaryIDFromFile(const (*var*) fileRef: FSSpec; var dictionaryID: DCMDictionaryID): OSStatus; external name '_DCMGetDictionaryIDFromFile';
604
* DCMGetDictionaryIDFromRef()
607
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
608
* CarbonLib: in CarbonLib 1.0 and later
609
* Mac OS X: in version 10.0 and later
611
function DCMGetDictionaryIDFromRef(dictionaryRef: DCMDictionaryRef): DCMDictionaryID; external name '_DCMGetDictionaryIDFromRef';
614
Field information and manipulation
617
* DCMGetDictionaryFieldInfo()
620
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
621
* CarbonLib: in CarbonLib 1.0 and later
622
* Mac OS X: in version 10.0 and later
624
function DCMGetDictionaryFieldInfo(dictionaryID: DCMDictionaryID; fieldTag: DCMFieldTag; var fieldInfoRecord: AEDesc): OSStatus; external name '_DCMGetDictionaryFieldInfo';
630
* DCMGetDictionaryProperty()
633
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
634
* CarbonLib: in CarbonLib 1.0 and later
635
* Mac OS X: in version 10.0 and later
637
function DCMGetDictionaryProperty(dictionaryID: DCMDictionaryID; propertyTag: DCMFieldTag; maxPropertySize: ByteCount; var actualSize: ByteCount; propertyValue: LogicalAddress): OSStatus; external name '_DCMGetDictionaryProperty';
640
* DCMSetDictionaryProperty()
643
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
644
* CarbonLib: in CarbonLib 1.0 and later
645
* Mac OS X: in version 10.0 and later
647
function DCMSetDictionaryProperty(dictionaryID: DCMDictionaryID; propertyTag: DCMFieldTag; propertySize: ByteCount; propertyValue: ConstLogicalAddress): OSStatus; external name '_DCMSetDictionaryProperty';
650
* DCMGetDictionaryPropertyList()
653
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
654
* CarbonLib: in CarbonLib 1.0 and later
655
* Mac OS X: in version 10.0 and later
657
function DCMGetDictionaryPropertyList(dictionaryID: DCMDictionaryID; maxPropertyNum: ItemCount; var numProperties: ItemCount; propertyTag: DCMFieldTagPtr): OSStatus; external name '_DCMGetDictionaryPropertyList';
663
* DCMCreateDictionaryIterator()
666
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
667
* CarbonLib: in CarbonLib 1.0 and later
668
* Mac OS X: in version 10.0 and later
670
function DCMCreateDictionaryIterator(var dictionaryIterator: DCMDictionaryIterator): OSStatus; external name '_DCMCreateDictionaryIterator';
676
* DCMCreateAccessMethodIterator()
679
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
680
* CarbonLib: in CarbonLib 1.0 and later
681
* Mac OS X: in version 10.0 and later
683
function DCMCreateAccessMethodIterator(var accessMethodIterator: DCMAccessMethodIterator): OSStatus; external name '_DCMCreateAccessMethodIterator';
689
* DCMCountObjectIterator()
692
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
693
* CarbonLib: in CarbonLib 1.0 and later
694
* Mac OS X: in version 10.0 and later
696
function DCMCountObjectIterator(iterator: DCMObjectIterator): ItemCount; external name '_DCMCountObjectIterator';
702
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
703
* CarbonLib: in CarbonLib 1.0 and later
704
* Mac OS X: in version 10.0 and later
706
function DCMIterateObject(iterator: DCMObjectIterator; var objectID: DCMObjectID): OSStatus; external name '_DCMIterateObject';
709
* DCMResetObjectIterator()
712
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
713
* CarbonLib: in CarbonLib 1.0 and later
714
* Mac OS X: in version 10.0 and later
716
function DCMResetObjectIterator(iterator: DCMObjectIterator): OSStatus; external name '_DCMResetObjectIterator';
719
* DCMDisposeObjectIterator()
722
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
723
* CarbonLib: in CarbonLib 1.0 and later
724
* Mac OS X: in version 10.0 and later
726
function DCMDisposeObjectIterator(iterator: DCMObjectIterator): OSStatus; external name '_DCMDisposeObjectIterator';
729
Get AccessMethod information
732
* DCMGetAccessMethodIDFromName()
735
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
736
* CarbonLib: in CarbonLib 1.0 and later
737
* Mac OS X: in version 10.0 and later
739
function DCMGetAccessMethodIDFromName(const (*var*) accessMethodName: Str63; var accessMethodID: DCMAccessMethodID): OSStatus; external name '_DCMGetAccessMethodIDFromName';
742
Field Info Record routines
745
* DCMCreateFieldInfoRecord()
748
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
749
* CarbonLib: in CarbonLib 1.0 and later
750
* Mac OS X: in version 10.0 and later
752
function DCMCreateFieldInfoRecord(fieldTag: DescType; fieldType: DescType; maxRecordSize: ByteCount; fieldAttributes: DCMFieldAttributes; var fieldDefaultData: AEDesc; numberOfFindMethods: ItemCount; var findMethods: DCMFindMethod; var fieldInfoRecord: AEDesc): OSStatus; external name '_DCMCreateFieldInfoRecord';
755
* DCMGetFieldTagAndType()
758
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
759
* CarbonLib: in CarbonLib 1.0 and later
760
* Mac OS X: in version 10.0 and later
762
function DCMGetFieldTagAndType(const (*var*) fieldInfoRecord: AEDesc; var fieldTag: DCMFieldTag; var fieldType: DCMFieldType): OSStatus; external name '_DCMGetFieldTagAndType';
765
* DCMGetFieldMaxRecordSize()
768
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
769
* CarbonLib: in CarbonLib 1.0 and later
770
* Mac OS X: in version 10.0 and later
772
function DCMGetFieldMaxRecordSize(const (*var*) fieldInfoRecord: AEDesc; var maxRecordSize: ByteCount): OSStatus; external name '_DCMGetFieldMaxRecordSize';
775
* DCMGetFieldAttributes()
778
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
779
* CarbonLib: in CarbonLib 1.0 and later
780
* Mac OS X: in version 10.0 and later
782
function DCMGetFieldAttributes(const (*var*) fieldInfoRecord: AEDesc; var attributes: DCMFieldAttributes): OSStatus; external name '_DCMGetFieldAttributes';
785
* DCMGetFieldDefaultData()
788
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
789
* CarbonLib: in CarbonLib 1.0 and later
790
* Mac OS X: in version 10.0 and later
792
function DCMGetFieldDefaultData(const (*var*) fieldInfoRecord: AEDesc; desiredType: DescType; var fieldDefaultData: AEDesc): OSStatus; external name '_DCMGetFieldDefaultData';
795
* DCMGetFieldFindMethods()
798
* Non-Carbon CFM: in DictionaryMgrLib 1.0 and later
799
* CarbonLib: in CarbonLib 1.0 and later
800
* Mac OS X: in version 10.0 and later
802
function DCMGetFieldFindMethods(const (*var*) fieldInfoRecord: AEDesc; findMethodsArrayMaxSize: ItemCount; var findMethods: DCMFindMethod; var actualNumberOfFindMethods: ItemCount): OSStatus; external name '_DCMGetFieldFindMethods';
805
Check Dictionary Manager availability
807
{$ifc TARGET_RT_MAC_CFM}
809
DCMDictionaryManagerAvailable() is a macro available only in C/C++.
810
To get the same functionality from pascal or assembly, you need
811
to test if Dictionary Manager functions are not NULL.
814
IF @DCMLibraryVersion <> kUnresolvedCFragSymbolAddress THEN
815
gDictionaryManagerAvailable = TRUE;
817
gDictionaryManagerAvailable = FALSE;
822
{$ifc TARGET_RT_MAC_MACHO}
823
{ Dictionary Manager is always available on OS X }
828
=============================================================================================
829
Definitions for Japanese Analysis Module
830
=============================================================================================
833
Default dictionary access method for Japanese analysis
836
Data length limitations of Apple Japanese dictionaries
840
kMaxYomiLengthInAppleJapaneseDictionary = 40;
841
kMaxKanjiLengthInAppleJapaneseDictionary = 64;
844
Defined field tags of Apple Japanese dictionary
846
kDCMJapaneseYomiTag = $796F6D69 (* 'yomi' *);
847
kDCMJapaneseHyokiTag = $68796F6B (* 'hyok' *);
848
kDCMJapaneseHinshiTag = $68696E73 (* 'hins' *);
849
kDCMJapaneseWeightTag = $68696E64 (* 'hind' *);
850
kDCMJapanesePhoneticTag = $68746F6E (* 'hton' *);
851
kDCMJapaneseAccentTag = $61636E74 (* 'acnt' *);
852
kDCMJapaneseOnKunReadingTag = $4F6E4B6E (* 'OnKn' *);
853
kDCMJapaneseFukugouInfoTag = $66756B75 (* 'fuku' *);
855
kDCMJapaneseYomiType = $75747874 (* 'utxt' *);
856
kDCMJapaneseHyokiType = $75747874 (* 'utxt' *);
857
kDCMJapaneseHinshiType = $68696E73 (* 'hins' *);
858
kDCMJapaneseWeightType = $73686F72 (* 'shor' *);
859
kDCMJapanesePhoneticType = $75747874 (* 'utxt' *);
860
kDCMJapaneseAccentType = $62797465 (* 'byte' *);
861
kDCMJapaneseOnKunReadingType = $75747874 (* 'utxt' *);
862
kDCMJapaneseFukugouInfoType = $66756B75 (* 'fuku' *);
866
=============================================================================================
867
System 7 Dictionary Manager
868
=============================================================================================
871
{ Dictionary data insertion modes }
872
kInsert = 0; { Only insert the input entry if there is nothing in the dictionary that matches the key. }
873
kReplace = 1; { Only replace the entries which match the key with the input entry. }
874
kInsertOrReplace = 2; { Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. }
876
{ This Was InsertMode }
879
DictionaryDataInsertMode = SInt16;
882
{ Key attribute constants }
883
kIsCaseSensitive = $10; { case sensitive = 16 }
884
kIsNotDiacriticalSensitive = $20; { diac not sensitive = 32 }
886
{ Registered attribute type constants. }
892
{ This Was AttributeType }
895
DictionaryEntryAttribute = SInt8;
896
{ Dictionary information record }
897
DictionaryInformationPtr = ^DictionaryInformation;
898
DictionaryInformation = record
899
dictionaryFSSpec: FSSpec;
900
numberOfRecords: SInt32;
901
currentGarbageSize: SInt32;
903
maximumKeyLength: SInt16;
904
keyAttributes: SInt8;
907
DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
908
DictionaryAttributeTable = packed record
910
datTable: array [0..0] of DictionaryEntryAttribute;
913
{$ifc CALL_NOT_IN_CARBON}
915
* InitializeDictionary()
918
* Non-Carbon CFM: in InterfaceLib 7.1 and later
919
* CarbonLib: not available
920
* Mac OS X: not available
922
function InitializeDictionary(const (*var*) theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: SInt8; script: ScriptCode): OSErr; external name '_InitializeDictionary';
927
* Non-Carbon CFM: in InterfaceLib 7.1 and later
928
* CarbonLib: not available
929
* Mac OS X: not available
931
function OpenDictionary(const (*var*) theFsspecPtr: FSSpec; accessPermission: SInt8; var dictionaryReference: SInt32): OSErr; external name '_OpenDictionary';
936
* Non-Carbon CFM: in InterfaceLib 7.1 and later
937
* CarbonLib: not available
938
* Mac OS X: not available
940
function CloseDictionary(dictionaryReference: SInt32): OSErr; external name '_CloseDictionary';
942
* InsertRecordToDictionary()
945
* Non-Carbon CFM: in InterfaceLib 7.1 and later
946
* CarbonLib: not available
947
* Mac OS X: not available
949
function InsertRecordToDictionary(dictionaryReference: SInt32; const (*var*) key: Str255; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr; external name '_InsertRecordToDictionary';
951
* DeleteRecordFromDictionary()
954
* Non-Carbon CFM: in InterfaceLib 7.1 and later
955
* CarbonLib: not available
956
* Mac OS X: not available
958
function DeleteRecordFromDictionary(dictionaryReference: SInt32; const (*var*) key: Str255): OSErr; external name '_DeleteRecordFromDictionary';
960
* FindRecordInDictionary()
963
* Non-Carbon CFM: in InterfaceLib 7.1 and later
964
* CarbonLib: not available
965
* Mac OS X: not available
967
function FindRecordInDictionary(dictionaryReference: SInt32; const (*var*) key: Str255; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr; external name '_FindRecordInDictionary';
969
* FindRecordByIndexInDictionary()
972
* Non-Carbon CFM: in InterfaceLib 7.1 and later
973
* CarbonLib: not available
974
* Mac OS X: not available
976
function FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; var recordKey: Str255; recordDataHandle: Handle): OSErr; external name '_FindRecordByIndexInDictionary';
978
* GetDictionaryInformation()
981
* Non-Carbon CFM: in InterfaceLib 7.1 and later
982
* CarbonLib: not available
983
* Mac OS X: not available
985
function GetDictionaryInformation(dictionaryReference: SInt32; var theDictionaryInformation: DictionaryInformation): OSErr; external name '_GetDictionaryInformation';
987
* CompactDictionary()
990
* Non-Carbon CFM: in InterfaceLib 7.1 and later
991
* CarbonLib: not available
992
* Mac OS X: not available
994
function CompactDictionary(dictionaryReference: SInt32): OSErr; external name '_CompactDictionary';
995
{$endc} {CALL_NOT_IN_CARBON}