Small Application C

#include
#include
#define IN 1
#define OUT 0
#define MAX 1024
void header(FILE *fp);
void body(FILE *fp);
char line[MAX];
int state = 0;
int main(int argc, char *argv[]) {
(argc == 2) && (strcmp(argv[1], "-b") == 0) ?
body(stdin) : header(stdin);
return 0;
}
void header(FILE *fp) {
while((fgets(line, MAX, fp)) != NULL) {
if(strstr(line, "From ")) (state = IN);
(state == IN && strlen(line) > 1) ? printf("%s", line) : (state = OUT);
}
}
void body(FILE *fp) {
while((fgets(line, MAX, fp)) != NULL) {
if(strstr(line, "From ")) (state = OUT);
if(state == OUT && strlen(line) < 2) (state = IN);
if(state == IN) printf("%s", line);
}
}