12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef _ttail_h__
- #define _ttail_h__
-
- #include <ctype.h>
- #include <errno.h>
- #include <getopt.h>
- #include <regex.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <sys/types.h>
- #include <time.h>
- #include <unistd.h>
-
- typedef struct _ttail_s ttail_t;
-
- #include "config.h"
- #include "ttail_search.h"
-
- #define TTAIL_FLAG_PREFIX 1
- #define TTAIL_FLAG_DATE_MIN 2
- #define TTAIL_FLAG_DATE_MAX 4
- #define TTAIL_FLAG_FORMAT 8
- #define TTAIL_DEFAULT_FORMATS {"%m", "%A %B %d, %Y %H:%M:%S", "%A", "%B", \
- "%m/%d/%y %I %p", "%d,%m,%Y %H:%M", "at %A the %dst of %B in %Y",\
- "run job at %I %p,%B %dnd", "%A den %d. %B %Y %H.%M Uhr",\
- "%c", "%y/%m/%d", "%Y/%m/%d", "%y-%m-%d", "%Y/%m/%d:%H:%M",NULL}
-
- struct _ttail_s
- {
- char **logfile_name; /*!< logfiles name */
- FILE **logfile; /*!< logfiles pointers */
- size_t logfile_sz; /*<! logfiles count */
-
- /*! A regex matching the datetime prefix in loglines */
- regex_t date_prefix;
-
- /*! A strptime format matching datetime in logfile */
- char *fmt;
-
- /*! Date min set from cli */
- struct tm date_min;
- struct tm date_max;
-
- int verbose;
- /**@brief Status flag
- *
- *see TTAIL_FLAG_*
- */
- int flag;
-
- ttail_search_t *session;
- };
-
- #endif
|