File: dest.h

package info (click to toggle)
deliver 2.1.14-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 488 kB
  • ctags: 914
  • sloc: ansic: 6,050; yacc: 405; makefile: 131; sh: 34
file content (71 lines) | stat: -rw-r--r-- 2,532 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* $Id: dest.h,v 1.1 1991/05/13 18:36:55 chip Exp $
 *
 * Description of a mail destination and its state.
 *
 * $Log: dest.h,v $
 * Revision 1.1  1991/05/13 18:36:55  chip
 * Initial revision
 *
 */

/*----------------------------------------------------------------------
 * Destination class.
 */

typedef enum {
    CL_USER,			/* User name, no mailbox                */
    CL_MBOX,			/* User name, with mailbox name         */
    CL_PROG,			/* Program to run with message on stdin */
    CL_UUCP			/* UUCP address (bang path)             */
} DCLASS;

/*----------------------------------------------------------------------
 * Destination state.
 */

typedef enum {
    ST_WORKING,			/* the "normal" state                   */
    ST_HOLD,			/* on hold during expansion             */
    ST_DONE,			/* all processing complete              */
    ST_ERROR			/* "something is horribly wrong"        */
} DSTATE;

/*----------------------------------------------------------------------
 * Types of destination errors.
 */

typedef enum {
    E_IVADDR,			/* invalid address string               */
    E_DFONLY,			/* "user:mbox" etc. for delfiles only   */
    E_NSUSER,			/* no such user                         */
    E_NSHOST,			/* no such host (UUCP addresses)        */
    E_CTPERM,			/* no permissions for that context      */
    E_CTLOST,			/* context lost (should never happen)   */
    E_MBOX,			/* can't write to mailbox               */
    E_PROG,			/* subprocess exited with non-zero      */
    E_PIPE,			/* can't pipe to subprocess (incl. uux) */
    E_ERRMSG			/* other user-described error           */
} DERROR;

/*----------------------------------------------------------------------
 * Structure describing a mail destination.
 */

#define DEST    struct dest
DEST {
    DEST *d_next;		/* next destination in the chain        */
    DEST *d_prev;		/* previous destination in the chain    */
    DCLASS d_class;		/* destination class                    */
    DSTATE d_state;		/* destination state                    */
    DERROR d_error;		/* error code (if state is ST_ERROR)    */
    char *d_errmsg;		/* error message (if error is E_ERRMSG) */
    int d_dfdone;		/* boolean -- delivery file was run     */
    char *d_name;		/* context for delivery                 */
    char *d_param;		/* parameter (mailbox or program name)  */
};

/*----------------------------------------------------------------------
 * Action macros.
 */

#define dest_err(d,m)   ((d)->d_state = ST_ERROR, (d)->d_error = (m))