123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #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_FLAG_EXTENDED_RE 16
- #define TTAIL_FLAG_EXTENDED_CI 32
-
- #define TTAIL_DEFAULT_FORMATS {"%m",\
- "%A %B %d, %Y %H:%M:%S",\
- "%A",\
- "%B%n%d %H:%M:%S",\
- "%B%n%d %H:%M",\
- "%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;
- /*! An alternative to regex is to give a constant number of char
- to delete */
- int prefix_sz;
-
- /*! 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
|