Source code of Windows XP (NT5)
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.

172 lines
6.6 KiB

  1. // FTSIFACE.h -- DLL interface for FTSrch.dll
  2. // Copyright (c) 1996-1999 Microsoft Corporation
  3. #ifndef __FTSIFACE_H__
  4. #define __FTSIFACE_H__
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif /* __cplusplus */
  11. typedef HANDLE HINDEX;
  12. typedef HANDLE HSEARCHER;
  13. typedef HANDLE HCOMPRESSOR;
  14. typedef HANDLE HHILITER;
  15. typedef INT ERRORCODE;
  16. typedef struct { int base; int limit; } HILITE;
  17. #define NO_TITLE UINT(-1) // ERRORCODE values
  18. #define NOT_INDEXER UINT(-2)
  19. #define NOT_SEARCHER UINT(-3)
  20. #define NOT_COMPRESSOR UINT(-4)
  21. #define CANNOT_SAVE UINT(-5)
  22. #define OUT_OF_MEMORY UINT(-6)
  23. #define CANNOT_OPEN UINT(-7)
  24. #define CANNOT_LOAD UINT(-8)
  25. #define INVALID_INDEX UINT(-9)
  26. #define ALREADY_WEIGHED UINT(-10)
  27. #define NO_TEXT_SCANNED UINT(-11)
  28. #define ALIGNMENT_ERROR UINT(-12)
  29. #define INVALID_PHRASE_TABLE UINT(-13)
  30. #define INVALID_LCID UINT(-14)
  31. #define NO_INDICES_LOADED UINT(-15)
  32. #define INDEX_LOADED_ALREADY UINT(-16)
  33. #define GROUP_LOADED_ALREADY UINT(-17)
  34. #define DIALOG_ALREADY_ACTIVE UINT(-18)
  35. #define EMPTY_PHRASE_TABLE UINT(-19)
  36. #define OUT_OF_DISK UINT(-20)
  37. #define DISK_READ_ERROR UINT(-21)
  38. #define DISK_WRITE_ERROR UINT(-22)
  39. #define SEARCH_ABORTED UINT(-23)
  40. #define UNKNOWN_EXCEPTION UINT(-24)
  41. #define SYSTEM_ERROR UINT(-25)
  42. #define NOT_HILITER UINT(-26)
  43. #define INVALID_CHARSET UINT(-27)
  44. #define INVALID_SOURCE_NAME UINT(-28)
  45. #define INVALID_TIMESTAMP UINT(-29)
  46. #define ERR_NO_DISK_SPACE 0xE0000001 // Values reported by GetLastError
  47. #define ERR_DISK_CREATE_ERROR 0xE0000002 // when an explicit error result
  48. #define ERR_DISK_OPEN_ERROR 0xE0000003 // isn't available.
  49. #define ERR_DISK_READ_ERROR 0xE0000004
  50. #define ERR_DISK_WRITE_ERROR 0xE0000005
  51. #define ERR_SYSTEM_ERROR 0xE0000006
  52. #define ERR_ABORT_SEARCH 0xE0000007
  53. #define ERR_INVALID_TIMESTAMP 0xE0000008
  54. #define ERR_INVALID_SOURCE_NAME 0xE0000009
  55. #define ERR_FILE_MAP_FAILED 0xE000000A
  56. #define ERR_INVALID_FILE_TYPE 0xE000000B
  57. #define ERR_DAMAGED_FILE 0xE000000C
  58. #define ERR_FUTURE_VERSION 0xE000000D
  59. // -------------- Index Construction Interface ---------------------------
  60. #define TOPIC_SEARCH 0x00000001 // Options for NewIndex
  61. #define PHRASE_SEARCH 0x00000002
  62. #define PHRASE_FEEDBACK 0x00000004
  63. #define VECTOR_SEARCH 0x00000008
  64. #define WINHELP_INDEX 0x00000010
  65. #define USE_VA_ADDR 0x00000020
  66. #define USE_QWORD_JUMP 0x00000040
  67. #define USE_DEFAULT UINT(-1) // Surrogate for default charset or default lcid
  68. HINDEX APIENTRY NewIndex(const PBYTE pbSourceName,
  69. UINT uiTime1, UINT uiTime2,
  70. UINT iCharsetDefault, UINT lcidDefault, UINT fdwOptions
  71. );
  72. ERRORCODE APIENTRY ScanTopicTitle(HINDEX hinx, PBYTE pbTitle, UINT cbTitle,
  73. UINT iTopic, HANDLE hTopic, UINT iCharset, UINT lcid
  74. );
  75. ERRORCODE APIENTRY ScanTopicText (HINDEX hinx, PBYTE pbText, UINT cbText, UINT iCharset, UINT lcid);
  76. ERRORCODE APIENTRY SaveIndex (HINDEX hinx, PSZ pszFileName);
  77. ERRORCODE APIENTRY DeleteIndex (HINDEX hinx);
  78. typedef void (__stdcall *ANIMATOR)(void);
  79. ERRORCODE APIENTRY RegisterAnimator(ANIMATOR pAnimator, HWND hwndAnimator);
  80. // ----------------- Querying the Validity of an Index File --------------
  81. BOOL APIENTRY IsValidIndex(PSZ pszFileName, UINT dwOptions);
  82. void APIENTRY SetDirectoryLocator(HWND hwndLocator);
  83. // ----------------- Searcher Interface ----------------------------------
  84. HSEARCHER APIENTRY NewSearcher();
  85. INT APIENTRY OpenIndex(HSEARCHER hsrch, PSZ pszIndexFileName, // returns iIndex for index file
  86. PBYTE pbSourceName, PUINT pcbSourceNameLimit, // or -ErrorCode
  87. PUINT pTime1, PUINT pTime2
  88. );
  89. ERRORCODE APIENTRY DiscardIndex (HSEARCHER hsrch, INT iIndex);
  90. ERRORCODE APIENTRY QueryOptions (HSEARCHER hsrch, INT iIndex, PUINT pfdwOptions);
  91. ERRORCODE APIENTRY SaveGroup (HSEARCHER hsrch, PSZ pszFileName);
  92. ERRORCODE APIENTRY LoadGroup (HSEARCHER hsrch, PSZ pszFileName);
  93. HWND APIENTRY OpenDialog (HSEARCHER hsrch, HWND hwndParent);
  94. ERRORCODE APIENTRY DeleteSearcher(HSEARCHER hsrch);
  95. // Messages for talking to WinHelp
  96. #define MSG_FTS_JUMP_HASH (WM_USER + 32) // wParam = index, lParam = HashValue
  97. #define MSG_FTS_JUMP_VA (WM_USER + 33) // wParam = index, lParam = VirtualAddress
  98. #define MSG_FTS_GET_TITLE (WM_USER + 34) // wParam = index, lParam = &pszTitle
  99. #define MSG_FTS_JUMP_QWORD (WM_USER + 35) // wParam = index, lParam = address of QWordAddress structure
  100. #define MSG_REINDEX_REQUEST (WM_USER + 36) // wParam = unused,lParam = unused
  101. #define MSG_FTS_WHERE_IS_IT (WM_USER + 37) // wParam = fStartEnumeration, lParam = &pszFile
  102. #define MSG_GET_DEFFONT (WM_USER + 45) // return default font handle
  103. typedef struct _QWordAddress
  104. {
  105. UINT iSerial;
  106. HANDLE hTopic;
  107. } QWordAddress, *PQWordAddress;
  108. // ------------------- Phrase Compression Interface ----------------------
  109. HCOMPRESSOR APIENTRY NewCompressor(UINT iCharsetDefault);
  110. ERRORCODE APIENTRY ScanText(HCOMPRESSOR hcmp, PBYTE pbText, UINT cbText, UINT iCharset);
  111. ERRORCODE APIENTRY GetPhraseTable(HCOMPRESSOR hcmp, PUINT pcPhrases, PBYTE *ppbImages, PUINT pcbImages,
  112. PBYTE *ppacbImageCompressed, PUINT pcbCompressed
  113. );
  114. ERRORCODE APIENTRY SetPhraseTable(HCOMPRESSOR hcmp, PBYTE pbImages, UINT cbImages,
  115. PBYTE pacbImageCompressed, UINT cbCompressed
  116. );
  117. INT APIENTRY CompressText (HCOMPRESSOR hcmp, PBYTE pbText, UINT cbText, PBYTE *ppbCompressed, UINT iCharset);
  118. INT APIENTRY DecompressText(HCOMPRESSOR hcmp, PBYTE pbCompressed, UINT cbCompressed, PBYTE pbText );
  119. ERRORCODE APIENTRY DeleteCompressor(HCOMPRESSOR hcmp);
  120. //----------------------- Hiliting Interface ------------------------------
  121. HHILITER APIENTRY NewHiliter(HSEARCHER hSearch);
  122. ERRORCODE APIENTRY DeleteHiliter(HHILITER hhil);
  123. ERRORCODE APIENTRY ScanDisplayText(HHILITER hhil, PBYTE pbText, int cbText,
  124. UINT iCharset, LCID lcid);
  125. ERRORCODE APIENTRY ClearDisplayText(HHILITER hhil);
  126. int APIENTRY CountHilites(HHILITER hhil, int base, int limit);
  127. int APIENTRY QueryHilites(HHILITER hhil, int base, int limit,
  128. int cHilites, HILITE* paHilites);
  129. #ifdef __cplusplus
  130. }
  131. #endif /* __cplusplus */
  132. #endif // __FTSIFACE_H__