#ifndef _FS_FULLTEXTSEARCH_C_H_
#define _FS_FULLTEXTSEARCH_C_H_

#ifdef __cplusplus
extern "C" {
#endif



typedef enum _FSRankMode {
e_FSRankNone = 0,
e_FSRankHitCountASC = 1,
e_FSRankHitCountDESC = 2,
}FSRankMode;


typedef struct _FSSearchCallback {
  void* user_data;
  void (*Release)(void* user_data);
  int (*RetrieveSearchResult)(void* user_data, const wchar_t* file_path, int page_index, const wchar_t*match_result,
                                   int match_start_text_index, int match_end_text_index, const wchar_t*sentence,
                                   int match_sentence_start_text_index, int match_sentence_end_text_index);
  
}FSSearchCallback;

FSErrorCode FSDK_DocumentsSource_Create(const char* directory, FS_DOCUMENTSSOURCE_HANDLE* documentssource_return_value);
FSErrorCode FSDK_DocumentsSource_Release(FS_DOCUMENTSSOURCE_HANDLE documentssource_handle);
FSErrorCode FSDK_DocumentsSource_IsEmpty(FS_DOCUMENTSSOURCE_HANDLE documentssource_handle, FS_BOOL* return_value);
FSErrorCode FSDK_FullTextSearch_Create(FS_FULLTEXTSEARCH_HANDLE* fulltextsearch_return_value);
FSErrorCode FSDK_FullTextSearch_Release(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle);
FSErrorCode FSDK_FullTextSearch_IsEmpty(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle, FS_BOOL* return_value);
FSErrorCode FSDK_FullTextSearch_SetDataBasePath(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle, const char* path_of_data_base);
FSErrorCode FSDK_FullTextSearch_StartUpdateIndex(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle, const FS_DOCUMENTSSOURCE_HANDLE source, FSPauseCallback* pause,
                                       FS_BOOL reupdate, FS_PROGRESSIVE_HANDLE* return_value);
FSErrorCode FSDK_FullTextSearch_UpdateIndexWithFilePath(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle, const char* file_path, FS_BOOL* return_value);
FSErrorCode FSDK_FullTextSearch_SearchOf(FS_FULLTEXTSEARCH_HANDLE fulltextsearch_handle, const char* match_string, FSRankMode rank_mode, FSSearchCallback* callback, FS_BOOL* return_value);
#ifdef __cplusplus
}
#endif
#endif
