Postfix3.3.1
spawn_command.h
[詳解]
1 #ifndef _SPAWN_COMMAND_H_INCLUDED_
2 #define _SPAWN_COMMAND_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* spawn_command 3h
7 /* SUMMARY
8 /* run external command
9 /* SYNOPSIS
10 /* #include <spawn_command.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Utility library.
16  */
17 #include <check_arg.h>
18 
19 /* Legacy API: type-unchecked arguments, internal use. */
20 #define SPAWN_CMD_END 0 /* terminator */
21 #define SPAWN_CMD_ARGV 1 /* command is array */
22 #define SPAWN_CMD_COMMAND 2 /* command is string */
23 #define SPAWN_CMD_STDIN 3 /* mail_copy() flags */
24 #define SPAWN_CMD_STDOUT 4 /* mail_copy() sender */
25 #define SPAWN_CMD_STDERR 5 /* mail_copy() recipient */
26 #define SPAWN_CMD_UID 6 /* privileges */
27 #define SPAWN_CMD_GID 7 /* privileges */
28 #define SPAWN_CMD_TIME_LIMIT 8 /* time limit */
29 #define SPAWN_CMD_ENV 9 /* extra environment */
30 #define SPAWN_CMD_SHELL 10 /* alternative shell */
31 #define SPAWN_CMD_EXPORT 11 /* exportable parameters */
32 
33 /* Safer API: type-checked arguments, external use. */
34 #define CA_SPAWN_CMD_END SPAWN_CMD_END
35 #define CA_SPAWN_CMD_ARGV(v) SPAWN_CMD_ARGV, CHECK_PPTR(CA_SPAWN_CMD, char, (v))
36 #define CA_SPAWN_CMD_COMMAND(v) SPAWN_CMD_COMMAND, CHECK_CPTR(CA_SPAWN_CMD, char, (v))
37 #define CA_SPAWN_CMD_STDIN(v) SPAWN_CMD_STDIN, CHECK_VAL(CA_SPAWN_CMD, int, (v))
38 #define CA_SPAWN_CMD_STDOUT(v) SPAWN_CMD_STDOUT, CHECK_VAL(CA_SPAWN_CMD, int, (v))
39 #define CA_SPAWN_CMD_STDERR(v) SPAWN_CMD_STDERR, CHECK_VAL(CA_SPAWN_CMD, int, (v))
40 #define CA_SPAWN_CMD_UID(v) SPAWN_CMD_UID, CHECK_VAL(CA_SPAWN_CMD, uid_t, (v))
41 #define CA_SPAWN_CMD_GID(v) SPAWN_CMD_GID, CHECK_VAL(CA_SPAWN_CMD, gid_t, (v))
42 #define CA_SPAWN_CMD_TIME_LIMIT(v) SPAWN_CMD_TIME_LIMIT, CHECK_VAL(CA_SPAWN_CMD, int, (v))
43 #define CA_SPAWN_CMD_ENV(v) SPAWN_CMD_ENV, CHECK_PPTR(CA_SPAWN_CMD, char, (v))
44 #define CA_SPAWN_CMD_SHELL(v) SPAWN_CMD_SHELL, CHECK_CPTR(CA_SPAWN_CMD, char, (v))
45 #define CA_SPAWN_CMD_EXPORT(v) SPAWN_CMD_EXPORT, CHECK_PPTR(CA_SPAWN_CMD, char, (v))
46 
47 CHECK_VAL_HELPER_DCL(CA_SPAWN_CMD, uid_t);
48 CHECK_VAL_HELPER_DCL(CA_SPAWN_CMD, int);
49 CHECK_VAL_HELPER_DCL(CA_SPAWN_CMD, gid_t);
50 CHECK_PPTR_HELPER_DCL(CA_SPAWN_CMD, char);
51 CHECK_CPTR_HELPER_DCL(CA_SPAWN_CMD, char);
52 
53 extern WAIT_STATUS_T spawn_command(int,...);
54 
55 /* LICENSE
56 /* .ad
57 /* .fi
58 /* The Secure Mailer license must be distributed with this software.
59 /* AUTHOR(S)
60 /* Wietse Venema
61 /* IBM T.J. Watson Research
62 /* P.O. Box 704
63 /* Yorktown Heights, NY 10598, USA
64 /*--*/
65 
66 #endif
WAIT_STATUS_T spawn_command(int,...)
CHECK_CPTR_HELPER_DCL(CA_SPAWN_CMD, char)
CHECK_VAL_HELPER_DCL(CA_SPAWN_CMD, uid_t)
CHECK_PPTR_HELPER_DCL(CA_SPAWN_CMD, char)
int WAIT_STATUS_T
Definition: sys_defs.h:1436