clsync
Macros | Functions | Variables
main.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PEF_NONE   0
 
#define PEF_UNEXPECTED_END   1
 
#define PEF_UNSET_VARIABLE   2
 
#define PEF_LAZY_SUBSTITUTION   4
 
#define exit_on(cond)   { debug(30, "exit_on: checking: %s", TOSTR(cond)); if (unlikely(cond)) { debug(1, "Exiting due to: "TOSTR(cond)); exit(0); } }
 

Functions

int main_rehash (ctx_t *ctx_p)
 
int main_status_update (ctx_t *ctx_p)
 
int ctx_set (ctx_t *ctx_p, const char *const parameter_name, const char *const parameter_value)
 
int config_block_parse (ctx_t *ctx_p, const char *const config_block_name)
 
int rules_count (ctx_t *ctx_p)
 
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.pid". More...
 
pid_t fork_helper ()
 
int parent_isalive ()
 
int sethandler_sigchld (void(*handler)())
 
pid_t waitpid_timed (pid_t child_pid, int *status_p, long sec, long nsec)
 

Variables

int ncpus
 
pid_t parent_pid
 
int argc
 
char * argv []
 

Macro Definition Documentation

◆ exit_on

#define exit_on (   cond)    { debug(30, "exit_on: checking: %s", TOSTR(cond)); if (unlikely(cond)) { debug(1, "Exiting due to: "TOSTR(cond)); exit(0); } }

Definition at line 49 of file main.h.

◆ PEF_LAZY_SUBSTITUTION

#define PEF_LAZY_SUBSTITUTION   4

Definition at line 34 of file main.h.

◆ PEF_NONE

#define PEF_NONE   0

Definition at line 31 of file main.h.

◆ PEF_UNEXPECTED_END

#define PEF_UNEXPECTED_END   1

Definition at line 32 of file main.h.

◆ PEF_UNSET_VARIABLE

#define PEF_UNSET_VARIABLE   2

Definition at line 33 of file main.h.

Function Documentation

◆ config_block_parse()

int config_block_parse ( ctx_t ctx_p,
const char *const  config_block_name 
)

Definition at line 2547 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctx_set()

int ctx_set ( ctx_t ctx_p,
const char *const  parameter_name,
const char *const  parameter_value 
)

Definition at line 2560 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fork_helper()

pid_t fork_helper ( )

Definition at line 463 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_rehash()

int main_rehash ( ctx_t ctx_p)

Definition at line 2653 of file main.c.

Here is the call graph for this function:

◆ main_status_update()

int main_status_update ( ctx_t ctx_p)

Definition at line 2673 of file main.c.

◆ parameter_expand()

char* parameter_expand ( ctx_t ctx_p,
char *  arg,
int  exceptionflags,
int *  macro_count_p,
int *  expand_count_p,
const char *(*)(const char *variable_name, void *arg)  parameter_get,
void *  parameter_get_arg 
)

Expands option values, e. g. "/var/log/clsync-%label%.pid" -> "/var/log/clsync-clone.pid".

Parameters
[in]ctx_pContext
[in]argAn allocated string with unexpanded value. Will be free'd
[in]exceptionflagsA bit field of allowed exceptions during parameter expansion:
  • PEF_NONE No exceptions are allowed
  • PEF_UNEXPECTED_END Do not warn about unexpected end of macro-substitution
  • PEF_UNSET_VARIABLE Do not warn about unset variable
  • PEF_LAZY_SUBSTITUTION Perform lazy substitution preserving original value
[out]macro_count_pA pointer to count of found macro-s
[out]expand_count_pA pointer to count of expanded macro-s
[in]parameter_getA function to resolve macro-s
[in]parameter_get_argAn argument to the function
Return values
char* Pointer to newly allocated string, if successful
NULLOn error

Definition at line 693 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parent_isalive()

int parent_isalive ( )

Definition at line 415 of file main.c.

◆ rules_count()

int rules_count ( ctx_t ctx_p)

◆ sethandler_sigchld()

int sethandler_sigchld ( void(*)()  handler)

Definition at line 440 of file main.c.

Here is the caller graph for this function:

◆ waitpid_timed()

pid_t waitpid_timed ( pid_t  child_pid,
int *  status_p,
long  sec,
long  nsec 
)

Definition at line 388 of file main.c.

Here is the caller graph for this function:

Variable Documentation

◆ argc

int argc

Definition at line 2724 of file main.c.

◆ argv

char* argv[]

Definition at line 2725 of file main.c.

◆ ncpus

int ncpus

Definition at line 385 of file main.c.

◆ parent_pid

pid_t parent_pid

Definition at line 386 of file main.c.