1 #ifndef	rematchmsg_h
2 #define	rematchmsg_h
3 
4 static const char rematchmsg_h_rcsid[]="$Id: rematchmsg.h,v 1.2 1999/03/31 07:30:03 mrsam Exp $";
5 
6 class Message;
7 
8 #include	<sys/types.h>
9 // #include	<unistd.h>
10 #include	"rematch.h"
11 #include	"config.h"
12 
13 /////////////////////////////////////////////////////////////////////////////
14 //
15 // ReMatchMsg - match regular expression against the message directly.
16 //
17 // This class is derived from ReMatch, and is used when a regular expression
18 // should be matched against the message directly.
19 // It defines the virtual functions from ReMatch to go against the Message
20 // class itself.
21 //
22 // The constructor takes two flags:  headeronly, and mergelines.
23 // "headeronly" forces and end-of-file condition when a blank line is found
24 // in the message.  "mergelines" causes a newline character to be silently
25 // eaten, when it is immediately followed by a space.  The flags must be
26 // set as follows, in the following situations:
27 //
28 // A)  Match header and body:  mergelines is true, headeronly is false
29 // B)  Match header only:      mergelines is true, headeronly is true
30 // C)  Match body only:        mergelines is false, headeronly is false,
31 //                             also the message must be seeked to the
32 //                             start of the message contents.
33 //
34 /////////////////////////////////////////////////////////////////////////////
35 
36 class ReMatchMsg : public ReMatch {
37 	Message *msg;
38 
39 	int header_only, mergelines;
40 	int eof;
41 	int lastc;
42 
43 	off_t end_headers;
44 	off_t start;
45 public:
46 	ReMatchMsg(Message *m, int flag, int flag2);
47 	virtual ~ReMatchMsg();
48 
49 	int NextChar();
50 	int CurrentChar();
51 	off_t GetCurrentPos();
52 	void SetCurrentPos(off_t);
53 } ;
54 #endif
55