From 66911157cfad3ccb5e24c11c77d3b0ff3252abd3 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 1 Mar 2008 12:00:59 +0100 Subject: Move all #define's except PROGRAM_NAME to inotail.h --- inotail.c | 6 ------ inotail.h | 17 +++++++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/inotail.c b/inotail.c index 24c1404..c19ed4f 100644 --- a/inotail.c +++ b/inotail.c @@ -35,20 +35,14 @@ #include "inotify.h" #include "inotify-syscalls.h" - #include "inotail.h" #define PROGRAM_NAME "inotail" -#define DEFAULT_BUFFER_SIZE 4096 -/* inotify event buffer length for one file */ -#define INOTIFY_BUFLEN (4 * sizeof(struct inotify_event)) /* Print header with filename before tailing the file? */ static char verbose = 0; - /* Tailing relative to begin or end of file */ static char from_begin = 0; - /* Number of ignored files */ static int n_ignored = 0; diff --git a/inotail.h b/inotail.h index aa2a0fa..ff77b26 100644 --- a/inotail.h +++ b/inotail.h @@ -8,10 +8,15 @@ #define _INOTAIL_H #include +#include "inotify.h" /* Number of items to tail. */ #define DEFAULT_N_LINES 10 +#define DEFAULT_BUFFER_SIZE 4096 +/* inotify event buffer length for one file */ +#define INOTIFY_BUFLEN (4 * sizeof(struct inotify_event)) + /* tail modes */ typedef enum { M_LINES, M_BYTES } mode_t; @@ -34,16 +39,16 @@ struct file_struct { #define is_digit(c) ((c) >= '0' && (c) <= '9') -#ifdef DEBUG -# define dprintf(fmt, args...) fprintf(stderr, fmt, ##args) -#else -# define dprintf(fmt, args...) -#endif /* DEBUG */ - #ifdef __GNUC__ # define unlikely(x) __builtin_expect(!!(x), 0) #else # define unlikely(x) (x) #endif /* __GNUC__ */ +#ifdef DEBUG +# define dprintf(fmt, args...) fprintf(stderr, fmt, ##args) +#else +# define dprintf(fmt, args...) +#endif /* DEBUG */ + #endif /* _INOTAIL_H */ -- cgit v1.2.3-54-g00ecf