summaryrefslogtreecommitdiffstats
path: root/src/global/rcpt_buf.h
blob: 770f011d9382b069e0391d8a32eb948f02ff1803 (plain)
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
#ifndef _RCPT_BUF_H_INCLUDED_
#define _RCPT_BUF_H_INCLUDED_

/*++
/* NAME
/*	rcpt_buf 3h
/* SUMMARY
/*	recipient buffer manager
/* SYNOPSIS
/*	#include <rcpt_buf.h>
/* DESCRIPTION
/* .nf

 /*
  * Utility library.
  */
#include <vstream.h>
#include <vstring.h>
#include <attr.h>

 /*
  * Global library.
  */
#include <recipient_list.h>

 /*
  * External interface.
  */
typedef struct {
    RECIPIENT rcpt;			/* convenience */
    VSTRING *address;			/* final recipient */
    VSTRING *orig_addr;			/* original recipient */
    VSTRING *dsn_orcpt;			/* dsn original recipient */
    int     dsn_notify;			/* DSN notify flags */
    long    offset;			/* REC_TYPE_RCPT byte */
} RCPT_BUF;

extern RCPT_BUF *rcpb_create(void);
extern void rcpb_reset(RCPT_BUF *);
extern void rcpb_free(RCPT_BUF *);
extern int rcpb_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);

#define RECIPIENT_FROM_RCPT_BUF(buf) \
    ((buf)->rcpt.address = vstring_str((buf)->address), \
     (buf)->rcpt.orig_addr = vstring_str((buf)->orig_addr), \
     (buf)->rcpt.dsn_orcpt = vstring_str((buf)->dsn_orcpt), \
     (buf)->rcpt.dsn_notify = (buf)->dsn_notify, \
     (buf)->rcpt.offset = (buf)->offset, \
     &(buf)->rcpt)

/* LICENSE
/* .ad
/* .fi
/*	The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/*	Wietse Venema
/*	IBM T.J. Watson Research
/*	P.O. Box 704
/*	Yorktown Heights, NY 10598, USA
/*
/*	Wietse Venema
/*	Google, Inc.
/*	111 8th Avenue
/*	New York, NY 10011, USA
/*--*/

#endif