Back to index

courier  0.68.2
rfc822hdr.h
Go to the documentation of this file.
00001 /*
00002 */
00003 #ifndef       rfc822hdr_h
00004 #define       rfc822hdr_h
00005 
00006 /*
00007 ** Copyright 2001 Double Precision, Inc.
00008 ** See COPYING for distribution information.
00009 */
00010 
00011 
00012 #if    HAVE_CONFIG_H
00013 #include      "../rfc822/config.h"
00014 #endif
00015 #include      <sys/types.h>
00016 #include      <stdio.h>
00017 #include      <string.h>
00018 #include      <stdlib.h>
00019 
00020 #ifdef  __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 struct rfc822hdr {
00025        char *header;
00026        char *value;
00027 
00028        size_t hdrsize;
00029        size_t maxsize;
00030 } ;
00031 
00032 #define rfc822hdr_init(h,s) \
00033        do { memset((h), 0, sizeof(*h)); (h)->maxsize=(s); } while(0)
00034 
00035 #define rfc822hdr_free(h) \
00036    do { if ((h)->header) free ((h)->header); } while (0)
00037 
00038 int rfc822hdr_read(struct rfc822hdr *, FILE *, off_t *, off_t);
00039 void rfc822hdr_fixname(struct rfc822hdr *);
00040 void rfc822hdr_collapse(struct rfc822hdr *);
00041 
00042 int rfc822hdr_namecmp(const char *a, const char *b);
00043 int rfc822hdr_is_addr(const char *hdr);
00044 
00045 #ifdef  __cplusplus
00046 }
00047 #endif
00048 
00049 #endif