twn_filewatch.c: file and directory change api, initial support for texture reload
This commit is contained in:
23
src/twn_filewatch_c.h
Normal file
23
src/twn_filewatch_c.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef TWN_FILEWATCH_C_H
|
||||
#define TWN_FILEWATCH_C_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define FILEWATCH_MODIFIED_TICKS_MERGED 10
|
||||
|
||||
enum FilewatchAction {
|
||||
FILEWATCH_ACTION_FILE_NONE,
|
||||
FILEWATCH_ACTION_FILE_CREATED,
|
||||
FILEWATCH_ACTION_FILE_DELETED,
|
||||
FILEWATCH_ACTION_FILE_MODIFIED,
|
||||
};
|
||||
|
||||
typedef void (*FileatchCallback)(char const *path, enum FilewatchAction action);
|
||||
|
||||
bool filewatch_add_directory(char *dir, FileatchCallback callback);
|
||||
|
||||
bool filewatch_add_file(char *file, FileatchCallback callback);
|
||||
|
||||
void filewatch_poll(void);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user