townengine/src/twn_filewatch_c.h
2025-02-01 14:25:54 +03:00

22 lines
506 B
C

#ifndef TWN_FILEWATCH_C_H
#define TWN_FILEWATCH_C_H
#include <stdbool.h>
enum FilewatchAction {
FILEWATCH_ACTION_FILE_NONE,
FILEWATCH_ACTION_FILE_CREATED,
FILEWATCH_ACTION_FILE_DELETED,
FILEWATCH_ACTION_FILE_MODIFIED,
};
typedef void (*FilewatchCallback)(char const *path, enum FilewatchAction action);
bool filewatch_add_directory(char const *dir, FilewatchCallback callback);
bool filewatch_add_file(char const *file, FilewatchCallback callback);
void filewatch_poll(void);
#endif