timed tail for logfiles. Display loglines given a minimum date and/or a maximum date.
c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.c 592B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "include/ttail.h"
  2. #include "include/ttail_init.h"
  3. /**@mainpage
  4. *
  5. *Super options : -d -r -p -v -m
  6. */
  7. int main(int argc, char **argv)
  8. {
  9. int res;
  10. ttail_t *ttail;
  11. if(!(ttail = ttail_init(argc, argv)))
  12. {
  13. usage();
  14. return 1;
  15. }
  16. if(ttail_init_check(ttail) < 0)
  17. {
  18. usage();
  19. ttail_free(ttail);
  20. return 1;
  21. }
  22. res = ttail_search_closest(ttail);
  23. if(res < 0)
  24. {
  25. fprintf(stderr, "Error while searching through files\n");
  26. return 1;
  27. }
  28. else if (res == 1)
  29. {
  30. return 0; /* not found, no line to print */
  31. }
  32. ttail_search_print_res(ttail);
  33. ttail_free(ttail);
  34. return res;
  35. }