12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef _ttail_h__
- #define _ttail_h__
-
- #include <errno.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <getopt.h>
- #include <time.h>
- #include <regex.h>
- #include <sys/types.h>
-
-
- 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;
- int date_prefix_flag;
-
- /*! A strptime format matching datetime in logfile */
- char *fmt;
-
- int verbose;
- };
- typedef struct _ttail_s ttail_t;
-
-
- /**@brief Parse cli arguments and return a ttail_t
- *@param int argc
- *@param char** argv
- *@return NULL on error
- */
- ttail_t *ttail_init(int argc, char **argv);
-
- /**@brief Add a logfile
- *@param ttail_t*
- *@param const char * filename
- *@return 0 if no errors -1 if fatal error
- */
- int ttail_add_logfile(ttail_t*, const char*);
-
- /**@brief Set a date prefix regex
- *@param ttail_t*
- *@param const char * regex
- *@return 0 if no errors
- */
- int ttail_set_prefix(ttail_t*, const char*);
-
- void ttail_free(ttail_t*);
-
-
- #endif
|