summaryrefslogtreecommitdiff
path: root/inotail.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2008-03-01 12:00:59 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2008-03-01 12:00:59 +0100
commit66911157cfad3ccb5e24c11c77d3b0ff3252abd3 (patch)
tree0dc7157f041ddc0d6ba556cae6bc71c55bad6ff2 /inotail.h
parente7bbc35c92f98d24088c854eea3f08d94be9c966 (diff)
Move all #define's except PROGRAM_NAME to inotail.h
Diffstat (limited to 'inotail.h')
-rw-r--r--inotail.h17
1 files changed, 11 insertions, 6 deletions
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 <sys/types.h>
+#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 */