mercurial/mpatch.h
changeset 29694 55dd12204b8e
parent 29693 b9b9f9a92481
child 29749 155f0cc3f813
equal deleted inserted replaced
29693:b9b9f9a92481 29694:55dd12204b8e
     1 #ifndef _HG_MPATCH_H_
     1 #ifndef _HG_MPATCH_H_
     2 #define _HG_MPATCH_H_
     2 #define _HG_MPATCH_H_
       
     3 
       
     4 extern char *mpatch_errors[];
       
     5 
       
     6 #define MPATCH_ERR_NO_MEM -3
       
     7 #define MPATCH_ERR_CANNOT_BE_DECODED -2
       
     8 #define MPATCH_ERR_INVALID_PATCH -1
     3 
     9 
     4 struct mpatch_frag {
    10 struct mpatch_frag {
     5 	int start, end, len;
    11 	int start, end, len;
     6 	const char *data;
    12 	const char *data;
     7 };
    13 };
    13 int mpatch_decode(const char *bin, ssize_t len, struct mpatch_flist** res);
    19 int mpatch_decode(const char *bin, ssize_t len, struct mpatch_flist** res);
    14 ssize_t mpatch_calcsize(ssize_t len, struct mpatch_flist *l);
    20 ssize_t mpatch_calcsize(ssize_t len, struct mpatch_flist *l);
    15 void mpatch_lfree(struct mpatch_flist *a);
    21 void mpatch_lfree(struct mpatch_flist *a);
    16 int mpatch_apply(char *buf, const char *orig, ssize_t len,
    22 int mpatch_apply(char *buf, const char *orig, ssize_t len,
    17 	struct mpatch_flist *l);
    23 	struct mpatch_flist *l);
    18 struct mpatch_flist *mpatch_fold(void *bins, ssize_t start, ssize_t end);
    24 struct mpatch_flist *mpatch_fold(void *bins,
       
    25 	struct mpatch_flist* (*get_next_item)(void*, ssize_t),
       
    26 	ssize_t start, ssize_t end);
    19 
    27 
    20 #endif
    28 #endif