#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <eps.h>

int main(int argc, char *argv[])
{
  char *l = NULL;
  int ret = 0, fd = 0;
  eps_t *eps = NULL;
  header_t *h = NULL;

  fd = 0;

  if (argc > 1) {
     fd = open(argv[1], O_RDONLY);
     if (fd == -1)
        return 1;
  }

  eps = eps_begin(INTERFACE_STREAM, &fd);
  if (!eps)
     return 1; 

  /*
     Skip the headers
  */
  for (h = eps_next_header(eps); h; h = eps_next_header(eps));

  for (l = eps_next_line(eps); l; l = eps_next_line(eps))
      printf("BODY: %s\n", l);  

  eps_end(eps);  
  return 0;
}


syntax highlighted by Code2HTML, v. 0.9.1