Browse Source

* filelist.[ch]: add f2b_filelist_destroy()

master
Alex 'AdUser' Z 8 years ago
parent
commit
7e99e33372
  1. 11
      src/filelist.c
  2. 3
      src/filelist.h

11
src/filelist.c

@ -39,3 +39,14 @@ f2b_filelist_from_glob(const char *pattern) {
globfree(&globbuf);
return files;
}
void
f2b_filelist_destroy(f2b_logfile_t *list) {
f2b_logfile_t *next = NULL;
for (; list != NULL; list = next) {
next = list->next;
f2b_logfile_close(list);
free(list);
}
}

3
src/filelist.h

@ -7,4 +7,7 @@ f2b_filelist_from_glob(const char *pattern);
f2b_logfile_t *
f2b_filelist_append(f2b_logfile_t *list, f2b_logfile_t *file);
void
f2b_filelist_destroy(f2b_logfile_t *list);
#endif /* FILELIST_H_ */

Loading…
Cancel
Save