home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Dictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  3.9 KB  |  127 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Dictionary.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __DICTIONARY__
  18. #define __DICTIONARY__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __FILES__
  27. #include <Files.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <OSUtils.h>                                        */
  31. /*        #include <Memory.h>                                        */
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if GENERATINGPOWERPC
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #ifdef __CFM68K__
  42. #pragma lib_export on
  43. #endif
  44.  
  45.  
  46. enum {
  47. /* Dictionary data insertion modes */
  48.     kInsert                        = 0,                            /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
  49.     kReplace                    = 1,                            /* Only replace the entries which match the key with the input entry. */
  50.     kInsertOrReplace            = 2                                /* Insert the entry if there is nothing in the dictionary which matches the key. 
  51.                            If there is already matched entries, replace the existing matched entries with the input entry. */
  52. };
  53.  
  54. /* This Was InsertMode */
  55. typedef short DictionaryDataInsertMode;
  56.  
  57.  
  58. enum {
  59. /* Key attribute constants */
  60.     kIsCaseSensitive            = 0x10,                            /* case sensitive = 16        */
  61.     kIsNotDiacriticalSensitive    = 0x20                            /* diac not sensitive = 32    */
  62. };
  63.  
  64. enum {
  65. /* Registered attribute type constants.    */
  66.     kNoun                        = -1,
  67.     kVerb                        = -2,
  68.     kAdjective                    = -3,
  69.     kAdverb                        = -4
  70. };
  71.  
  72. /* This Was AttributeType */
  73. typedef SInt8 DictionaryEntryAttribute;
  74.  
  75. /* Dictionary information record */
  76. struct DictionaryInformation {
  77.     FSSpec                            dictionaryFSSpec;
  78.     long                            numberOfRecords;
  79.     long                            currentGarbageSize;
  80.     ScriptCode                        script;
  81.     short                            maximumKeyLength;
  82.     SInt8                            keyAttributes;
  83.     SInt8                            filler;
  84. };
  85. typedef struct DictionaryInformation DictionaryInformation;
  86.  
  87. struct DictionaryAttributeTable {
  88.     UInt8                            datSize;
  89.     DictionaryEntryAttribute        datTable[1];
  90. };
  91. typedef struct DictionaryAttributeTable DictionaryAttributeTable;
  92.  
  93. typedef DictionaryAttributeTable *DictionaryAttributeTablePtr;
  94.  
  95. extern pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, short maximumKeyLength, unsigned char keyAttributes, ScriptCode script)
  96.  THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
  97. extern pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, char accessPermission, long *dictionaryReference)
  98.  THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
  99. extern pascal OSErr CloseDictionary(long dictionaryReference)
  100.  THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
  101. extern pascal OSErr InsertRecordToDictionary(long dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  102.  THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
  103. extern pascal OSErr DeleteRecordFromDictionary(long dictionaryReference, ConstStr255Param key)
  104.  THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
  105. extern pascal OSErr FindRecordInDictionary(long dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  106.  THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
  107. extern pascal OSErr FindRecordByIndexInDictionary(long dictionaryReference, long recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  108.  THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
  109. extern pascal OSErr GetDictionaryInformation(long dictionaryReference, DictionaryInformation *theDictionaryInformation)
  110.  THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
  111. extern pascal OSErr CompactDictionary(long dictionaryReference)
  112.  THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
  113.  
  114. #ifdef __CFM68K__
  115. #pragma lib_export off
  116. #endif
  117.  
  118. #if GENERATINGPOWERPC
  119. #pragma options align=reset
  120. #endif
  121.  
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125.  
  126. #endif /* __DICTIONARY__ */
  127.