clsync
main.h
Go to the documentation of this file.
1 /*
2  clsync - file tree sync utility based on fanotify and inotify
3 
4  Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 extern int ncpus;
21 extern pid_t parent_pid;
22 extern int argc;
23 extern char *argv[];
24 
25 extern int main_rehash ( ctx_t *ctx_p );
26 extern int main_status_update ( ctx_t *ctx_p );
27 extern int ctx_set ( ctx_t *ctx_p, const char *const parameter_name, const char *const parameter_value );
28 extern int config_block_parse ( ctx_t *ctx_p, const char *const config_block_name );
29 extern int rules_count ( ctx_t *ctx_p );
30 /* Parameter exception flags */
31 #define PEF_NONE 0
32 #define PEF_UNEXPECTED_END 1
33 #define PEF_UNSET_VARIABLE 2
34 #define PEF_LAZY_SUBSTITUTION 4
35 extern char *parameter_expand (
36  ctx_t *ctx_p,
37  char *arg,
38  int exceptionflags,
39  int *macros_count_p,
40  int *expand_count_p,
41  const char * ( *parameter_get ) ( const char *variable_name, void *arg ),
42  void *parameter_get_arg
43 );
44 extern pid_t fork_helper();
45 extern int parent_isalive();
46 extern int sethandler_sigchld ( void ( *handler ) () );
47 extern pid_t waitpid_timed ( pid_t child_pid, int *status_p, long sec, long nsec );
48 
49 #define exit_on(cond) { debug(30, "exit_on: checking: %s", TOSTR(cond)); if (unlikely(cond)) { debug(1, "Exiting due to: "TOSTR(cond)); exit(0); } }
50 
sethandler_sigchld
int sethandler_sigchld(void(*handler)())
Definition: main.c:440
parent_isalive
int parent_isalive()
Definition: main.c:415
ctx
Definition: ctx.h:315
main_rehash
int main_rehash(ctx_t *ctx_p)
Definition: main.c:2653
parameter_get
const char * parameter_get(const char *variable_name, void *_ctx_p)
Gets raw (string) an option value by an option name.
Definition: main.c:565
argc
int argc
Definition: main.c:2724
waitpid_timed
pid_t waitpid_timed(pid_t child_pid, int *status_p, long sec, long nsec)
Definition: main.c:388
parameter_expand
char * parameter_expand(ctx_t *ctx_p, char *arg, int exceptionflags, int *macros_count_p, int *expand_count_p, const char *(*parameter_get)(const char *variable_name, void *arg), void *parameter_get_arg)
Expands option values, e. g. "/var/log/clsync-%label%.pid" -> "/var/log/clsync-clone....
Definition: main.c:693
ncpus
int ncpus
Definition: main.c:385
config_block_parse
int config_block_parse(ctx_t *ctx_p, const char *const config_block_name)
Definition: main.c:2547
rules_count
int rules_count(ctx_t *ctx_p)
main_status_update
int main_status_update(ctx_t *ctx_p)
Definition: main.c:2673
fork_helper
pid_t fork_helper()
Definition: main.c:463
argv
char * argv[]
Definition: main.c:2725
parent_pid
pid_t parent_pid
Definition: main.c:386
ctx_set
int ctx_set(ctx_t *ctx_p, const char *const parameter_name, const char *const parameter_value)
Definition: main.c:2560
ctx_p
ctx_t * ctx_p
Definition: mon_kqueue.c:85