Postfix3.3.1
総合概要
データ構造
ファイル
ファイル一覧
大域各種
postfix-3.3.1
src
global
mail_scan_dir.c
[詳解]
1
/*++
2
/* NAME
3
/* mail_scan_dir 3
4
/* SUMMARY
5
/* mail queue directory scanning support
6
/* SYNOPSIS
7
/* #include <mail_scan_dir.h>
8
/*
9
/* char *mail_scan_dir_next(scan)
10
/* SCAN_DIR *scan;
11
/* DESCRIPTION
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.
15
/* SEE ALSO
16
/* scan_dir(3) directory scanner
17
/* LICENSE
18
/* .ad
19
/* .fi
20
/* The Secure Mailer license must be distributed with this software.
21
/* AUTHOR(S)
22
/* Wietse Venema
23
/* IBM T.J. Watson Research
24
/* P.O. Box 704
25
/* Yorktown Heights, NY 10598, USA
26
/*--*/
27
28
/* System library. */
29
30
#include <
sys_defs.h
>
31
#include <string.h>
32
33
/* Utility library. */
34
35
#include <
scan_dir.h
>
36
37
/* Global library. */
38
39
#include <
mail_scan_dir.h
>
40
41
/* mail_scan_dir_next - return next queue file */
42
43
char
*
mail_scan_dir_next
(
SCAN_DIR
*scan)
44
{
45
char
*name;
46
47
/*
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.
51
*/
52
for
(;;) {
53
if
((name =
scan_dir_next
(scan)) == 0) {
54
if
(
scan_dir_pop
(scan) == 0)
55
return
(0);
56
}
else
if
(strlen(name) == 1) {
57
scan_dir_push
(scan, name);
58
}
else
{
59
return
(name);
60
}
61
}
62
}
scan_dir_push
void scan_dir_push(SCAN_DIR *scan, const char *path)
Definition:
scan_dir.c:124
scan_dir_pop
SCAN_DIR * scan_dir_pop(SCAN_DIR *scan)
Definition:
scan_dir.c:144
mail_scan_dir.h
scan_dir.h
SCAN_DIR
Definition:
scan_dir.c:108
sys_defs.h
mail_scan_dir_next
char * mail_scan_dir_next(SCAN_DIR *scan)
Definition:
mail_scan_dir.c:43
scan_dir_next
char * scan_dir_next(SCAN_DIR *scan)
Definition:
scan_dir.c:177
2018年11月10日(土) 18時59分38秒作成 - Postfix3.3.1 / 構成:
1.8.9.1