5
/* mail queue directory scanning support
7
/* #include <mail_scan_dir.h>
9
/* char *mail_scan_dir_next(scan)
12
/* The \fBmail_scan_dir_next\fR() routine is a wrapper around
13
/* scan_dir_next() that understands the structure of a Postfix
14
/* mail queue. The result is a queue ID or a null pointer.
16
/* scan_dir(3) directory scanner
20
/* The Secure Mailer license must be distributed with this software.
23
/* IBM T.J. Watson Research
25
/* Yorktown Heights, NY 10598, USA
33
/* Utility library. */
39
#include <mail_scan_dir.h>
41
/* mail_scan_dir_next - return next queue file */
43
char *mail_scan_dir_next(SCAN_DIR *scan)
48
* Exploit the fact that mail queue subdirectories have one-letter names,
49
* so we don't have to stat() every file in sight. This is a win because
50
* many dirent implementations do not return file type information.
53
if ((name = scan_dir_next(scan)) == 0) {
54
if (scan_dir_pop(scan) == 0)
56
} else if (strlen(name) == 1) {
57
scan_dir_push(scan, name);