Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1052 lines
30 KiB

  1. /*
  2. File: FindByContent.h
  3. Contains: Public search interface for the Find by Content shared library
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1997-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __FINDBYCONTENT__
  11. #define __FINDBYCONTENT__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18. #ifndef __MACERRORS__
  19. #include <MacErrors.h>
  20. #endif
  21. #ifndef __CFSTRING__
  22. #include <CFString.h>
  23. #endif
  24. #if PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #if PRAGMA_IMPORT
  31. #pragma import on
  32. #endif
  33. #if PRAGMA_STRUCT_ALIGN
  34. #pragma options align=mac68k
  35. #elif PRAGMA_STRUCT_PACKPUSH
  36. #pragma pack(push, 2)
  37. #elif PRAGMA_STRUCT_PACK
  38. #pragma pack(2)
  39. #endif
  40. /*
  41. ***************************************************************************
  42. Language constants used with FBCIndexItemsInLanguages: these numbers are bits
  43. in a 64-bit array that consists of two UInt32 words. In the current implementation
  44. the low word is always 0, so values for the high word are given. If both UInt32
  45. words are 0, the default value of kDefaultLanguagesHighWord is used.
  46. ***************************************************************************
  47. */
  48. /* These are the new names for the language constants*/
  49. enum {
  50. /* languages that use the Roman character mapping*/
  51. kFBCenglishHighWord = (long)0x80000000,
  52. kFBCdutchHighWord = 0x40000000, /* also Afrikaans*/
  53. kFBCgermanHighWord = 0x20000000,
  54. kFBCswedishHighWord = 0x10000000, /* also Norwegian*/
  55. kFBCdanishHighWord = 0x08000000,
  56. kFBCspanishHighWord = 0x04000000, /* also Catalan*/
  57. kFBCportugueseHighWord = 0x02000000,
  58. kFBCitalianHighWord = 0x01000000,
  59. kFBCfrenchHighWord = 0x00800000,
  60. kFBCromanHighWord = 0x00400000, /* other languages using Roman alphabet*/
  61. /* Languages that use other mappings*/
  62. kFBCicelandicHighWord = 0x00200000, /* also Faroese*/
  63. kFBChebrewHighWord = 0x00100000, /* also Yiddish*/
  64. kFBCarabicHighWord = 0x00080000, /* also Farsi, Urdu*/
  65. kFBCcenteuroHighWord = 0x00040000, /* Central European languages not using Cyrillic*/
  66. kFBCcroatianHighWord = 0x00020000,
  67. kFBCturkishHighWord = 0x00010000,
  68. kFBCromanianHighWord = 0x00008000,
  69. kFBCgreekHighWord = 0x00004000,
  70. kFBCcyrillicHighWord = 0x00002000, /* all languages using Cyrillic*/
  71. kFBCdevanagariHighWord = 0x00001000,
  72. kFBCgujuratiHighWord = 0x00000800,
  73. kFBCgurmukhiHighWord = 0x00000400,
  74. kFBCjapaneseHighWord = 0x00000200,
  75. kFBCkoreanHighWord = 0x00000100,
  76. kFBCdefaultLanguagesHighWord = (long)0xFF800000 /* sum of first 9*/
  77. };
  78. /*A new error, needs to be moved to MacErrors.h*/
  79. enum {
  80. kFBCnotAllFoldersSearchable = -30533
  81. };
  82. /*
  83. ***************************************************************************
  84. Phase values
  85. These values are passed to the client's callback function to indicate what
  86. the FBC code is doing. They are meaningless in OS X.
  87. ***************************************************************************
  88. */
  89. enum {
  90. /* indexing phases*/
  91. kFBCphIndexing = 0,
  92. kFBCphFlushing = 1,
  93. kFBCphMerging = 2,
  94. kFBCphMakingIndexAccessor = 3,
  95. kFBCphCompacting = 4,
  96. kFBCphIndexWaiting = 5, /* access phases*/
  97. kFBCphSearching = 6,
  98. kFBCphMakingAccessAccessor = 7,
  99. kFBCphAccessWaiting = 8, /* summarization*/
  100. kFBCphSummarizing = 9, /* indexing or access*/
  101. kFBCphIdle = 10,
  102. kFBCphCanceling = 11
  103. };
  104. enum {
  105. kFBCsummarizationFailed = -30533
  106. };
  107. /*
  108. ***************************************************************************
  109. Pointer types
  110. These point to memory allocated by the FBC shared library, and must be deallocated
  111. by calls that are defined below.
  112. ***************************************************************************
  113. */
  114. /* A collection of state information for searching*/
  115. typedef struct OpaqueFBCSearchSession* FBCSearchSession;
  116. /* An object containing summary information, from which summary text can be obtained*/
  117. typedef struct OpaqueFBCSummaryRef* FBCSummaryRef;
  118. /* An ordinary C string (used for hit/doc terms)*/
  119. typedef char * FBCWordItem;
  120. /* An array of WordItems*/
  121. typedef FBCWordItem * FBCWordList;
  122. /*
  123. ***************************************************************************
  124. Callback function type for progress reporting and cancelation during
  125. searching and indexing. The client's callback function should call
  126. WaitNextEvent; a "sleep" value of 1 is suggested. If the callback function
  127. wants to cancel the current operation (indexing, search, or doc-terms
  128. retrieval) it should return true.
  129. ***************************************************************************
  130. */
  131. typedef CALLBACK_API_C( Boolean , FBCCallbackProcPtr )(UInt16 phase, float percentDone, void *data);
  132. typedef TVECTOR_UPP_TYPE(FBCCallbackProcPtr) FBCCallbackUPP;
  133. /*
  134. * NewFBCCallbackUPP()
  135. *
  136. * Availability:
  137. * Non-Carbon CFM: available as macro/inline
  138. * CarbonLib: in CarbonLib 1.0.2 and later
  139. * Mac OS X: in version 10.0 and later
  140. */
  141. EXTERN_API_C( FBCCallbackUPP )
  142. NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine);
  143. #if !OPAQUE_UPP_TYPES
  144. enum { uppFBCCallbackProcInfo = 0x00000F91 }; /* 1_byte Func(2_bytes, 4_bytes, 4_bytes) */
  145. #ifdef __cplusplus
  146. inline DEFINE_API_C(FBCCallbackUPP) NewFBCCallbackUPP(FBCCallbackProcPtr userRoutine) { return userRoutine; }
  147. #else
  148. #define NewFBCCallbackUPP(userRoutine) (userRoutine)
  149. #endif
  150. #endif
  151. /*
  152. * DisposeFBCCallbackUPP()
  153. *
  154. * Availability:
  155. * Non-Carbon CFM: available as macro/inline
  156. * CarbonLib: in CarbonLib 1.0.2 and later
  157. * Mac OS X: in version 10.0 and later
  158. */
  159. EXTERN_API_C( void )
  160. DisposeFBCCallbackUPP(FBCCallbackUPP userUPP);
  161. #if !OPAQUE_UPP_TYPES
  162. #ifdef __cplusplus
  163. inline DEFINE_API_C(void) DisposeFBCCallbackUPP(FBCCallbackUPP) {}
  164. #else
  165. #define DisposeFBCCallbackUPP(userUPP)
  166. #endif
  167. #endif
  168. /*
  169. * InvokeFBCCallbackUPP()
  170. *
  171. * Availability:
  172. * Non-Carbon CFM: available as macro/inline
  173. * CarbonLib: in CarbonLib 1.0.2 and later
  174. * Mac OS X: in version 10.0 and later
  175. */
  176. EXTERN_API_C( Boolean )
  177. InvokeFBCCallbackUPP(
  178. UInt16 phase,
  179. float percentDone,
  180. void * data,
  181. FBCCallbackUPP userUPP);
  182. #if !OPAQUE_UPP_TYPES
  183. #ifdef __cplusplus
  184. inline DEFINE_API_C(Boolean) InvokeFBCCallbackUPP(UInt16 phase, float percentDone, void * data, FBCCallbackUPP userUPP) { return (*userUPP)(phase, percentDone, data); }
  185. #else
  186. #define InvokeFBCCallbackUPP(phase, percentDone, data, userUPP) (*userUPP)(phase, percentDone, data)
  187. #endif
  188. #endif
  189. /*
  190. ***************************************************************************
  191. Set the callback function for progress reporting and cancelation during
  192. searching and indexing.
  193. ***************************************************************************
  194. */
  195. /*
  196. * FBCSetSessionCallback()
  197. *
  198. * Availability:
  199. * Non-Carbon CFM: not available
  200. * CarbonLib: not available
  201. * Mac OS X: in version 10.2 and later
  202. */
  203. EXTERN_API_C( void )
  204. FBCSetSessionCallback(
  205. FBCSearchSession searchSession,
  206. FBCCallbackUPP fn,
  207. void * data);
  208. /* OS X DEPRECATED, use FBCSetSessionCallback*/
  209. /*
  210. * FBCSetCallback()
  211. *
  212. * Availability:
  213. * Non-Carbon CFM: in FindByContent 8.5 and later
  214. * CarbonLib: in CarbonLib 1.0 and later
  215. * Mac OS X: in version 10.0 and later
  216. */
  217. EXTERN_API_C( void )
  218. FBCSetCallback(
  219. FBCCallbackUPP fn,
  220. void * data);
  221. /*
  222. ***************************************************************************
  223. Callback function type for hit testing during searching
  224. ***************************************************************************
  225. */
  226. typedef CALLBACK_API_C( Boolean , FBCHitTestProcPtr )(const FSRef *theFile, void *data);
  227. typedef TVECTOR_UPP_TYPE(FBCHitTestProcPtr) FBCHitTestUPP;
  228. #if CALL_NOT_IN_CARBON
  229. /*
  230. * NewFBCHitTestUPP()
  231. *
  232. * Availability:
  233. * Non-Carbon CFM: available as macro/inline
  234. * CarbonLib: not available
  235. * Mac OS X: in version 10.2 and later
  236. */
  237. EXTERN_API_C( FBCHitTestUPP )
  238. NewFBCHitTestUPP(FBCHitTestProcPtr userRoutine);
  239. #if !OPAQUE_UPP_TYPES
  240. enum { uppFBCHitTestProcInfo = 0x000003D1 }; /* 1_byte Func(4_bytes, 4_bytes) */
  241. #ifdef __cplusplus
  242. inline DEFINE_API_C(FBCHitTestUPP) NewFBCHitTestUPP(FBCHitTestProcPtr userRoutine) { return userRoutine; }
  243. #else
  244. #define NewFBCHitTestUPP(userRoutine) (userRoutine)
  245. #endif
  246. #endif
  247. /*
  248. * DisposeFBCHitTestUPP()
  249. *
  250. * Availability:
  251. * Non-Carbon CFM: available as macro/inline
  252. * CarbonLib: not available
  253. * Mac OS X: in version 10.2 and later
  254. */
  255. EXTERN_API_C( void )
  256. DisposeFBCHitTestUPP(FBCHitTestUPP userUPP);
  257. #if !OPAQUE_UPP_TYPES
  258. #ifdef __cplusplus
  259. inline DEFINE_API_C(void) DisposeFBCHitTestUPP(FBCHitTestUPP) {}
  260. #else
  261. #define DisposeFBCHitTestUPP(userUPP)
  262. #endif
  263. #endif
  264. /*
  265. * InvokeFBCHitTestUPP()
  266. *
  267. * Availability:
  268. * Non-Carbon CFM: available as macro/inline
  269. * CarbonLib: not available
  270. * Mac OS X: in version 10.2 and later
  271. */
  272. EXTERN_API_C( Boolean )
  273. InvokeFBCHitTestUPP(
  274. const FSRef * theFile,
  275. void * data,
  276. FBCHitTestUPP userUPP);
  277. #if !OPAQUE_UPP_TYPES
  278. #ifdef __cplusplus
  279. inline DEFINE_API_C(Boolean) InvokeFBCHitTestUPP(const FSRef * theFile, void * data, FBCHitTestUPP userUPP) { return (*userUPP)(theFile, data); }
  280. #else
  281. #define InvokeFBCHitTestUPP(theFile, data, userUPP) (*userUPP)(theFile, data)
  282. #endif
  283. #endif
  284. #endif /* CALL_NOT_IN_CARBON */
  285. /*
  286. ***************************************************************************
  287. Set the hit-testing function for searches.
  288. ***************************************************************************
  289. */
  290. /*
  291. * FBCSetSessionHitTest()
  292. *
  293. * Availability:
  294. * Non-Carbon CFM: in FindByContent 8.5 and later
  295. * CarbonLib: not available
  296. * Mac OS X: in version 10.2 and later
  297. */
  298. EXTERN_API_C( void )
  299. FBCSetSessionHitTest(
  300. FBCSearchSession theSession,
  301. FBCHitTestUPP fn,
  302. void * data);
  303. /*
  304. ***************************************************************************
  305. Set the amount of heap space to reserve for the client's use when FBC
  306. allocates memory.
  307. ***************************************************************************
  308. */
  309. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  310. /*
  311. * FBCSetHeapReservation()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: in FindByContent 8.5 and later
  315. * CarbonLib: in CarbonLib 1.0 and later
  316. * Mac OS X: in version 10.0 and later
  317. */
  318. EXTERN_API_C( void )
  319. FBCSetHeapReservation(UInt32 bytes);
  320. /*
  321. ***************************************************************************
  322. Find out whether a volume is indexed.
  323. ***************************************************************************
  324. */
  325. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  326. /*
  327. * FBCVolumeIsIndexed()
  328. *
  329. * Availability:
  330. * Non-Carbon CFM: in FindByContent 8.5 and later
  331. * CarbonLib: in CarbonLib 1.0 and later
  332. * Mac OS X: in version 10.0 and later
  333. */
  334. EXTERN_API_C( Boolean )
  335. FBCVolumeIsIndexed(SInt16 theVRefNum);
  336. /*
  337. ***************************************************************************
  338. Find out whether a volume is remote.
  339. ***************************************************************************
  340. */
  341. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  342. /*
  343. * FBCVolumeIsRemote()
  344. *
  345. * Availability:
  346. * Non-Carbon CFM: in FindByContent 8.5 and later
  347. * CarbonLib: in CarbonLib 1.0 and later
  348. * Mac OS X: in version 10.0 and later
  349. */
  350. EXTERN_API_C( Boolean )
  351. FBCVolumeIsRemote(SInt16 theVRefNum);
  352. /*
  353. ***************************************************************************
  354. Find out the date & time of an index's last completed update.
  355. ***************************************************************************
  356. */
  357. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  358. /*
  359. * FBCVolumeIndexTimeStamp()
  360. *
  361. * Availability:
  362. * Non-Carbon CFM: in FindByContent 8.5 and later
  363. * CarbonLib: in CarbonLib 1.0 and later
  364. * Mac OS X: in version 10.0 and later
  365. */
  366. EXTERN_API_C( OSErr )
  367. FBCVolumeIndexTimeStamp(
  368. SInt16 theVRefNum,
  369. UInt32 * timeStamp);
  370. /*
  371. ***************************************************************************
  372. Find out the physical size of an index.
  373. ***************************************************************************
  374. */
  375. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  376. /*
  377. * FBCVolumeIndexPhysicalSize()
  378. *
  379. * Availability:
  380. * Non-Carbon CFM: in FindByContent 8.5 and later
  381. * CarbonLib: in CarbonLib 1.0 and later
  382. * Mac OS X: in version 10.0 and later
  383. */
  384. EXTERN_API_C( OSErr )
  385. FBCVolumeIndexPhysicalSize(
  386. SInt16 theVRefNum,
  387. UInt32 * size);
  388. /*
  389. ***************************************************************************
  390. Create & configure a search session
  391. ***************************************************************************
  392. */
  393. /*
  394. * FBCCreateSearchSession()
  395. *
  396. * Availability:
  397. * Non-Carbon CFM: in FindByContent 8.5 and later
  398. * CarbonLib: in CarbonLib 1.0 and later
  399. * Mac OS X: in version 10.0 and later
  400. */
  401. EXTERN_API_C( OSErr )
  402. FBCCreateSearchSession(FBCSearchSession * searchSession);
  403. /*
  404. * FBCCloneSearchSession()
  405. *
  406. * Availability:
  407. * Non-Carbon CFM: in FindByContent 8.5 and later
  408. * CarbonLib: in CarbonLib 1.0 and later
  409. * Mac OS X: in version 10.0 and later
  410. */
  411. EXTERN_API_C( OSErr )
  412. FBCCloneSearchSession(
  413. FBCSearchSession original,
  414. FBCSearchSession * clone);
  415. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  416. /*
  417. * FBCAddAllVolumesToSession()
  418. *
  419. * Availability:
  420. * Non-Carbon CFM: in FindByContent 8.5 and later
  421. * CarbonLib: in CarbonLib 1.0 and later
  422. * Mac OS X: in version 10.0 and later
  423. */
  424. EXTERN_API_C( OSErr )
  425. FBCAddAllVolumesToSession(
  426. FBCSearchSession theSession,
  427. Boolean includeRemote);
  428. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  429. /*
  430. * FBCSetSessionVolumes()
  431. *
  432. * Availability:
  433. * Non-Carbon CFM: in FindByContent 8.5 and later
  434. * CarbonLib: in CarbonLib 1.0 and later
  435. * Mac OS X: in version 10.0 and later
  436. */
  437. EXTERN_API_C( OSErr )
  438. FBCSetSessionVolumes(
  439. FBCSearchSession theSession,
  440. const SInt16 vRefNums[],
  441. UInt16 numVolumes);
  442. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  443. /*
  444. * FBCAddVolumeToSession()
  445. *
  446. * Availability:
  447. * Non-Carbon CFM: in FindByContent 8.5 and later
  448. * CarbonLib: in CarbonLib 1.0 and later
  449. * Mac OS X: in version 10.0 and later
  450. */
  451. EXTERN_API_C( OSErr )
  452. FBCAddVolumeToSession(
  453. FBCSearchSession theSession,
  454. SInt16 vRefNum);
  455. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  456. /*
  457. * FBCRemoveVolumeFromSession()
  458. *
  459. * Availability:
  460. * Non-Carbon CFM: in FindByContent 8.5 and later
  461. * CarbonLib: in CarbonLib 1.0 and later
  462. * Mac OS X: in version 10.0 and later
  463. */
  464. EXTERN_API_C( OSErr )
  465. FBCRemoveVolumeFromSession(
  466. FBCSearchSession theSession,
  467. SInt16 vRefNum);
  468. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  469. /*
  470. * FBCGetSessionVolumeCount()
  471. *
  472. * Availability:
  473. * Non-Carbon CFM: in FindByContent 8.5 and later
  474. * CarbonLib: in CarbonLib 1.0 and later
  475. * Mac OS X: in version 10.0 and later
  476. */
  477. EXTERN_API_C( OSErr )
  478. FBCGetSessionVolumeCount(
  479. FBCSearchSession theSession,
  480. UInt16 * count);
  481. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  482. /*
  483. * FBCGetSessionVolumes()
  484. *
  485. * Availability:
  486. * Non-Carbon CFM: in FindByContent 8.5 and later
  487. * CarbonLib: in CarbonLib 1.0 and later
  488. * Mac OS X: in version 10.0 and later
  489. */
  490. EXTERN_API_C( OSErr )
  491. FBCGetSessionVolumes(
  492. FBCSearchSession theSession,
  493. SInt16 vRefNums[],
  494. UInt16 * numVolumes);
  495. /*
  496. ***************************************************************************
  497. Execute a search
  498. ***************************************************************************
  499. */
  500. /*
  501. * FBCDoQuerySearch()
  502. *
  503. * Availability:
  504. * Non-Carbon CFM: in FindByContent 8.5 and later
  505. * CarbonLib: in CarbonLib 1.0 and later
  506. * Mac OS X: in version 10.0 and later
  507. */
  508. EXTERN_API_C( OSErr )
  509. FBCDoQuerySearch(
  510. FBCSearchSession theSession,
  511. char * queryText,
  512. const FSSpec targetDirs[],
  513. UInt32 numTargets,
  514. UInt32 maxHits,
  515. UInt32 maxHitWords);
  516. /*
  517. * FBCDoCFStringSearch()
  518. *
  519. * Availability:
  520. * Non-Carbon CFM: not available
  521. * CarbonLib: not available in CarbonLib 1.x
  522. * Mac OS X: in version 10.0 and later
  523. */
  524. EXTERN_API_C( OSErr )
  525. FBCDoCFStringSearch(
  526. FBCSearchSession theSession,
  527. CFStringRef queryString,
  528. const FSSpec targetDirs[],
  529. UInt32 numTargets,
  530. UInt32 maxHits,
  531. UInt32 maxHitWords);
  532. /*
  533. * FBCDoExampleSearch()
  534. *
  535. * Availability:
  536. * Non-Carbon CFM: in FindByContent 8.5 and later
  537. * CarbonLib: in CarbonLib 1.0 and later
  538. * Mac OS X: in version 10.0 and later
  539. */
  540. EXTERN_API_C( OSErr )
  541. FBCDoExampleSearch(
  542. FBCSearchSession theSession,
  543. const UInt32 * exampleHitNums,
  544. UInt32 numExamples,
  545. const FSSpec targetDirs[],
  546. UInt32 numTargets,
  547. UInt32 maxHits,
  548. UInt32 maxHitWords);
  549. /* OS X DEPRECATED, use FBCBlindExampleSearchWithCallback to be able to cancel*/
  550. /*
  551. * FBCBlindExampleSearch()
  552. *
  553. * Availability:
  554. * Non-Carbon CFM: in FindByContent 8.5 and later
  555. * CarbonLib: in CarbonLib 1.0 and later
  556. * Mac OS X: in version 10.0 and later
  557. */
  558. EXTERN_API_C( OSErr )
  559. FBCBlindExampleSearch(
  560. const FSSpec examples[],
  561. UInt32 numExamples,
  562. const FSSpec targetDirs[],
  563. UInt32 numTargets,
  564. UInt32 maxHits,
  565. UInt32 maxHitWords,
  566. Boolean allIndexes,
  567. Boolean includeRemote,
  568. FBCSearchSession * theSession);
  569. /*
  570. * FBCBlindExampleSearchWithCallback()
  571. *
  572. * Availability:
  573. * Non-Carbon CFM: not available
  574. * CarbonLib: not available
  575. * Mac OS X: in version 10.2 and later
  576. */
  577. EXTERN_API_C( OSErr )
  578. FBCBlindExampleSearchWithCallback(
  579. const FSSpec examples[],
  580. UInt32 numExamples,
  581. const FSSpec targetDirs[],
  582. UInt32 numTargets,
  583. UInt32 maxHits,
  584. UInt32 maxHitWords,
  585. Boolean allIndexes,
  586. Boolean includeRemote,
  587. FBCSearchSession * theSession,
  588. FBCCallbackUPP callback,
  589. void * callbackData,
  590. FBCHitTestUPP userHitTest,
  591. void * userHitTestData);
  592. /*
  593. ***************************************************************************
  594. Get information about hits [wrapper for THitItem C++ API]
  595. ***************************************************************************
  596. */
  597. /*
  598. * FBCGetHitCount()
  599. *
  600. * Availability:
  601. * Non-Carbon CFM: in FindByContent 8.5 and later
  602. * CarbonLib: in CarbonLib 1.0 and later
  603. * Mac OS X: in version 10.0 and later
  604. */
  605. EXTERN_API_C( OSErr )
  606. FBCGetHitCount(
  607. FBCSearchSession theSession,
  608. UInt32 * count);
  609. /*
  610. * FBCGetHitDocument()
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: in FindByContent 8.5 and later
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Mac OS X: in version 10.0 and later
  616. */
  617. EXTERN_API_C( OSErr )
  618. FBCGetHitDocument(
  619. FBCSearchSession theSession,
  620. UInt32 hitNumber,
  621. FSSpec * theDocument);
  622. /*
  623. * FBCGetHitDocumentRef()
  624. *
  625. * Availability:
  626. * Non-Carbon CFM: not available
  627. * CarbonLib: not available in CarbonLib 1.x
  628. * Mac OS X: in version 10.0 and later
  629. */
  630. EXTERN_API_C( OSErr )
  631. FBCGetHitDocumentRef(
  632. FBCSearchSession theSession,
  633. UInt32 hitNumber,
  634. FSRef * theDocument);
  635. /*
  636. * FBCGetHitScore()
  637. *
  638. * Availability:
  639. * Non-Carbon CFM: in FindByContent 8.5 and later
  640. * CarbonLib: in CarbonLib 1.0 and later
  641. * Mac OS X: in version 10.0 and later
  642. */
  643. EXTERN_API_C( OSErr )
  644. FBCGetHitScore(
  645. FBCSearchSession theSession,
  646. UInt32 hitNumber,
  647. float * score);
  648. /*
  649. ***************************************************************************
  650. Summarize text
  651. ***************************************************************************
  652. */
  653. /*
  654. * FBCSummarize()
  655. *
  656. * Availability:
  657. * Non-Carbon CFM: in FindByContent 8.5 and later
  658. * CarbonLib: in CarbonLib 1.0 and later
  659. * Mac OS X: in version 10.0 and later
  660. */
  661. EXTERN_API_C( OSErr )
  662. FBCSummarize(
  663. const void * inBuf,
  664. UInt32 inLength,
  665. void * outBuf,
  666. UInt32 * outLength,
  667. UInt32 * numSentences);
  668. /*
  669. * FBCSummarizeCFString()
  670. *
  671. * Availability:
  672. * Non-Carbon CFM: not available
  673. * CarbonLib: not available
  674. * Mac OS X: in version 10.2 and later
  675. */
  676. EXTERN_API_C( OSStatus )
  677. FBCSummarizeCFString(
  678. CFStringRef inString,
  679. CFStringRef * outString,
  680. UInt32 * numSentences);
  681. /*
  682. * FBCGetSummaryOfCFString()
  683. *
  684. * Availability:
  685. * Non-Carbon CFM: not available
  686. * CarbonLib: not available
  687. * Mac OS X: in version 10.2 and later
  688. */
  689. EXTERN_API_C( OSStatus )
  690. FBCGetSummaryOfCFString(
  691. CFStringRef inString,
  692. FBCSummaryRef * summary);
  693. /*
  694. * FBCGetSummarySentenceCount()
  695. *
  696. * Availability:
  697. * Non-Carbon CFM: not available
  698. * CarbonLib: not available
  699. * Mac OS X: in version 10.2 and later
  700. */
  701. EXTERN_API_C( OSStatus )
  702. FBCGetSummarySentenceCount(
  703. FBCSummaryRef summary,
  704. UInt32 * numSentences);
  705. /*
  706. * FBCGetSummarySentences()
  707. *
  708. * Availability:
  709. * Non-Carbon CFM: not available
  710. * CarbonLib: not available
  711. * Mac OS X: in version 10.2 and later
  712. */
  713. EXTERN_API_C( OSStatus )
  714. FBCGetSummarySentences(
  715. FBCSummaryRef summary,
  716. CFStringRef * outString,
  717. UInt32 * numSentences,
  718. Boolean paragraphs);
  719. /*
  720. * FBCDisposeSummary()
  721. *
  722. * Availability:
  723. * Non-Carbon CFM: not available
  724. * CarbonLib: not available
  725. * Mac OS X: in version 10.2 and later
  726. */
  727. EXTERN_API_C( OSStatus )
  728. FBCDisposeSummary(FBCSummaryRef summary);
  729. /*
  730. ***************************************************************************
  731. Deallocate hit lists and search sessions
  732. ***************************************************************************
  733. */
  734. /*
  735. * FBCReleaseSessionHits()
  736. *
  737. * Availability:
  738. * Non-Carbon CFM: in FindByContent 8.5 and later
  739. * CarbonLib: in CarbonLib 1.0 and later
  740. * Mac OS X: in version 10.0 and later
  741. */
  742. EXTERN_API_C( OSErr )
  743. FBCReleaseSessionHits(FBCSearchSession theSession);
  744. /*
  745. * FBCDestroySearchSession()
  746. *
  747. * Availability:
  748. * Non-Carbon CFM: in FindByContent 8.5 and later
  749. * CarbonLib: in CarbonLib 1.0 and later
  750. * Mac OS X: in version 10.0 and later
  751. */
  752. EXTERN_API_C( OSErr )
  753. FBCDestroySearchSession(FBCSearchSession theSession);
  754. /*
  755. ***************************************************************************
  756. Index one or more files and/or folders
  757. ***************************************************************************
  758. */
  759. /* OS X DEPRECATED (will be removed from OS X exports in a future release)*/
  760. /*
  761. * FBCIndexItems()
  762. *
  763. * Availability:
  764. * Non-Carbon CFM: in FindByContent 9.0 and later
  765. * CarbonLib: not available in CarbonLib 1.x
  766. * Mac OS X: in version 10.0 and later
  767. */
  768. EXTERN_API_C( OSErr )
  769. FBCIndexItems(
  770. FSSpecArrayPtr theItems,
  771. UInt32 itemCount);
  772. /*
  773. * FBCIndexItemsInLanguages()
  774. *
  775. * Availability:
  776. * Non-Carbon CFM: not available
  777. * CarbonLib: not available in CarbonLib 1.x
  778. * Mac OS X: in version 10.0 and later
  779. */
  780. EXTERN_API_C( OSErr )
  781. FBCIndexItemsInLanguages(
  782. FSSpecArrayPtr theItems,
  783. UInt32 itemCount,
  784. UInt32 languageHighBits,
  785. UInt32 languageLowBits);
  786. /*
  787. ***************************************************************************
  788. (OS X only) Given a folder, find the folder that contains the index file
  789. of the given index
  790. ***************************************************************************
  791. */
  792. /*
  793. * FBCFindIndexFileFolderForFolder()
  794. *
  795. * Availability:
  796. * Non-Carbon CFM: not available
  797. * CarbonLib: not available in CarbonLib 1.x
  798. * Mac OS X: in version 10.0 and later
  799. */
  800. EXTERN_API_C( OSErr )
  801. FBCFindIndexFileFolderForFolder(
  802. const FSRef * inFolder,
  803. FSRef * outFolder);
  804. /*
  805. ***************************************************************************
  806. (OS X only) Given a folder, delete the index file that indexes it
  807. ***************************************************************************
  808. */
  809. /*
  810. * FBCDeleteIndexFileForFolder()
  811. *
  812. * Availability:
  813. * Non-Carbon CFM: not available
  814. * CarbonLib: not available in CarbonLib 1.x
  815. * Mac OS X: in version 10.0 and later
  816. */
  817. EXTERN_API_C( OSErr )
  818. FBCDeleteIndexFileForFolder(const FSRef * folder);
  819. /*
  820. ***************************************************************************
  821. The following are deprecated and obsolete for both OS X and OS 9
  822. ***************************************************************************
  823. */
  824. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  825. /*
  826. * FBCGetMatchedWords()
  827. *
  828. * Availability:
  829. * Non-Carbon CFM: in FindByContent 8.5 and later
  830. * CarbonLib: in CarbonLib 1.0 and later
  831. * Mac OS X: in version 10.0 and later
  832. */
  833. EXTERN_API_C( OSErr )
  834. FBCGetMatchedWords(
  835. FBCSearchSession theSession,
  836. UInt32 hitNumber,
  837. UInt32 * wordCount,
  838. FBCWordList * list);
  839. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  840. /*
  841. * FBCGetTopicWords()
  842. *
  843. * Availability:
  844. * Non-Carbon CFM: in FindByContent 8.5 and later
  845. * CarbonLib: in CarbonLib 1.0 and later
  846. * Mac OS X: in version 10.0 and later
  847. */
  848. EXTERN_API_C( OSErr )
  849. FBCGetTopicWords(
  850. FBCSearchSession theSession,
  851. UInt32 hitNumber,
  852. UInt32 * wordCount,
  853. FBCWordList * list);
  854. /* OS X DEPRECATED, NO-OP (will be removed from OS X exports in a future release)*/
  855. /*
  856. * FBCDestroyWordList()
  857. *
  858. * Availability:
  859. * Non-Carbon CFM: in FindByContent 8.5 and later
  860. * CarbonLib: in CarbonLib 1.0 and later
  861. * Mac OS X: in version 10.0 and later
  862. */
  863. EXTERN_API_C( OSErr )
  864. FBCDestroyWordList(
  865. FBCWordList theList,
  866. UInt32 wordCount);
  867. /* These names are deprecated, use the new ones above*/
  868. enum {
  869. /* languages that use the Roman character mapping*/
  870. englishHighWord = kFBCenglishHighWord,
  871. dutchHighWord = kFBCdutchHighWord, /* also Afrikaans*/
  872. germanHighWord = kFBCgermanHighWord,
  873. swedishHighWord = kFBCswedishHighWord, /* also Norwegian*/
  874. danishHighWord = kFBCdanishHighWord,
  875. spanishHighWord = kFBCspanishHighWord, /* also Catalan*/
  876. portugueseHighWord = kFBCportugueseHighWord,
  877. italianHighWord = kFBCitalianHighWord,
  878. frenchHighWord = kFBCfrenchHighWord,
  879. romanHighWord = kFBCromanHighWord, /* other languages using Roman alphabet*/
  880. /* Languages that use other mappings*/
  881. icelandicHighWord = kFBCicelandicHighWord, /* also Faroese*/
  882. hebrewHighWord = kFBChebrewHighWord, /* also Yiddish*/
  883. arabicHighWord = kFBCarabicHighWord, /* also Farsi, Urdu*/
  884. centeuroHighWord = kFBCcenteuroHighWord, /* Central European languages not using Cyrillic*/
  885. croatianHighWord = kFBCcroatianHighWord,
  886. turkishHighWord = kFBCturkishHighWord,
  887. romanianHighWord = kFBCromanianHighWord,
  888. greekHighWord = kFBCgreekHighWord,
  889. cyrillicHighWord = kFBCcyrillicHighWord, /* all languages using Cyrillic*/
  890. devanagariHighWord = kFBCdevanagariHighWord,
  891. gujuratiHighWord = kFBCgujuratiHighWord,
  892. gurmukhiHighWord = kFBCgurmukhiHighWord,
  893. japaneseHighWord = kFBCjapaneseHighWord,
  894. koreanHighWord = kFBCkoreanHighWord,
  895. kDefaultLanguagesHighWord = kFBCdefaultLanguagesHighWord /* sum of first 9*/
  896. };
  897. #if PRAGMA_STRUCT_ALIGN
  898. #pragma options align=reset
  899. #elif PRAGMA_STRUCT_PACKPUSH
  900. #pragma pack(pop)
  901. #elif PRAGMA_STRUCT_PACK
  902. #pragma pack()
  903. #endif
  904. #ifdef PRAGMA_IMPORT_OFF
  905. #pragma import off
  906. #elif PRAGMA_IMPORT
  907. #pragma import reset
  908. #endif
  909. #ifdef __cplusplus
  910. }
  911. #endif
  912. #endif /* __FINDBYCONTENT__ */