Mercurial > hg
comparison mercurial/mpatch.h @ 29694:55dd12204b8e
mpatch: remove dependency on Python.h in mpatch.c
Now all the CPython-related stuff are referenced only from
mpatch_module.c with mpatch.c being freely usable from
a future cffi module
author | Maciej Fijalkowski <fijall@gmail.com> |
---|---|
date | Fri, 22 Jul 2016 17:28:05 +0200 |
parents | b9b9f9a92481 |
children | 155f0cc3f813 |
comparison
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 |