Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / rfc822 / rfc822hdr.h
1 /*
2 ** $Id: rfc822hdr.h,v 1.4 2009/11/08 18:14:47 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.4 2009/11/08 18:14:47 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 int rfc822hdr_is_addr(const char *hdr);
45
46 #ifdef __cplusplus
47 }
48 #endif
49
50 #endif