// @(#)header.hh 1.3 93/08/01 // // Contains definitions for class "Header". // // Copyright (c) Steve Holden and Rich Burridge. // All rights reserved. // // Permission is given to distribute these sources, as long as the // copyright messages are not removed, and no monies are exchanged. // // No responsibility is taken for any errors or inaccuracies inherent // either to the comments or the code of this program, but if // reported to me then an attempt will be made to fix them. #define POSTSCRIPT_MAGIC "%!" // First line of PS file. #define FROMHDR "From:" #define FROM_HDR "From " // UNIX From header. #define APP_FROMHDR "Apparently-From:" #define TOHDR "To:" #define APP_TOHDR "Apparently-To:" #define CCHDR "Cc:" #define SUBJECTHDR "Subject:" #define DATEHDR "Date:" #define NEWSGROUPSHDR "Newsgroups:" #define NEWSGROUPHDR "Newsgroup:" #define REPLYHDR "Reply-To:" #define CONTENT_LEN "Content-Length:" #define MAXCONT 10 // Maximum no of continuation header lines. class Header { public: char *from ; // From: char *from_ ; // From_ (UNIX from) char *app_from ; // Apparently_from: char *to[MAXCONT+1] ; // To: (can have multiple lines) char *app_to ; // Apparently_to: char *cc[MAXCONT+1] ; // Cc: (can have multiple lines) char *subject ; // Subject: (can be set from command line) char *gsubject ; // Global subject set from command line. char *date ; // Date: char *newsgroups ; // Newsgroups: (news articles only) char *reply_to ; // Reply-to: char *content_len ; // Content-Length: Header () ; int hdr_equal (char *) ; void parse_headers (int) ; void reset_headers (void) ; void show_headers (int) ; private: int emptyline (char *) ; int toprint (char *, char *) ; void get_extra_hdrs (void) ; void get_header (char *, char **) ; void get_mult_hdr (char *, char **) ; void print_extra (void) ; void show_mult_hdr (char *, char **) ; } ;