From 138eeb350fe689f0cc3d69891bd7d08360f9d606 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Tue, 27 Mar 2018 08:54:14 +0200 Subject: [PATCH] structering the core some more --- core/core.c | 9 ++++++--- core/inotify.c | 10 ++++++---- core/inotify.h | 22 ++++++++++++++++++++++ core/log.c | 5 ++--- core/log.h | 3 ++- core/lsyncd.h | 8 -------- core/pipe.c | 5 +---- core/pipe.h | 4 +++- core/smem.c | 5 +---- core/smem.h | 4 +++- 10 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 core/inotify.h diff --git a/core/core.c b/core/core.c index e25e186..f2cb4be 100644 --- a/core/core.c +++ b/core/core.c @@ -1,8 +1,7 @@ /* -| core.c -| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| core.c from Lsyncd - Live (Mirror) Syncing Demon +| | -| This code assumes you have a 100 character wide display to view it (when tabstop is 4) | | License: GPLv2 (see COPYING) or any later version | Authors: Axel Kittenberger @@ -42,6 +41,10 @@ #include "smem.h" #include "pipe.h" +#ifdef WITH_INOTIFY +#include "inotify.h" +#endif + /* | The Lua part of Lsyncd */ diff --git a/core/inotify.c b/core/inotify.c index 699af66..6e4c721 100644 --- a/core/inotify.c +++ b/core/inotify.c @@ -1,13 +1,13 @@ /* | inotify.c from Lsyncd - Live (Mirror) Syncing Demon | +| +| Event interface for Lsyncd to Linux´ inotify. +| +| | License: GPLv2 (see COPYING) or any later version | | Authors: Axel Kittenberger -| -| ----------------------------------------------------------------------- -| -| Event interface for Lsyncd to Linux´ inotify. */ #include "lsyncd.h" @@ -38,6 +38,8 @@ #include "smem.h" #include "log.h" +#include "inotify.h" + /* | Event types. diff --git a/core/inotify.h b/core/inotify.h new file mode 100644 index 0000000..f588aa9 --- /dev/null +++ b/core/inotify.h @@ -0,0 +1,22 @@ +/* +| inotify.h from Lsyncd - Live (Mirror) Syncing Demon +| +| +| +| License: GPLv2 (see COPYING) or any later version +| Authors: Axel Kittenberger +*/ + +#ifndef LSYNCD_INOTIFY_H +#define LSYNCD_INOTIFY_H + +#ifndef WITH_INOTIFY +# error "Do not include inotify.h when not configured to use inotify." +#endif + +extern void register_inotify(lua_State *L); +extern void open_inotify(lua_State *L); + + +#endif + diff --git a/core/log.c b/core/log.c index a6742e6..fc2dd06 100644 --- a/core/log.c +++ b/core/log.c @@ -1,9 +1,8 @@ /* -| log.c -| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| log.c from Lsyncd - Live (Mirror) Syncing Demon | | -| Logging +| Logging. | | | This code assumes you have a 100 character wide display to view it (when tabstop is 4) diff --git a/core/log.h b/core/log.h index 64133fb..4225255 100644 --- a/core/log.h +++ b/core/log.h @@ -1,5 +1,6 @@ /* -| log.h +| log.h from Lsyncd - Live (Mirror) Syncing Demon +| | | Logging | diff --git a/core/lsyncd.h b/core/lsyncd.h index 324c6ef..bf55017 100644 --- a/core/lsyncd.h +++ b/core/lsyncd.h @@ -123,13 +123,5 @@ extern void observe_fd( extern void nonobserve_fd(int fd); -/* -* inotify -*/ -#ifdef WITH_INOTIFY -extern void register_inotify(lua_State *L); -extern void open_inotify(lua_State *L); -#endif - #endif diff --git a/core/pipe.c b/core/pipe.c index ac0a87c..903f6e8 100644 --- a/core/pipe.c +++ b/core/pipe.c @@ -1,13 +1,10 @@ /* -| pipe.c -| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| pipe.c from Lsyncd - Live (Mirror) Syncing Demon | | | Manages the pipes used to communicate with spawned subprocesses (usually rsync). | | -| This code assumes you have a 100 character wide display to view it (when tabstop is 4) -| | License: GPLv2 (see COPYING) or any later version | Authors: Axel Kittenberger */ diff --git a/core/pipe.h b/core/pipe.h index 76489fe..b2a948d 100644 --- a/core/pipe.h +++ b/core/pipe.h @@ -1,8 +1,10 @@ /* -| pipe.h +| pipe.h from Lsyncd - Live (Mirror) Syncing Demon +| | | Manages the pipes used to communicate with spawned subprocesses (usually rsync). | +| | License: GPLv2 (see COPYING) or any later version | Authors: Axel Kittenberger */ diff --git a/core/smem.c b/core/smem.c index 8cc0874..873323c 100644 --- a/core/smem.c +++ b/core/smem.c @@ -1,6 +1,5 @@ /* -| smem.c -| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| smem.c from Lsyncd - Live (Mirror) Syncing Demon | | | Simple "secured" memory management. @@ -11,8 +10,6 @@ | runs out of memory it goes instead into oom-killer mode. | | -| This code assumes you have a 100 character wide display to view it (when tabstop is 4) -| | License: GPLv2 (see COPYING) or any later version | Authors: Axel Kittenberger */ diff --git a/core/smem.h b/core/smem.h index eccff8c..8872f48 100644 --- a/core/smem.h +++ b/core/smem.h @@ -1,8 +1,10 @@ /* -| smem.h +| smem.h from Lsyncd - Live (Mirror) Syncing Demon +| | | Simple "secured" memory management. | +| | License: GPLv2 (see COPYING) or any later version | Authors: Axel Kittenberger */