1 /* $NetBSD: smtp_stream.h,v 1.1.1.2 2013/01/02 18:59:00 tron Exp $ */ 2 3 #ifndef _SMTP_STREAM_H_INCLUDED_ 4 #define _SMTP_STREAM_H_INCLUDED_ 5 6 /*++ 7 /* NAME 8 /* smtp_stream 3h 9 /* SUMMARY 10 /* smtp stream I/O support 11 /* SYNOPSIS 12 /* #include <smtp_stream.h> 13 /* DESCRIPTION 14 /* .nf 15 16 /* 17 * System library. 18 */ 19 #include <stdarg.h> 20 #include <setjmp.h> 21 22 /* 23 * Utility library. 24 */ 25 #include <vstring.h> 26 #include <vstream.h> 27 28 /* 29 * External interface. The following codes are meant for use in longjmp(), 30 * so they must all be non-zero. 31 */ 32 #define SMTP_ERR_EOF 1 /* unexpected client disconnect */ 33 #define SMTP_ERR_TIME 2 /* time out */ 34 #define SMTP_ERR_QUIET 3 /* silent cleanup (application) */ 35 #define SMTP_ERR_NONE 4 /* non-error case */ 36 #define SMTP_ERR_DATA 5 /* application data error */ 37 38 extern void smtp_stream_setup(VSTREAM *, int, int); 39 extern void PRINTFLIKE(2, 3) smtp_printf(VSTREAM *, const char *,...); 40 extern void smtp_flush(VSTREAM *); 41 extern int smtp_fgetc(VSTREAM *); 42 extern int smtp_get(VSTRING *, VSTREAM *, ssize_t, int); 43 extern void smtp_fputs(const char *, ssize_t len, VSTREAM *); 44 extern void smtp_fwrite(const char *, ssize_t len, VSTREAM *); 45 extern void smtp_fputc(int, VSTREAM *); 46 47 extern void smtp_vprintf(VSTREAM *, const char *, va_list); 48 49 #define smtp_timeout_setup(stream, timeout) \ 50 smtp_stream_setup((stream), (timeout), 0) 51 52 #define SMTP_GET_FLAG_NONE 0 53 #define SMTP_GET_FLAG_SKIP (1<<0) /* skip over excess input */ 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 67