/usr/include/libclsync/clsync.h is in libclsync-dev 0.4.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | /*
clsync - file tree sync utility based on inotify
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CLSYNC_CLSYNC_H
#define __CLSYNC_CLSYNC_H
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#define CLSYNC_API_VERSION 2
enum eventobjtype {
EOT_UNKNOWN = 0, // Unknown
EOT_DOESNTEXIST = 1, // Doesn't exists (not created yet or already deleted)
EOT_FILE = 2, // File
EOT_DIR = 3, // Directory
// The value cannot be higher than "65535". It's due to recognize_event() function of mon_*.c
};
typedef enum eventobjtype eventobjtype_t;
struct api_eventinfo {
uint32_t evmask; // event mask, see /usr/include/linux/inotify.h
uint32_t flags; // flags, see "enum eventinfo_flags"
size_t path_len; // strlen(path)
const char *path; // path
eventobjtype_t objtype_old; // type of object by path "path" before the event
eventobjtype_t objtype_new; // type of object by path "path" after the event
};
typedef struct api_eventinfo api_eventinfo_t;
struct ctx;
struct indexes;
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)();
enum eventinfo_flags {
EVIF_NONE = 0x00000000, // No modifier
EVIF_RECURSIVELY = 0x00000001, // Need to be synced recursively
EVIF_CONTENTRECURSIVELY = 0x00000002, // Affects recursively only on content of this dir
};
typedef enum eventinfo_flags eventinfo_flags_t;
/**
* @brief Writes the list to list-file for "--include-from" option of rsync using array of api_eventinfo_t
*
* @param[in] indexes_p Pointer to "indexes"
* @param[in] listfile File identifier to write to
* @param[in] n Number of records in apievinfo
* @param[in] apievinfo Pointer to api_eventinfo_t records
*
* @retval zero Successful
* @retval non-zero If got error while deleting the message. The error-code is placed into returned value.
*
*/
extern int apievinfo2rsynclist(struct indexes *indexes_p, FILE *listfile, int n, api_eventinfo_t *apievinfo); // Not tested, yet
/**
* @brief Returns currect API version
*
* @retval api_version Version of clsync's API
*
*/
extern int clsyncapi_getapiversion();
/**
* @brief clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.
*
* @param[in] ctx_p Pointer to "ctx"
*
* @retval -1 If error (see "man 2 fork", added error code "ECANCELED" if too many children)
* @retval 0 If child
* @retval pid Pid of child of parent. (see "man 2 fork")
*
*/
extern pid_t clsyncapi_fork(struct ctx *ctx_p);
#endif
|