|
libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Typedefs | |
| typedef void(* | lws_dir_notify_cb_t) (const char *path, int is_file, void *user) |
Functions | |
| LWS_VISIBLE LWS_EXTERN struct lws_dir_notify * | lws_dir_notify_create (struct lws_context *ctx, const char *path, lws_dir_notify_cb_t cb, void *user) |
| LWS_VISIBLE LWS_EXTERN void | lws_dir_notify_destroy (struct lws_dir_notify **pdn) |
| typedef void(* lws_dir_notify_cb_t) (const char *path, int is_file, void *user) |
lws_dir_notify_cb_t() - Callback for directory/file modification events
| path | The absolute path of the file or directory that was modified |
| is_file | Non-zero if the modified entry was a file, zero if a directory |
| user | Opaque pointer passed in during lws_dir_notify_create |
Definition at line 37 of file lws-dir-notify.h.
| LWS_VISIBLE LWS_EXTERN struct lws_dir_notify * lws_dir_notify_create | ( | struct lws_context * | ctx, |
| const char * | path, | ||
| lws_dir_notify_cb_t | cb, | ||
| void * | user ) |
lws_dir_notify_create() - Create a cross-platform directory/file monitor
| ctx | The lws_context the monitor should bind to |
| path | The absolute path of the directory or file to monitor |
| cb | The event callback that is routed when changes are detected |
| user | Opaque object passed back in the callback |
Returns an allocated and initialized struct lws_dir_notify bound to the context event loop, or NULL on failure.
On Linux, this will use an inotify FD and adopt it into the event loop. On macOS/BSD, this will use kqueue. On Windows, this will use ReadDirectoryChangesW/FindFirstChangeNotification.
References LWS_EXTERN, and LWS_VISIBLE.
| LWS_VISIBLE LWS_EXTERN void lws_dir_notify_destroy | ( | struct lws_dir_notify ** | pdn | ) |
lws_dir_notify_destroy() - Destroy the monitor
| pdn | Pointer to the lws_dir_notify pointer to clean up |
Closes underlying resources and frees the monitor structure. Sets pointer to NULL.