Annotation of libaitsync/inc/aitsync.h, revision 1.1.1.1.2.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 $
1.1.1.1.2.1! misho       6: * $Id: aitsync.h,v 1.1.1.1 2010/03/24 16:00:15 misho Exp $
1.1       misho       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
1.1.1.1.2.1! misho      43:  * @compress = 2 compress signatures output, 0 not compressed
1.1       misho      44:  * return: -1 error, 0 ok
                     45:  */
1.1.1.1.2.1! misho      46: int syncSignature(const char *csInput, const char *csSig, int compress);
1.1       misho      47: 
                     48: /*
                     49:  * syncDelta() Create Delta patch file
                     50:  * @csInput = Input original source file name for make delta patch file
                     51:  * @csSig = Input Signature file name
                     52:  * @csDelta = Output Delta patch file name
1.1.1.1.2.1! misho      53:  * @compress = 3 everything compress, 2 compressed signatures, 1 compress delta output, 0 not compressed
1.1       misho      54:  * return: -1 error, 0 ok, create delta patch, 1 ok, no differences and not create patch
                     55:  */
                     56: int syncDelta(const char *csInput, const char *csSig, const char *csDelta, int compress);
                     57: 
                     58: /*
                     59:  * syncPatch() Apply delta patch file to target
                     60:  * @csInput = Input target file name for patch
                     61:  * @csDelta = Input Delta patch file name
                     62:  * @csPatch = After applied patch create new alternate target file, if != NULL
1.1.1.1.2.1! misho      63:  * @compress = 1 compress delta input, 0 not compressed
1.1       misho      64:  * return: -1 error, 0 ok, create delta patch, 1 ok, no differences and not create patch
                     65:  */
                     66: int syncPatch(const char *csInput, const char *csDelta, const char *csPatch, int compress);
                     67: 
                     68: 
                     69: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>