Mercurial > hg > mercurial-source
diff mercurial/mpatch.h @ 30454:b9b9f9a92481
mpatch: split mpatch into two files
author | Maciej Fijalkowski <fijall@gmail.com> |
---|---|
date | Mon, 18 Jul 2016 19:02:30 +0200 (2016-07-18) |
parents | |
children | 55dd12204b8e |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/mercurial/mpatch.h @@ -0,0 +1,20 @@ +#ifndef _HG_MPATCH_H_ +#define _HG_MPATCH_H_ + +struct mpatch_frag { + int start, end, len; + const char *data; +}; + +struct mpatch_flist { + struct mpatch_frag *base, *head, *tail; +}; + +int mpatch_decode(const char *bin, ssize_t len, struct mpatch_flist** res); +ssize_t mpatch_calcsize(ssize_t len, struct mpatch_flist *l); +void mpatch_lfree(struct mpatch_flist *a); +int mpatch_apply(char *buf, const char *orig, ssize_t len, + struct mpatch_flist *l); +struct mpatch_flist *mpatch_fold(void *bins, ssize_t start, ssize_t end); + +#endif