Postfix3.3.1
netstring.h
[詳解]
1 #ifndef _NETSTRING_H_INCLUDED_
2 #define _NETSTRING_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* netstring 3h
7 /* SUMMARY
8 /* netstring stream I/O support
9 /* SYNOPSIS
10 /* #include <netstring.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Utility library.
16  */
17 #include <vstring.h>
18 #include <vstream.h>
19 
20  /*
21  * External interface.
22  */
23 #define NETSTRING_ERR_EOF 1 /* unexpected disconnect */
24 #define NETSTRING_ERR_TIME 2 /* time out */
25 #define NETSTRING_ERR_FORMAT 3 /* format error */
26 #define NETSTRING_ERR_SIZE 4 /* netstring too large */
27 
28 extern void netstring_except(VSTREAM *, int);
29 extern void netstring_setup(VSTREAM *, int);
30 extern ssize_t netstring_get_length(VSTREAM *);
31 extern VSTRING *netstring_get_data(VSTREAM *, VSTRING *, ssize_t);
32 extern void netstring_get_terminator(VSTREAM *);
33 extern VSTRING *netstring_get(VSTREAM *, VSTRING *, ssize_t);
34 extern void netstring_put(VSTREAM *, const char *, ssize_t);
35 extern void netstring_put_multi(VSTREAM *,...);
36 extern void netstring_fflush(VSTREAM *);
37 extern VSTRING *netstring_memcpy(VSTRING *, const char *, ssize_t);
38 extern VSTRING *netstring_memcat(VSTRING *, const char *, ssize_t);
39 extern const char *netstring_strerror(int);
40 
41 #define NETSTRING_PUT_BUF(str, buf) \
42  netstring_put((str), vstring_str(buf), VSTRING_LEN(buf))
43 
44 /* LICENSE
45 /* .ad
46 /* .fi
47 /* The Secure Mailer license must be distributed with this software.
48 /* AUTHOR(S)
49 /* Wietse Venema
50 /* IBM T.J. Watson Research
51 /* P.O. Box 704
52 /* Yorktown Heights, NY 10598, USA
53 /*--*/
54 
55 #endif
VSTRING * netstring_memcpy(VSTRING *, const char *, ssize_t)
Definition: netstring.c:351
ssize_t netstring_get_length(VSTREAM *)
Definition: netstring.c:199
const char * netstring_strerror(int)
Definition: netstring.c:371
void netstring_put_multi(VSTREAM *,...)
Definition: netstring.c:295
void netstring_get_terminator(VSTREAM *)
Definition: netstring.c:260
void netstring_except(VSTREAM *, int)
Definition: netstring.c:192
void netstring_put(VSTREAM *, const char *, ssize_t)
Definition: netstring.c:281
VSTRING * netstring_get_data(VSTREAM *, VSTRING *, ssize_t)
Definition: netstring.c:230
VSTRING * netstring_get(VSTREAM *, VSTRING *, ssize_t)
Definition: netstring.c:268
void netstring_setup(VSTREAM *, int)
Definition: netstring.c:182
void netstring_fflush(VSTREAM *)
Definition: netstring.c:342
VSTRING * netstring_memcat(VSTRING *, const char *, ssize_t)
Definition: netstring.c:361