#pragma once #include #ifdef NAUNET_ON_WINDOWS struct inotify_event {}; #define NNWT_FS_CLOSE_WRITE 0 #else #include #define NNWT_FS_CLOSE_WRITE IN_CLOSE_WRITE #define NNWT_FS_CREATE IN_CREATE #endif #include "../loop.h" struct nn_fs_event { s32 fd; u32 mask; char *path; s32 wd; ev_io event; struct nn_event_loop *loop; void (*callback)(void *, struct inotify_event *); void *userdata; }; void nn_fs_event_init(struct nn_fs_event *fs, str *path, u32 mask, void (*callback)(void *, struct inotify_event *), void *userdata); bool nn_fs_event_start(struct nn_fs_event *fs, struct nn_event_loop *loop); void nn_fs_event_stop(struct nn_fs_event *fs); void nn_fs_event_free(struct nn_fs_event *fs);