Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / rfc822 / rfc822hdr.h
CommitLineData
d9898ee8 1/*
8d138742 2** $Id: rfc822hdr.h,v 1.4 2009/11/08 18:14:47 mrsam Exp $
d9898ee8 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
8d138742 12static const char rfc822hdr_h_rcsid[]="$Id: rfc822hdr.h,v 1.4 2009/11/08 18:14:47 mrsam Exp $";
d9898ee8 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
23extern "C" {
24#endif
25
26struct 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
40int rfc822hdr_read(struct rfc822hdr *, FILE *, off_t *, off_t);
41void rfc822hdr_fixname(struct rfc822hdr *);
42void rfc822hdr_collapse(struct rfc822hdr *);
43
8d138742
CE
44int rfc822hdr_is_addr(const char *hdr);
45
d9898ee8 46#ifdef __cplusplus
47}
48#endif
49
50#endif