clsync
Loading...
Searching...
No Matches
clsync.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
Include dependency graph for clsync.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  api_eventinfo
 

Macros

#define CLSYNC_API_VERSION   2
 

Typedefs

typedef enum eventobjtype eventobjtype_t
 
typedef struct api_eventinfo api_eventinfo_t
 
typedef int(* api_funct_init) (struct ctx *, struct indexes *)
 
typedef int(* api_funct_sync) (int n, api_eventinfo_t *)
 
typedef int(* api_funct_rsync) (const char *inclist, const char *exclist)
 
typedef int(* api_funct_deinit) ()
 
typedef enum eventinfo_flags eventinfo_flags_t
 

Enumerations

enum  eventobjtype { EOT_UNKNOWN = 0 , EOT_DOESNTEXIST = 1 , EOT_FILE = 2 , EOT_DIR = 3 }
 
enum  eventinfo_flags { EVIF_NONE = 0x00000000 , EVIF_RECURSIVELY = 0x00000001 , EVIF_CONTENTRECURSIVELY = 0x00000002 }
 

Functions

int apievinfo2rsynclist (struct indexes *indexes_p, FILE *listfile, int n, api_eventinfo_t *apievinfo)
 Writes the list to list-file for "--include-from" option of rsync using array of api_eventinfo_t.
 
int clsyncapi_getapiversion ()
 Returns currect API version.
 
pid_t clsyncapi_fork (struct ctx *ctx_p)
 clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.
 

Macro Definition Documentation

◆ CLSYNC_API_VERSION

#define CLSYNC_API_VERSION   2

Definition at line 27 of file clsync.h.

Typedef Documentation

◆ api_eventinfo_t

Definition at line 47 of file clsync.h.

◆ api_funct_deinit

typedef int(* api_funct_deinit) ()

Definition at line 54 of file clsync.h.

◆ api_funct_init

typedef int(* api_funct_init) (struct ctx *, struct indexes *)

Definition at line 51 of file clsync.h.

◆ api_funct_rsync

typedef int(* api_funct_rsync) (const char *inclist, const char *exclist)

Definition at line 53 of file clsync.h.

◆ api_funct_sync

typedef int(* api_funct_sync) (int n, api_eventinfo_t *)

Definition at line 52 of file clsync.h.

◆ eventinfo_flags_t

Definition at line 61 of file clsync.h.

◆ eventobjtype_t

Definition at line 37 of file clsync.h.

Enumeration Type Documentation

◆ eventinfo_flags

Enumerator
EVIF_NONE 
EVIF_RECURSIVELY 
EVIF_CONTENTRECURSIVELY 

Definition at line 56 of file clsync.h.

◆ eventobjtype

Enumerator
EOT_UNKNOWN 
EOT_DOESNTEXIST 
EOT_FILE 
EOT_DIR 

Definition at line 29 of file clsync.h.

Function Documentation

◆ apievinfo2rsynclist()

int apievinfo2rsynclist ( struct indexes * indexes_p,
FILE * listfile,
int n,
api_eventinfo_t * apievinfo )
extern

Writes the list to list-file for "--include-from" option of rsync using array of api_eventinfo_t.

Parameters
[in]indexes_pPointer to "indexes"
[in]listfileFile identifier to write to
[in]nNumber of records in apievinfo
[in]apievinfoPointer to api_eventinfo_t records
Return values
zeroSuccessful
non-zeroIf got error while deleting the message. The error-code is placed into returned value.

Definition at line 3171 of file sync.c.

Here is the call graph for this function:

◆ clsyncapi_fork()

pid_t clsyncapi_fork ( struct ctx * ctx_p)
extern

clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.

Parameters
[in]ctx_pPointer to "ctx"
Return values
-1If error (see "man 2 fork", added error code "ECANCELED" if too many children)
0If child
pidPid of child of parent. (see "man 2 fork")

Definition at line 1060 of file sync.c.

◆ clsyncapi_getapiversion()

int clsyncapi_getapiversion ( )
extern

Returns currect API version.

Return values
api_versionVersion of clsync's API

Definition at line 550 of file main.c.