No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / netstring.h
blob762358ce0399242aa5f09b57d8addcfd4e036eaf
1 /* $NetBSD$ */
3 #ifndef _NETSTRING_H_INCLUDED_
4 #define _NETSTRING_H_INCLUDED_
6 /*++
7 /* NAME
8 /* netstring 3h
9 /* SUMMARY
10 /* netstring stream I/O support
11 /* SYNOPSIS
12 /* #include <netstring.h>
13 /* DESCRIPTION
14 /* .nf
17 * Utility library.
19 #include <vstring.h>
20 #include <vstream.h>
23 * External interface.
25 #define NETSTRING_ERR_EOF 1 /* unexpected disconnect */
26 #define NETSTRING_ERR_TIME 2 /* time out */
27 #define NETSTRING_ERR_FORMAT 3 /* format error */
28 #define NETSTRING_ERR_SIZE 4 /* netstring too large */
30 extern void netstring_except(VSTREAM *, int);
31 extern void netstring_setup(VSTREAM *, int);
32 extern ssize_t netstring_get_length(VSTREAM *);
33 extern VSTRING *netstring_get_data(VSTREAM *, VSTRING *, ssize_t);
34 extern void netstring_get_terminator(VSTREAM *);
35 extern VSTRING *netstring_get(VSTREAM *, VSTRING *, ssize_t);
36 extern void netstring_put(VSTREAM *, const char *, ssize_t);
37 extern void netstring_put_multi(VSTREAM *,...);
38 extern void netstring_fflush(VSTREAM *);
39 extern VSTRING *netstring_memcpy(VSTRING *, const char *, ssize_t);
40 extern VSTRING *netstring_memcat(VSTRING *, const char *, ssize_t);
42 #define NETSTRING_PUT_BUF(str, buf) \
43 netstring_put((str), vstring_str(buf), VSTRING_LEN(buf))
45 /* LICENSE
46 /* .ad
47 /* .fi
48 /* The Secure Mailer license must be distributed with this software.
49 /* AUTHOR(S)
50 /* Wietse Venema
51 /* IBM T.J. Watson Research
52 /* P.O. Box 704
53 /* Yorktown Heights, NY 10598, USA
54 /*--*/
56 #endif