Lines Matching defs:handle
654 static int uv__parse_data(char *buf, int *events, uv_fs_event_t* handle) {
685 if (uv__path_is_a_directory(handle->path) == 0) { /* Directory */
689 handle->dir_filename = NULL;
700 handle->dir_filename = uv__strdup((const char*)&filename);
722 uv_fs_event_t* handle;
727 handle = container_of(event_watch, uv_fs_event_t, event_watcher);
746 rc = uv__parse_data(result_data, &events, handle);
755 if (uv__path_is_a_directory(handle->path) == 0) {
756 p = handle->dir_filename;
758 p = strrchr(handle->path, '/');
760 p = handle->path;
768 handle->cb(handle, fname, events, 0);
773 int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
775 uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
783 int uv_fs_event_start(uv_fs_event_t* handle,
830 uv__handle_start(handle);
831 uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
832 handle->path = uv__strdup(filename);
833 handle->cb = cb;
834 handle->dir_filename = NULL;
836 uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
854 int uv_fs_event_stop(uv_fs_event_t* handle) {
856 if (!uv__is_active(handle))
859 uv__io_close(handle->loop, &handle->event_watcher);
860 uv__handle_stop(handle);
862 if (uv__path_is_a_directory(handle->path) == 0) {
863 uv__free(handle->dir_filename);
864 handle->dir_filename = NULL;
867 uv__free(handle->path);
868 handle->path = NULL;
869 uv__close(handle->event_watcher.fd);
870 handle->event_watcher.fd = -1;
879 void uv__fs_event_close(uv_fs_event_t* handle) {
881 uv_fs_event_stop(handle);