]> diplodocus.org Git - nmh/blob - h/crawl_folders.h
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / h / crawl_folders.h
1 /* crawl_folders.h -- crawl folder hierarchy
2 */
3
4 #define CRAWL_NUMFOLDERS 100
5
6 /* Callbacks return true crawl_folders should crawl the children of `folder'.
7 * Callbacks need not duplicate folder, as crawl_folders does not free it. */
8 typedef bool (crawl_callback_t)(char *folder, void *baton);
9
10 /* Crawl the folder hierarchy rooted at the relative path `dir'. For each
11 * folder, pass `callback' the folder name (as a path relative to the current
12 * directory) and `baton'; the callback may direct crawl_folders not to crawl
13 * its children; see above. */
14 void crawl_folders (char *dir, crawl_callback_t *callback, void *baton);