home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / ftsiface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  6.8 KB  |  175 lines

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