townengine/src/twn_filewatch_c.h

22 lines
503 B
C
Raw Normal View History

#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 (*FileatchCallback)(char const *path, enum FilewatchAction action);
bool filewatch_add_directory(char const *dir, FileatchCallback callback);
bool filewatch_add_file(char const *file, FileatchCallback callback);
void filewatch_poll(void);
#endif