4coder/filetrack/4tech_file_track.h

66 lines
1.5 KiB
C
Raw Normal View History

2016-08-22 19:31:19 +00:00
/*
Copy Right FourTech LLC, 2016
All Rights Are Reserved
The OS agnostic file tracking API for applications
that want to interact with potentially many files on
the disk that could be changed by other applications.
Created on: 20.07.2016
*/
// TOP
#ifndef FILE_TRACK_4TECH_H
#define FILE_TRACK_4TECH_H
#ifndef FILE_TRACK_LINK
#define FILE_TRACK_LINK static
#endif
2016-08-22 19:31:19 +00:00
#include <stdint.h>
enum{
FileTrack_Good,
FileTrack_MemoryTooSmall,
FileTrack_OutOfTableMemory,
FileTrack_OutOfListenerMemory,
FileTrack_NoMoreEvents,
FileTrack_FileSystemError
};
typedef struct{
uint8_t opaque[128];
} File_Track_System;
typedef int32_t File_Track_Result;
2016-08-22 19:31:19 +00:00
FILE_TRACK_LINK File_Track_Result
2016-08-22 19:31:19 +00:00
init_track_system(File_Track_System *system,
void *table_memory, int32_t table_memory_size,
void *listener_memory, int32_t listener_memory_size);
FILE_TRACK_LINK File_Track_Result
2016-08-26 01:42:46 +00:00
add_listener(File_Track_System *system, char *filename);
2016-08-22 19:31:19 +00:00
FILE_TRACK_LINK File_Track_Result
2016-08-26 01:42:46 +00:00
remove_listener(File_Track_System *system, char *filename);
2016-08-22 23:54:20 +00:00
FILE_TRACK_LINK File_Track_Result
2016-08-22 19:31:19 +00:00
move_track_system(File_Track_System *system, void *mem, int32_t size);
FILE_TRACK_LINK File_Track_Result
2016-08-22 19:31:19 +00:00
expand_track_system_listeners(File_Track_System *system, void *mem, int32_t size);
FILE_TRACK_LINK File_Track_Result
2016-08-26 01:42:46 +00:00
get_change_event(File_Track_System *system, char *buffer, int32_t max);
FILE_TRACK_LINK File_Track_Result
2016-08-22 19:31:19 +00:00
shut_down_track_system(File_Track_System *system);
#endif
// BOTTOM