Lines Matching full:dir
101 static void ip_watched_dir_free (ip_watched_dir_t *dir);
133 ip_watched_dir_t *dir) in ip_map_path_dir() argument
135 g_assert (path && dir); in ip_map_path_dir()
136 g_hash_table_insert (path_dir_hash, dir->path, dir); in ip_map_path_dir()
141 ip_watched_dir_t *dir) in ip_map_sub_dir() argument
144 g_assert (dir && sub); in ip_map_sub_dir()
145 g_hash_table_insert (sub_dir_hash, sub, dir); in ip_map_sub_dir()
146 dir->subs = g_list_prepend (dir->subs, sub); in ip_map_sub_dir()
151 ip_watched_dir_t *dir) in ip_map_wd_dir() argument
155 g_assert (wd >= 0 && dir); in ip_map_wd_dir()
157 dir_list = g_list_prepend (dir_list, dir); in ip_map_wd_dir()
158 g_hash_table_replace (wd_dir_hash, GINT_TO_POINTER (dir->wd), dir_list); in ip_map_wd_dir()
252 ip_watched_dir_t *dir; in _ip_start_watching() local
259 dir = g_hash_table_lookup (path_dir_hash, sub->dirname); in _ip_start_watching()
261 if (dir == NULL) in _ip_start_watching()
276 dir = ip_watched_dir_new (sub->dirname, wd); in _ip_start_watching()
277 ip_map_wd_dir (wd, dir); in _ip_start_watching()
278 ip_map_path_dir (sub->dirname, dir); in _ip_start_watching()
288 file = g_hash_table_lookup (dir->files_hash, sub->filename); in _ip_start_watching()
293 g_hash_table_insert (dir->files_hash, file->filename, file); in _ip_start_watching()
300 ip_map_sub_dir (sub, dir); in _ip_start_watching()
307 ip_watched_dir_t *dir) in ip_unmap_path_dir() argument
309 g_assert (path && dir); in ip_unmap_path_dir()
310 g_hash_table_remove (path_dir_hash, dir->path); in ip_unmap_path_dir()
315 ip_watched_dir_t *dir) in ip_unmap_wd_dir() argument
322 g_assert (wd >= 0 && dir); in ip_unmap_wd_dir()
323 dir_list = g_list_remove (dir_list, dir); in ip_unmap_wd_dir()
325 g_hash_table_remove (wd_dir_hash, GINT_TO_POINTER (dir->wd)); in ip_unmap_wd_dir()
327 g_hash_table_replace (wd_dir_hash, GINT_TO_POINTER (dir->wd), dir_list); in ip_unmap_wd_dir()
343 ip_watched_dir_t *dir) in ip_unmap_sub_dir() argument
345 g_assert (sub && dir); in ip_unmap_sub_dir()
347 dir->subs = g_list_remove (dir->subs, sub); in ip_unmap_sub_dir()
353 file = g_hash_table_lookup (dir->files_hash, sub->filename); in ip_unmap_sub_dir()
358 g_hash_table_remove (dir->files_hash, sub->filename); in ip_unmap_sub_dir()
366 ip_unmap_all_subs (ip_watched_dir_t *dir) in ip_unmap_all_subs() argument
368 while (dir->subs != NULL) in ip_unmap_all_subs()
369 ip_unmap_sub_dir (dir->subs->data, dir); in ip_unmap_all_subs()
375 ip_watched_dir_t *dir = NULL; in _ip_stop_watching() local
377 dir = g_hash_table_lookup (sub_dir_hash, sub); in _ip_stop_watching()
378 if (!dir) in _ip_stop_watching()
381 ip_unmap_sub_dir (sub, dir); in _ip_stop_watching()
384 if (dir->subs == NULL) in _ip_stop_watching()
386 _ik_ignore (dir->path, dir->wd); in _ip_stop_watching()
387 ip_unmap_wd_dir (dir->wd, dir); in _ip_stop_watching()
388 ip_unmap_path_dir (dir->path, dir); in _ip_stop_watching()
389 ip_watched_dir_free (dir); in _ip_stop_watching()
400 ip_watched_dir_t *dir = g_new0 (ip_watched_dir_t, 1); in ip_watched_dir_new() local
402 dir->path = g_strdup (path); in ip_watched_dir_new()
403 dir->files_hash = g_hash_table_new (g_str_hash, g_str_equal); in ip_watched_dir_new()
404 dir->wd = wd; in ip_watched_dir_new()
406 return dir; in ip_watched_dir_new()
410 ip_watched_dir_free (ip_watched_dir_t *dir) in ip_watched_dir_free() argument
412 g_assert_cmpint (g_hash_table_size (dir->files_hash), ==, 0); in ip_watched_dir_free()
413 g_assert (dir->subs == NULL); in ip_watched_dir_free()
414 g_free (dir->path); in ip_watched_dir_free()
415 g_hash_table_unref (dir->files_hash); in ip_watched_dir_free()
416 g_free (dir); in ip_watched_dir_free()
423 ip_watched_dir_t *dir = data; in ip_wd_delete() local
426 for (l = dir->subs; l; l = l->next) in ip_wd_delete()
432 ip_unmap_all_subs (dir); in ip_wd_delete()
434 ip_unmap_path_dir (dir->path, dir); in ip_wd_delete()
435 ip_watched_dir_free (dir); in ip_wd_delete()
453 ip_watched_dir_t *dir = l->data; in ip_event_dispatch() local
455 for (subl = dir->subs; subl; subl = subl->next) in ip_event_dispatch()
498 file = g_hash_table_lookup (dir->files_hash, sub->filename); in ip_event_dispatch()
582 ip_watched_dir_t *dir; in _ip_get_path_for_wd() local
588 dir = dir_list->data; in _ip_get_path_for_wd()
589 if (dir) in _ip_get_path_for_wd()
590 return dir->path; in _ip_get_path_for_wd()