d9898ee8 |
1 | /* |
2 | ** $Id: rfc822hdr.h,v 1.3 2006/10/29 00:03:54 mrsam Exp $ |
3 | */ |
4 | #ifndef rfc822hdr_h |
5 | #define rfc822hdr_h |
6 | |
7 | /* |
8 | ** Copyright 2001 Double Precision, Inc. |
9 | ** See COPYING for distribution information. |
10 | */ |
11 | |
12 | static const char rfc822hdr_h_rcsid[]="$Id: rfc822hdr.h,v 1.3 2006/10/29 00:03:54 mrsam Exp $"; |
13 | |
14 | #if HAVE_CONFIG_H |
15 | #include "config.h" |
16 | #endif |
17 | #include <sys/types.h> |
18 | #include <stdio.h> |
19 | #include <string.h> |
20 | #include <stdlib.h> |
21 | |
22 | #ifdef __cplusplus |
23 | extern "C" { |
24 | #endif |
25 | |
26 | struct rfc822hdr { |
27 | char *header; |
28 | char *value; |
29 | |
30 | size_t hdrsize; |
31 | size_t maxsize; |
32 | } ; |
33 | |
34 | #define rfc822hdr_init(h,s) \ |
35 | do { memset((h), 0, sizeof(*h)); (h)->maxsize=(s); } while(0) |
36 | |
37 | #define rfc822hdr_free(h) \ |
38 | do { if ((h)->header) free ((h)->header); } while (0) |
39 | |
40 | int rfc822hdr_read(struct rfc822hdr *, FILE *, off_t *, off_t); |
41 | void rfc822hdr_fixname(struct rfc822hdr *); |
42 | void rfc822hdr_collapse(struct rfc822hdr *); |
43 | |
44 | #ifdef __cplusplus |
45 | } |
46 | #endif |
47 | |
48 | #endif |