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