Annotation of libaitsync/inc/aitsync.h, revision 1.1.1.1
1.1 misho 1: /*************************************************************************
2: * (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
3: * by Michael Pounov <misho@openbsd-bg.org>
4: *
5: * $Author: misho $
6: * $Id: aitcrc.h,v 1.1.1.1.2.1 2008/11/05 17:29:19 misho Exp $
7: *
8: *************************************************************************/
9: #ifndef __AITSYNC_H
10: #define __AITSYNC_H
11:
12:
13: #include <sys/types.h>
14: #include <openssl/md5.h>
15:
16:
17: #define CHUNK_MAX 2048
18: #define DLTSYNC_MAGIC 0xD34DC0D3
19: #define SIGSYNC_MAGIC 0xDEADBEEF
20:
21:
22: typedef struct tagSyncChunk {
23: u_int sc_magic;
24: u_long sc_id;
25: off_t sc_off;
26: size_t sc_len;
27: u_int sc_roll;
28: u_char sc_cksum[MD5_DIGEST_LENGTH];
29: } sync_chunk_t;
30:
31:
32: // -------------------------------------------------------
33: // sync_GetErrno() Get error code of last operation
34: inline int sync_GetErrno();
35: // sync_GetError() Get error text of last operation
36: inline const char *sync_GetError();
37: // -------------------------------------------------------
38:
39: /*
40: * syncSignature() Calculate and create signature for diff
41: * @csInput = Input patched file name for calculating check sums
42: * @csSig = Output Signature file name
43: * return: -1 error, 0 ok
44: */
45: int syncSignature(const char *csInput, const char *csSig);
46:
47: /*
48: * syncDelta() Create Delta patch file
49: * @csInput = Input original source file name for make delta patch file
50: * @csSig = Input Signature file name
51: * @csDelta = Output Delta patch file name
52: * @compress = Compress output, 0 not compressed
53: * return: -1 error, 0 ok, create delta patch, 1 ok, no differences and not create patch
54: */
55: int syncDelta(const char *csInput, const char *csSig, const char *csDelta, int compress);
56:
57: /*
58: * syncPatch() Apply delta patch file to target
59: * @csInput = Input target file name for patch
60: * @csDelta = Input Delta patch file name
61: * @csPatch = After applied patch create new alternate target file, if != NULL
62: * @compress = Compress output, 0 not compressed
63: * return: -1 error, 0 ok, create delta patch, 1 ok, no differences and not create patch
64: */
65: int syncPatch(const char *csInput, const char *csDelta, const char *csPatch, int compress);
66:
67:
68: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>