diff mercurial/mpatch.h @ 29708: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
line wrap: on
line diff
--- a/mercurial/mpatch.h	Mon Jul 18 19:02:30 2016 +0200
+++ b/mercurial/mpatch.h	Fri Jul 22 17:28:05 2016 +0200
@@ -1,6 +1,12 @@
 #ifndef _HG_MPATCH_H_
 #define _HG_MPATCH_H_
 
+extern char *mpatch_errors[];
+
+#define MPATCH_ERR_NO_MEM -3
+#define MPATCH_ERR_CANNOT_BE_DECODED -2
+#define MPATCH_ERR_INVALID_PATCH -1
+
 struct mpatch_frag {
 	int start, end, len;
 	const char *data;
@@ -15,6 +21,8 @@
 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);
+struct mpatch_flist *mpatch_fold(void *bins,
+	struct mpatch_flist* (*get_next_item)(void*, ssize_t),
+	ssize_t start, ssize_t end);
 
 #endif