Mac OS 9
FindByContent.h
Go to the documentation of this file.
1 
19 #ifndef __FINDBYCONTENT__
20 #define __FINDBYCONTENT__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FILES__
27 #include <Files.h>
28 #endif
29 
30 #ifndef __MACERRORS__
31 #include <MacErrors.h>
32 #endif
33 
34 #ifndef __CFSTRING__
35 #include <CFString.h>
36 #endif
37 
38 #if PRAGMA_ONCE
39 #pragma once
40 #endif
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 #if PRAGMA_IMPORT
48 #pragma import on
49 #endif
50 
51 #if PRAGMA_STRUCT_ALIGN
52 #pragma options align = mac68k
53 #elif PRAGMA_STRUCT_PACKPUSH
54 #pragma pack(push, 2)
55 #elif PRAGMA_STRUCT_PACK
56 #pragma pack(2)
57 #endif
58 
68  enum
69  {
70  /* languages that use the Roman character mapping*/
71  englishHighWord = (long)0x80000000,
72  dutchHighWord = 0x40000000, /* also Afrikaans*/
73  germanHighWord = 0x20000000,
74  swedishHighWord = 0x10000000, /* also Norwegian*/
75  danishHighWord = 0x08000000,
76  spanishHighWord = 0x04000000, /* also Catalan*/
77  portugueseHighWord = 0x02000000,
78  italianHighWord = 0x01000000,
79  frenchHighWord = 0x00800000,
80  romanHighWord = 0x00400000, /* other languages using Roman alphabet*/
81  /* Languages that use other mappings*/
82  icelandicHighWord = 0x00200000, /* also Faroese*/
83  hebrewHighWord = 0x00100000, /* also Yiddish*/
84  arabicHighWord = 0x00080000, /* also Farsi, Urdu*/
85  centeuroHighWord =
86  0x00040000, /* Central European languages not using Cyrillic*/
87  croatianHighWord = 0x00020000,
88  turkishHighWord = 0x00010000,
89  romanianHighWord = 0x00008000,
90  greekHighWord = 0x00004000,
91  cyrillicHighWord = 0x00002000, /* all languages using Cyrillic*/
92  devanagariHighWord = 0x00001000,
93  gujuratiHighWord = 0x00000800,
94  gurmukhiHighWord = 0x00000400,
95  japaneseHighWord = 0x00000200,
96  koreanHighWord = 0x00000100,
97  kDefaultLanguagesHighWord = (long)0xFF800000 /* sum of first 9*/
98  };
99 
107  enum
108  {
109  /* indexing phases*/
110  kFBCphIndexing = 0,
111  kFBCphFlushing = 1,
112  kFBCphMerging = 2,
113  kFBCphMakingIndexAccessor = 3,
114  kFBCphCompacting = 4,
115  kFBCphIndexWaiting = 5, /* access phases*/
116  kFBCphSearching = 6,
117  kFBCphMakingAccessAccessor = 7,
118  kFBCphAccessWaiting = 8, /* summarization*/
119  kFBCphSummarizing = 9, /* indexing or access*/
120  kFBCphIdle = 10,
121  kFBCphCanceling = 11
122  };
123 
132  /* A collection of state information for searching*/
133  typedef struct OpaqueFBCSearchSession *FBCSearchSession;
134  /* An ordinary C string (used for hit/doc terms)*/
135  typedef char *FBCWordItem;
136  /* An array of WordItems*/
137  typedef FBCWordItem *FBCWordList;
148  typedef CALLBACK_API_C(Boolean, FBCCallbackProcPtr)(UInt16 phase,
149  float percentDone,
150  void *data);
151  typedef TVECTOR_UPP_TYPE(FBCCallbackProcPtr) FBCCallbackUPP;
160  FBCCallbackUPP
161  NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine);
162 #if !OPAQUE_UPP_TYPES
163  enum
164  {
165  uppFBCCallbackProcInfo = 0x00000F91
166  }; /* 1_byte Func(2_bytes, 4_bytes, 4_bytes) */
167 #ifdef __cplusplus
168  inline FBCCallbackUPP NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine)
169  {
170  return userRoutine;
171  }
172 #else
173 #define NewFBCCallbackUPP(userRoutine) (userRoutine)
174 #endif
175 #endif
176 
185  void
186  DisposeFBCCallbackUPP(FBCCallbackUPP userUPP);
187 #if !OPAQUE_UPP_TYPES
188 #ifdef __cplusplus
189  inline void DisposeFBCCallbackUPP(FBCCallbackUPP) {}
190 #else
191 #define DisposeFBCCallbackUPP(userUPP)
192 #endif
193 #endif
194 
203  Boolean
204  InvokeFBCCallbackUPP(UInt16 phase, float percentDone, void *data,
205  FBCCallbackUPP userUPP);
206 #if !OPAQUE_UPP_TYPES
207 #ifdef __cplusplus
208  inline Boolean InvokeFBCCallbackUPP(UInt16 phase, float percentDone, void *data,
209  FBCCallbackUPP userUPP)
210  {
211  return (*userUPP)(phase, percentDone, data);
212  }
213 #else
214 #define InvokeFBCCallbackUPP(phase, percentDone, data, userUPP) \
215  (*userUPP)(phase, percentDone, data)
216 #endif
217 #endif
218 
234  void
235  FBCSetCallback(FBCCallbackUPP fn, void *data);
236 
245  void
246  FBCSetHeapReservation(UInt32 bytes);
247 
263  Boolean
264  FBCVolumeIsIndexed(SInt16 theVRefNum);
265 
274  Boolean
275  FBCVolumeIsRemote(SInt16 theVRefNum);
276 
285  OSErr
286  FBCVolumeIndexTimeStamp(SInt16 theVRefNum, UInt32 *timeStamp);
287 
296  OSErr
297  FBCVolumeIndexPhysicalSize(SInt16 theVRefNum, UInt32 *size);
298 
313  OSErr
315 
324  OSErr
326 
335  OSErr
336  FBCSetSessionVolumes(FBCSearchSession theSession, const SInt16 vRefNums[],
337  UInt16 numVolumes);
338 
347  OSErr
348  FBCAddVolumeToSession(FBCSearchSession theSession, SInt16 vRefNum);
349 
358  OSErr
359  FBCRemoveVolumeFromSession(FBCSearchSession theSession, SInt16 vRefNum);
360 
369  OSErr
370  FBCGetSessionVolumeCount(FBCSearchSession theSession, UInt16 *count);
371 
380  OSErr
381  FBCGetSessionVolumes(FBCSearchSession theSession, SInt16 vRefNums[],
382  UInt16 *numVolumes);
383 
392  OSErr
394 
409  OSErr
410  FBCDoQuerySearch(FBCSearchSession theSession, char *queryText,
411  const FSSpec targetDirs[], UInt32 numTargets, UInt32 maxHits,
412  UInt32 maxHitWords);
413 
422  OSErr
423  FBCDoCFStringSearch(FBCSearchSession theSession, CFStringRef queryString,
424  const FSSpec targetDirs[], UInt32 numTargets,
425  UInt32 maxHits, UInt32 maxHitWords);
426 
435  OSErr
436  FBCDoExampleSearch(FBCSearchSession theSession, const UInt32 *exampleHitNums,
437  UInt32 numExamples, const FSSpec targetDirs[],
438  UInt32 numTargets, UInt32 maxHits, UInt32 maxHitWords);
439 
448  OSErr
449  FBCBlindExampleSearch(FSSpec examples[], UInt32 numExamples,
450  const FSSpec targetDirs[], UInt32 numTargets,
451  UInt32 maxHits, UInt32 maxHitWords, Boolean allIndexes,
452  Boolean includeRemote, FBCSearchSession *theSession);
453 
468  OSErr
469  FBCGetHitCount(FBCSearchSession theSession, UInt32 *count);
470 
479  OSErr
480  FBCGetHitDocument(FBCSearchSession theSession, UInt32 hitNumber,
481  FSSpec *theDocument);
482 
491  OSErr
492  FBCGetHitDocumentRef(FBCSearchSession theSession, UInt32 hitNumber,
493  FSRef *theDocument);
494 
503  OSErr
504  FBCGetHitScore(FBCSearchSession theSession, UInt32 hitNumber, float *score);
505 
514  OSErr
515  FBCGetMatchedWords(FBCSearchSession theSession, UInt32 hitNumber,
516  UInt32 *wordCount, FBCWordList *list);
517 
526  OSErr
527  FBCGetTopicWords(FBCSearchSession theSession, UInt32 hitNumber,
528  UInt32 *wordCount, FBCWordList *list);
529 
544  OSErr
545  FBCSummarize(void *inBuf, UInt32 inLength, void *outBuf, UInt32 *outLength,
546  UInt32 *numSentences);
547 
562  OSErr
564 
573  OSErr
574  FBCDestroyWordList(FBCWordList theList, UInt32 wordCount);
575 
584  OSErr
586 
601  OSErr
602  FBCIndexItems(FSSpecArrayPtr theItems, UInt32 itemCount);
603 
612  OSErr
613  FBCIndexItemsInLanguages(FSSpecArrayPtr theItems, UInt32 itemCount,
614  UInt32 languageHighBits, UInt32 languageLowBits);
615 
631  OSErr
633 
648  OSErr
650 
651 #if PRAGMA_STRUCT_ALIGN
652 #pragma options align = reset
653 #elif PRAGMA_STRUCT_PACKPUSH
654 #pragma pack(pop)
655 #elif PRAGMA_STRUCT_PACK
656 #pragma pack()
657 #endif
658 
659 #ifdef PRAGMA_IMPORT_OFF
660 #pragma import off
661 #elif PRAGMA_IMPORT
662 #pragma import reset
663 #endif
664 
665 #ifdef __cplusplus
666 }
667 #endif
668 
669 #endif /* __FINDBYCONTENT__ */
File Manager (MFS, HFS, and HFS+) Interfaces.
OSErr FBCDoQuerySearch(FBCSearchSession theSession, char *queryText, const FSSpec targetDirs[], UInt32 numTargets, UInt32 maxHits, UInt32 maxHitWords)
void FBCSetHeapReservation(UInt32 bytes)
OSErr FBCDestroySearchSession(FBCSearchSession theSession)
OSErr FBCDoExampleSearch(FBCSearchSession theSession, const UInt32 *exampleHitNums, UInt32 numExamples, const FSSpec targetDirs[], UInt32 numTargets, UInt32 maxHits, UInt32 maxHitWords)
OSErr FBCDestroyWordList(FBCWordList theList, UInt32 wordCount)
Boolean InvokeFBCCallbackUPP(UInt16 phase, float percentDone, void *data, FBCCallbackUPP userUPP)
OSErr FBCGetTopicWords(FBCSearchSession theSession, UInt32 hitNumber, UInt32 *wordCount, FBCWordList *list)
OSErr FBCIndexItemsInLanguages(FSSpecArrayPtr theItems, UInt32 itemCount, UInt32 languageHighBits, UInt32 languageLowBits)
OSErr FBCCreateSearchSession(FBCSearchSession *searchSession)
OSErr FBCVolumeIndexTimeStamp(SInt16 theVRefNum, UInt32 *timeStamp)
OSErr FBCGetSessionVolumes(FBCSearchSession theSession, SInt16 vRefNums[], UInt16 *numVolumes)
OSErr FBCIndexItems(FSSpecArrayPtr theItems, UInt32 itemCount)
OSErr FBCGetHitDocument(FBCSearchSession theSession, UInt32 hitNumber, FSSpec *theDocument)
typedef CALLBACK_API_C(Boolean, FBCCallbackProcPtr)(UInt16 phase
void DisposeFBCCallbackUPP(FBCCallbackUPP userUPP)
OSErr FBCGetHitScore(FBCSearchSession theSession, UInt32 hitNumber, float *score)
FBCCallbackUPP NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine)
OSErr FBCCloneSearchSession(FBCSearchSession original, FBCSearchSession *clone)
void FBCSetCallback(FBCCallbackUPP fn, void *data)
Boolean FBCVolumeIsIndexed(SInt16 theVRefNum)
OSErr FBCSummarize(void *inBuf, UInt32 inLength, void *outBuf, UInt32 *outLength, UInt32 *numSentences)
OSErr FBCVolumeIndexPhysicalSize(SInt16 theVRefNum, UInt32 *size)
OSErr FBCDoCFStringSearch(FBCSearchSession theSession, CFStringRef queryString, const FSSpec targetDirs[], UInt32 numTargets, UInt32 maxHits, UInt32 maxHitWords)
OSErr FBCFindIndexFileFolderForFolder(FSRef *inFolder, FSRef *outFolder)
OSErr FBCSetSessionVolumes(FBCSearchSession theSession, const SInt16 vRefNums[], UInt16 numVolumes)
struct OpaqueFBCSearchSession * FBCSearchSession
Definition: FindByContent.h:133
OSErr FBCDeleteIndexFileForFolder(const FSRef *folder)
OSErr FBCGetHitCount(FBCSearchSession theSession, UInt32 *count)
OSErr FBCReleaseSessionHits(FBCSearchSession theSession)
OSErr FBCRemoveVolumeFromSession(FBCSearchSession theSession, SInt16 vRefNum)
OSErr FBCGetSessionVolumeCount(FBCSearchSession theSession, UInt16 *count)
OSErr FBCAddAllVolumesToSession(FBCSearchSession theSession, Boolean includeRemote)
Boolean FBCVolumeIsRemote(SInt16 theVRefNum)
OSErr FBCGetMatchedWords(FBCSearchSession theSession, UInt32 hitNumber, UInt32 *wordCount, FBCWordList *list)
OSErr FBCGetHitDocumentRef(FBCSearchSession theSession, UInt32 hitNumber, FSRef *theDocument)
OSErr FBCBlindExampleSearch(FSSpec examples[], UInt32 numExamples, const FSSpec targetDirs[], UInt32 numTargets, UInt32 maxHits, UInt32 maxHitWords, Boolean allIndexes, Boolean includeRemote, FBCSearchSession *theSession)
OSErr FBCAddVolumeToSession(FBCSearchSession theSession, SInt16 vRefNum)
OSErr codes.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Definition: Files.h:6527
Definition: TranslationExtensions.h:114