mess822x 1.23
mess822x
Loading...
Searching...
No Matches
822body.c
Go to the documentation of this file.
1#include "buffer.h"
2#include "logmsg.h"
3#include "getln.h"
4#include "mess822.h"
5#include "exit.h"
6
7#define WHO "822body"
8
9stralloc line = {0};
11
12int main(int argc,char **argv)
13{
14 for (;;) {
15 if (getln(buffer_0,&line,&match,'\n') == -1)
16 logmsg(WHO,111,FATAL,"unable to read input: ");
17 if (!mess822_ok(&line)) break;
18 }
19
20 if (match && line.len > 1)
21 logmsg(WHO,111,ERROR,"malformed message (first non-header line not blank)");
22
23 for (;;) {
24 if (getln(buffer_0,&line,&match,'\n') == -1)
25 logmsg(WHO,111,FATAL,"unable to read input: ");
26 buffer_put(buffer_1,line.s,line.len);
27 if (!match) break;
28 }
29
30 buffer_flush(buffer_1);
31 _exit(0);
32}
int main()
Definition: 822print.c:351
stralloc line
Definition: 822body.c:9
int match
Definition: 822body.c:10
#define WHO
Definition: 822body.c:7
int mess822_ok(stralloc *)
Definition: mess822_ok.c:4