+/*
+ * innduct
+ * tailing reliable realtime streaming feeder for inn
+ * filemon.c - file monitoring (inotify, kqueue, poll, etc.)
+ *
+ * Copyright (C) 2010 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ * This program 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
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * (I believe that when you compile and link this as part of the inn2
+ * build, with the Makefile runes I have provided, all the libraries
+ * and files which end up included in innduct are licence-compatible
+ * with GPLv3. If not then please let me know. -Ian Jackson.)
+ */
+
+#include "innduct.h"
+
/*---------- filemon implemented with inotify ----------*/
#if defined(HAVE_SYS_INOTIFY_H) && !defined(HAVE_FILEMON)
return OOP_CONTINUE;
}
-static int filemon_method_init(void) {
+int filemon_method_init(void) {
filemon_inotify_fd= inotify_init();
if (filemon_inotify_fd<0) {
syswarn("filemon/inotify: inotify_init failed");
return 1;
}
-static void filemon_method_dump_info(FILE *f) {
+void filemon_method_dump_info(FILE *f) {
int i;
fprintf(f,"inotify");
DUMPV("%d",,filemon_inotify_fd);
struct Filemon_Perfile { int dummy; };
-static int filemon_method_init(void) {
+int filemon_method_init(void) {
warn("filemon/dummy: no filemon method compiled in");
return 0;
}
static void filemon_method_startfile(InputFile *ipf, Filemon_Perfile *pf) { }
static void filemon_method_stopfile(InputFile *ipf, Filemon_Perfile *pf) { }
-static void filemon_method_dump_info(FILE *f) { fprintf(f,"dummy\n"); }
+void filemon_method_dump_info(FILE *f) { fprintf(f,"dummy\n"); }
#endif /* !HAVE_FILEMON */
/*---------- filemon generic interface ----------*/
-static void filemon_start(InputFile *ipf) {
+void filemon_start(InputFile *ipf) {
assert(!ipf->filemon);
NEW(ipf->filemon);
filemon_method_startfile(ipf, ipf->filemon);
}
-static void filemon_stop(InputFile *ipf) {
+void filemon_stop(InputFile *ipf) {
if (!ipf->filemon) return;
filemon_method_stopfile(ipf, ipf->filemon);
free(ipf->filemon);