diff options
Diffstat (limited to 'src/watch_list.c')
-rw-r--r-- | src/watch_list.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/watch_list.c b/src/watch_list.c index 39c61f2..35f2302 100644 --- a/src/watch_list.c +++ b/src/watch_list.c @@ -1,22 +1,22 @@ /* - * rhdropbox + * dropnroll * - * Copyright (C) 2009 Christian Pointner <equinox@helsinki.at> + * Copyright (C) 2009-2015 Christian Pointner <equinox@spreadspace.org> * - * This file is part of rhdropbox. + * This file is part of dropnroll. * - * rhdropbox is free software: you can redistribute it and/or modify + * dropnroll is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * - * rhdropbox is distributed in the hope that it will be useful, + * dropnroll is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with rhdropbox. If not, see <http://www.gnu.org/licenses/>. + * along with dropnroll. If not, see <http://www.gnu.org/licenses/>. */ #include <string.h> @@ -29,7 +29,7 @@ void watch_list_init(watch_list_t* list) { if(!list) return; - + list->first_ = NULL; } @@ -92,12 +92,12 @@ void watch_list_rm(watch_list_t* list, const char* path) { if(!list || !path) return; - + watch_list_element_t* tmp = NULL; if(list->first_->path_ && !strcmp(path, list->first_->path_)) { tmp = list->first_; list->first_ = list->first_->next_; - + if(tmp->path_) free(tmp->path_); free(tmp); @@ -113,7 +113,7 @@ void watch_list_rm(watch_list_t* list, const char* path) if(tmp->path_) free(tmp->path_); free(tmp); - return; + return; } prev = tmp; tmp = tmp->next_; @@ -124,14 +124,14 @@ char* watch_list_find_path(watch_list_t* list, int watch_fd) { if(!list) return NULL; - + watch_list_element_t* tmp = list->first_; while(tmp) { if(tmp->watch_fd_ == watch_fd) return tmp->path_; tmp = tmp->next_; } - + return NULL; } @@ -139,14 +139,14 @@ int watch_list_find_fd(watch_list_t* list, const char* path) { if(!list || !path) return -1; - + watch_list_element_t* tmp = list->first_; while(tmp) { if(tmp->path_ && !strcmp(path, tmp->path_)) return tmp->watch_fd_; tmp = tmp->next_; } - + return -1; } @@ -154,7 +154,7 @@ void watch_list_print(watch_list_t* list, const char* head, const char* sep, con { if(!list) return; - + watch_list_element_t* tmp = list->first_; while(tmp) { printf("%s%d%s%s%s", head, tmp->watch_fd_, sep, tmp->path_, tail); |