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