2016-08-22 19:31:19 +00:00
|
|
|
/*
|
2017-03-18 21:07:25 +00:00
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 20.07.2016
|
|
|
|
*
|
|
|
|
* File tracking API.
|
|
|
|
*
|
|
|
|
*/
|
2016-08-22 19:31:19 +00:00
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
2017-03-18 21:07:25 +00:00
|
|
|
#if !defined(FILE_TRACK_4TECH_H)
|
2016-08-22 19:31:19 +00:00
|
|
|
#define FILE_TRACK_4TECH_H
|
|
|
|
|
2017-03-18 21:07:25 +00:00
|
|
|
#if !defined(FILE_TRACK_LINK)
|
|
|
|
# define FILE_TRACK_LINK static
|
2016-08-29 16:52:47 +00:00
|
|
|
#endif
|
|
|
|
|
2017-07-18 22:34:57 +00:00
|
|
|
struct File_Track_System{
|
2017-03-18 21:07:25 +00:00
|
|
|
u8 opaque[128];
|
2017-07-18 22:34:57 +00:00
|
|
|
};
|
2016-08-22 19:31:19 +00:00
|
|
|
|
2017-03-18 21:07:25 +00:00
|
|
|
typedef i32 File_Track_Result;
|
2016-08-22 19:31:19 +00:00
|
|
|
enum{
|
2018-11-21 07:48:42 +00:00
|
|
|
FileTrack_Good = 0,
|
|
|
|
FileTrack_MemoryTooSmall = 1,
|
|
|
|
FileTrack_OutOfTableMemory = 2,
|
|
|
|
FileTrack_OutOfListenerMemory = 3,
|
|
|
|
FileTrack_NoMoreEvents = 4,
|
|
|
|
FileTrack_FileSystemError = 5
|
2016-08-22 19:31:19 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-23 19:16:39 +00:00
|
|
|
init_track_system(File_Track_System *system, Partition *scratch, void *table_memory, i32 table_memory_size, void *listener_memory, i32 listener_memory_size);
|
2016-08-22 19:31:19 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-18 22:19:51 +00:00
|
|
|
add_listener(File_Track_System *system, Partition *scratch, u8 *filename);
|
2016-08-22 19:31:19 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-18 22:19:51 +00:00
|
|
|
remove_listener(File_Track_System *system, Partition *scratch, u8 *filename);
|
2016-08-22 23:54:20 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-23 19:16:39 +00:00
|
|
|
move_track_system(File_Track_System *system, Partition *scratch, void *mem, i32 size);
|
2016-08-22 19:31:19 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-23 19:16:39 +00:00
|
|
|
expand_track_system_listeners(File_Track_System *system, Partition *scratch, void *mem, i32 size);
|
2016-08-22 19:31:19 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-23 22:45:32 +00:00
|
|
|
get_change_event(File_Track_System *system, Partition *scratch, u8 *buffer, i32 max, i32 *size);
|
2016-08-24 23:01:33 +00:00
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-18 22:19:51 +00:00
|
|
|
shut_down_track_system(File_Track_System *system, Partition *scratch);
|
2016-08-22 19:31:19 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|