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-03-18 21:07:25 +00:00
|
|
|
typedef struct{
|
|
|
|
u8 opaque[128];
|
|
|
|
} File_Track_System;
|
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{
|
|
|
|
FileTrack_Good,
|
|
|
|
FileTrack_MemoryTooSmall,
|
|
|
|
FileTrack_OutOfTableMemory,
|
|
|
|
FileTrack_OutOfListenerMemory,
|
|
|
|
FileTrack_NoMoreEvents,
|
|
|
|
FileTrack_FileSystemError
|
|
|
|
};
|
|
|
|
|
2016-08-29 16:52:47 +00:00
|
|
|
FILE_TRACK_LINK File_Track_Result
|
2017-03-19 23:05:05 +00:00
|
|
|
init_track_system(File_Track_System *system, Partition *scratch, void *table_memory, umem table_memory_size, void *listener_memory, umem 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-19 23:05:05 +00:00
|
|
|
move_track_system(File_Track_System *system, Partition *scratch, void *mem, umem 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-19 23:05:05 +00:00
|
|
|
expand_track_system_listeners(File_Track_System *system, Partition *scratch, void *mem, umem 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-19 23:05:05 +00:00
|
|
|
get_change_event(File_Track_System *system, Partition *scratch, u8 *buffer, umem max);
|
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
|