Imported Upstream version 0.66.1
[hcoop/debian/courier-authlib.git] / libs / rfc822 / rfc822hdr.h
1 /*
2 */
3 #ifndef rfc822hdr_h
4 #define rfc822hdr_h
5
6 /*
7 ** Copyright 2001 Double Precision, Inc.
8 ** See COPYING for distribution information.
9 */
10
11
12 #if HAVE_CONFIG_H
13 #include "rfc822/config.h"
14 #endif
15 #include <sys/types.h>
16 #include <stdio.h>
17 #include <string.h>
18 #include <stdlib.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 struct rfc822hdr {
25 char *header;
26 char *value;
27
28 size_t hdrsize;
29 size_t maxsize;
30 } ;
31
32 #define rfc822hdr_init(h,s) \
33 do { memset((h), 0, sizeof(*h)); (h)->maxsize=(s); } while(0)
34
35 #define rfc822hdr_free(h) \
36 do { if ((h)->header) free ((h)->header); } while (0)
37
38 int rfc822hdr_read(struct rfc822hdr *, FILE *, off_t *, off_t);
39 void rfc822hdr_fixname(struct rfc822hdr *);
40 void rfc822hdr_collapse(struct rfc822hdr *);
41
42 int rfc822hdr_namecmp(const char *a, const char *b);
43 int rfc822hdr_is_addr(const char *hdr);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49 #endif