summaryrefslogtreecommitdiff
path: root/inotail.h
diff options
context:
space:
mode:
Diffstat (limited to 'inotail.h')
-rw-r--r--inotail.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/inotail.h b/inotail.h
index 5029540..ea680cb 100644
--- a/inotail.h
+++ b/inotail.h
@@ -8,11 +8,16 @@
#define _INOTAIL_H
#include <sys/types.h>
+#include "inotify.h"
#define DEFAULT_N_LINES 10 /* Number of items to tail. */
+#define DEFAULT_BUFFER_SIZE 4096
+/* inotify event buffer length for one file */
+#define INOTIFY_BUFLEN (4 * sizeof(struct inotify_event))
+
/* tail modes */
-enum { M_LINES, M_BYTES };
+typedef enum { M_LINES, M_BYTES } mode_t;
/* Every tailed file is represented as a file_struct */
struct file_struct {
@@ -48,16 +53,16 @@ struct char_buf {
#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 */