Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 1 | #ifndef _INDEX_FILE_H_ |
| 2 | #define _INDEX_FILE_H_ |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #define INDEX_FILE_MAX_PATH_LENGTH 256 |
| 9 | typedef uint32_t Index_FileHandle_t; |
| 10 | |
| 11 | typedef enum { |
| 12 | INDEX_RECORD_MODE, |
| 13 | INDEX_PLAYBACK_MODE, |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 14 | INDEX_UNKNOWN_MODE, |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 15 | } Index_FileOpenMode_t; |
| 16 | |
| 17 | typedef struct Index_FileOpenParams_s { |
| 18 | char path[INDEX_FILE_MAX_PATH_LENGTH]; |
| 19 | Index_FileOpenMode_t mode; |
| 20 | } Index_FileOpenParams_t; |
| 21 | |
| 22 | int index_file_open(Index_FileHandle_t *p_handle, Index_FileOpenParams_t *p_params); |
| 23 | |
| 24 | int index_file_close(Index_FileHandle_t handle); |
| 25 | |
| 26 | int index_file_write(Index_FileHandle_t handle, uint64_t pts, loff_t offset); |
| 27 | |
| 28 | loff_t index_file_lookup_by_time(Index_FileHandle_t handle, time_t time); |
| 29 | |
| 30 | #ifdef __cplusplus |
| 31 | } |
| 32 | #endif |
| 33 | |
| 34 | #endif /*END _INDEX_FILE_H_*/ |