1 | /* |
2 | * Copyright © 2018 Benjamin Otte |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2.1 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | * Authors: Benjamin Otte <otte@gnome.org> |
18 | */ |
19 | |
20 | #ifndef __GSK_DIFF_PRIVATE_H__ |
21 | #define __GSK_DIFF_PRIVATE_H__ |
22 | |
23 | #include <glib.h> |
24 | |
25 | G_BEGIN_DECLS |
26 | |
27 | typedef enum { |
28 | GSK_DIFF_OK = 0, |
29 | GSK_DIFF_ABORTED, |
30 | } GskDiffResult; |
31 | |
32 | typedef GskDiffResult (* GskKeepFunc) (gconstpointer elem1, gconstpointer elem2, gpointer data); |
33 | typedef GskDiffResult (* GskDeleteFunc) (gconstpointer elem, gsize idx, gpointer data); |
34 | typedef GskDiffResult (* GskInsertFunc) (gconstpointer elem, gsize idx, gpointer data); |
35 | |
36 | typedef struct _GskDiffSettings GskDiffSettings; |
37 | |
38 | GskDiffSettings * gsk_diff_settings_new (GCompareDataFunc compare_func, |
39 | GskKeepFunc keep_func, |
40 | GskDeleteFunc delete_func, |
41 | GskInsertFunc insert_func); |
42 | void gsk_diff_settings_free (GskDiffSettings *settings); |
43 | void gsk_diff_settings_set_allow_abort (GskDiffSettings *settings, |
44 | gboolean allow_abort); |
45 | |
46 | GskDiffResult gsk_diff (gconstpointer *elem1, |
47 | gsize n1, |
48 | gconstpointer *elem2, |
49 | gsize n2, |
50 | const GskDiffSettings *settings, |
51 | gpointer data); |
52 | |
53 | G_END_DECLS |
54 | |
55 | #endif /* __GSK_DIFF_PRIVATE_H__ */ |
56 | |