mirror of https://github.com/octoleo/lsyncd.git
structering the core some more
This commit is contained in:
parent
5d6730b1bb
commit
117f2cb088
|
@ -42,6 +42,7 @@
|
|||
#include "util.h"
|
||||
#include "pipe.h"
|
||||
#include "observe.h"
|
||||
#include "time.h"
|
||||
|
||||
#ifdef WITH_INOTIFY
|
||||
#include "inotify.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "log.h"
|
||||
#include "inotify.h"
|
||||
#include "observe.h"
|
||||
#include "time.h"
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -18,4 +18,3 @@ extern void register_inotify(lua_State *L);
|
|||
extern void open_inotify(lua_State *L);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
| License: GPLv2 (see COPYING) or any later version
|
||||
| Authors: Axel Kittenberger <axkibe@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef LSYNCD_LOG_H
|
||||
#define LSYNCD_LOG_H
|
||||
|
||||
|
@ -42,4 +41,3 @@ printlogf0(
|
|||
extern void log_free( );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -58,23 +58,6 @@ extern struct settings {
|
|||
} settings;
|
||||
|
||||
|
||||
/*
|
||||
* time comparisons - wrap around safe
|
||||
*/
|
||||
#define time_after(a,b) ((long)(b) - (long)(a) < 0)
|
||||
#define time_before(a,b) time_after(b,a)
|
||||
#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0)
|
||||
#define time_before_eq(a,b) time_after_eq(b,a)
|
||||
|
||||
// Returns the current time.
|
||||
extern clock_t now( );
|
||||
|
||||
// Returns (on Lua stack) the current kernels clock state( jiffies ).
|
||||
extern int l_now(lua_State *L);
|
||||
|
||||
// Registers the jiffies meta table in a Lua state.
|
||||
extern void register_jiffies( lua_State *L );
|
||||
|
||||
// Pushes a runner function and the runner error handler onto Lua stack
|
||||
extern void load_mci(lua_State *L, const char *name);
|
||||
|
||||
|
@ -84,4 +67,3 @@ extern volatile sig_atomic_t term;
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -17,4 +17,3 @@ extern void * s_realloc( void *ptr, size_t size );
|
|||
extern char * s_strdup( const char *src );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,4 +36,3 @@ extern void observe_tidy_all( );
|
|||
extern void nonobserve_fd( int fd );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -31,4 +31,3 @@ extern void pipe_write(
|
|||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
18
core/util.h
18
core/util.h
|
@ -11,24 +11,14 @@
|
|||
#ifndef LSYNCD_UTIL_H
|
||||
#define LSYNCD_UTIL_H
|
||||
|
||||
/*
|
||||
| Returns the absolute path of a path.
|
||||
|
|
||||
| This is a wrapper to various C-Library differences.
|
||||
*/
|
||||
// Returns the absolute path of a path.
|
||||
// This is a wrapper to various C-Library differences.
|
||||
extern char * get_realpath( char const * rpath );
|
||||
|
||||
|
||||
/*
|
||||
| Sets the non-blocking flag on a file descriptor.
|
||||
*/
|
||||
// Sets the non-blocking flag on a file descriptor.
|
||||
extern void non_block_fd( int fd );
|
||||
|
||||
|
||||
/*
|
||||
| Sets the close-on-exit flag on a file descriptor.
|
||||
*/
|
||||
// Sets the close-on-exit flag on a file descriptor.
|
||||
extern void close_exec_fd( int fd );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue