12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /*
- * Copyright 2017 Yann Weber
- *
- * This file is part of Ttail.
- *
- * Ttail is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Ttail is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Ttail. If not, see <http://www.gnu.org/licenses/>.
- */
- #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_CI_RE 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
|