3 #ifndef _NETSTRING_H_INCLUDED_
4 #define _NETSTRING_H_INCLUDED_
10 /* netstring stream I/O support
12 /* #include <netstring.h>
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))
48 /* The Secure Mailer license must be distributed with this software.
51 /* IBM T.J. Watson Research
53 /* Yorktown Heights, NY 10598, USA