Make geanyvc compatible with document pointer changes in Geany
[geanyvc.git] / geanyvc.h
blob78f13ac9b0941140ffabbe7bfe67a16c4b6f3f99
1 /*
2 * Copyright 2007 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
3 * Copyright 2007 Enrico Tröger <enrico.troeger@uvena.de>
4 * Copyright 2007 Nick Treleaven <nick.treleaven@btinternet.com>
5 * Copyright 2007 Yura Siamashka <yurand2@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __GEANYVC_HEADER__
23 #define __GEANYVC_HEADER__
25 enum
27 VC_COMMAND_DIFF_FILE,
28 VC_COMMAND_DIFF_DIR,
29 VC_COMMAND_REVERT_FILE,
30 VC_COMMAND_STATUS,
31 VC_COMMAND_ADD,
32 VC_COMMAND_REMOVE,
33 VC_COMMAND_LOG_FILE,
34 VC_COMMAND_LOG_DIR,
35 VC_COMMAND_COMMIT,
36 VC_COMMAND_BLAME,
37 VC_COMMAND_SHOW,
38 VC_COMMAND_COUNT
41 #define P_DIRNAME "*<?geanyvcDIRNAME>*"
42 #define P_FILENAME "*<?geanyvcFILENAME>*"
43 #define P_BASE_FILENAME "*<?geanyvcBASE_FILENAME>*"
45 /* The addresses of these strings act as enums, their contents are not used. */
46 extern const gchar DIRNAME[];
47 extern const gchar FILENAME[];
48 extern const gchar BASE_FILENAME[];
49 extern const gchar FILE_LIST[];
50 extern const gchar MESSAGE[];
52 /* this string is used when action require to run several commands */
53 extern const gchar CMD_SEPARATOR[];
54 extern const gchar CMD_FUNCTION[];
56 extern const gchar FILE_STATUS_MODIFIED[];
57 extern const gchar FILE_STATUS_ADDED[];
58 extern const gchar FILE_STATUS_DELETED[];
59 extern const gchar FILE_STATUS_UNKNOWN[];
61 gint
62 execute_custom_command(const gchar ** argv, const gchar ** env, gchar ** std_out, gchar ** std_err,
63 const gchar * filename, GSList * list, const gchar * message);
65 gboolean find_dir(const gchar * filename, const char *find, gboolean recursive);
66 gchar *find_subdir_path(const gchar * filename, const gchar * subdir);
68 typedef struct _VC_RECORD
70 void **commands;
71 void **envs;
72 const gchar *program;
73 gboolean(*in_vc) (const gchar * path); // check if file in VC
74 GSList *(*get_commit_files) (const gchar * dir);
75 } VC_RECORD;
77 typedef struct _CommitItem
79 gchar *path;
80 const gchar *status;
81 } CommitItem;
83 #define REGISTER_VC(vc,enable) {extern VC_RECORD VC_##vc;if(enable){path = g_find_program_in_path(VC_##vc.program); \
84 if (path) { g_free(path); VC = g_slist_append(VC, &VC_##vc);} }}
86 /* Blank functions and values */
87 GSList *get_commit_files_null(const gchar * dir);
88 extern void *NO_ENV[];
90 /* External diff viewer */
91 const gchar *get_external_diff_viewer();
92 void vc_external_diff(const gchar * src, const gchar * dest);
94 #endif // __GEANYVC_HEADER__