Home | History | Annotate | Line # | Download | only in global
      1 /*	$NetBSD: rcpt_buf.h,v 1.2 2022/10/08 16:12:45 christos Exp $	*/
      2 
      3 #ifndef _RCPT_BUF_H_INCLUDED_
      4 #define _RCPT_BUF_H_INCLUDED_
      5 
      6 /*++
      7 /* NAME
      8 /*	rcpt_buf 3h
      9 /* SUMMARY
     10 /*	recipient buffer manager
     11 /* SYNOPSIS
     12 /*	#include <rcpt_buf.h>
     13 /* DESCRIPTION
     14 /* .nf
     15 
     16  /*
     17   * Utility library.
     18   */
     19 #include <vstream.h>
     20 #include <vstring.h>
     21 #include <attr.h>
     22 
     23  /*
     24   * Global library.
     25   */
     26 #include <recipient_list.h>
     27 
     28  /*
     29   * External interface.
     30   */
     31 typedef struct {
     32     RECIPIENT rcpt;			/* convenience */
     33     VSTRING *address;			/* final recipient */
     34     VSTRING *orig_addr;			/* original recipient */
     35     VSTRING *dsn_orcpt;			/* dsn original recipient */
     36     int     dsn_notify;			/* DSN notify flags */
     37     long    offset;			/* REC_TYPE_RCPT byte */
     38 } RCPT_BUF;
     39 
     40 extern RCPT_BUF *rcpb_create(void);
     41 extern void rcpb_reset(RCPT_BUF *);
     42 extern void rcpb_free(RCPT_BUF *);
     43 extern int rcpb_scan(ATTR_SCAN_COMMON_FN, VSTREAM *, int, void *);
     44 
     45 #define RECIPIENT_FROM_RCPT_BUF(buf) \
     46     ((buf)->rcpt.address = vstring_str((buf)->address), \
     47      (buf)->rcpt.orig_addr = vstring_str((buf)->orig_addr), \
     48      (buf)->rcpt.dsn_orcpt = vstring_str((buf)->dsn_orcpt), \
     49      (buf)->rcpt.dsn_notify = (buf)->dsn_notify, \
     50      (buf)->rcpt.offset = (buf)->offset, \
     51      &(buf)->rcpt)
     52 
     53 /* LICENSE
     54 /* .ad
     55 /* .fi
     56 /*	The Secure Mailer license must be distributed with this software.
     57 /* AUTHOR(S)
     58 /*	Wietse Venema
     59 /*	IBM T.J. Watson Research
     60 /*	P.O. Box 704
     61 /*	Yorktown Heights, NY 10598, USA
     62 /*
     63 /*	Wietse Venema
     64 /*	Google, Inc.
     65 /*	111 8th Avenue
     66 /*	New York, NY 10011, USA
     67 /*--*/
     68 
     69 #endif
     70