home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ftsiface.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  7KB  |  168 lines

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