home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / FTSIFACE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  6.7 KB  |  170 lines

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