| 1 | #include <sys/inotify> |
| 2 | |
| 3 | GHashTable *directory_paths; |
| 4 | |
| 5 | void init_directory_paths(void) |
| 6 | { |
| 7 | // FIXME padding '////' from root_path |
| 8 | directory_paths = g_hash_table_new(g_str_hash, g_str_equal); |
| 9 | } |
| 10 | |
| 11 | void init_inotify(char *root_path) |
| 12 | { |
| 13 | int descriptor, watch; |
| 14 | |
| 15 | if ((descriptor = inotify_init()) == -1) { |
| 16 | PRINT_ERRNO_INFO(); |
| 17 | return; |
| 18 | } |
| 19 | if ((watch = inotify_add_watch(descriptor, root_path, IN_MOVED_FROM | IN_MOVED_TO | IN_DELETED)) == -1) { |
| 20 | PRINT_ERRNO_INFO(); |
| 21 | return; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | GNode *get_file_by_path(char *path) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | void insert_file_in_directory(GNode *directory, GNode *file) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | void remove_file_from_directory(GNode *file) |
| 34 | { |
| 35 | } |