Merge pull request #457 from vivien/text-variable
[tig.git] / include / tig / status.h
blob8388d40cd8de47de2edb75d4857c7fb060a983bd
1 /* Copyright (c) 2006-2015 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef TIG_STATUS_H
15 #define TIG_STATUS_H
17 #include "tig/view.h"
18 #include "tig/line.h"
20 struct status {
21 char status;
22 struct {
23 mode_t mode;
24 char rev[SIZEOF_REV];
25 char name[SIZEOF_STR];
26 } old;
27 struct {
28 mode_t mode;
29 char rev[SIZEOF_REV];
30 char name[SIZEOF_STR];
31 } new;
34 bool status_update_file(struct status *status, enum line_type type);
35 bool status_update_files(struct view *view, struct line *line);
37 bool status_revert(struct status *status, enum line_type type, bool has_none);
38 bool status_exists(struct view *view, struct status *status, enum line_type type);
40 bool status_stage_info_(char *buf, size_t bufsize,
41 enum line_type type, struct status *status);
42 #define status_stage_info(buf, type, status) \
43 status_stage_info_(buf, sizeof(buf), type, status)
44 extern struct view status_view;
46 static inline void
47 open_status_view(struct view *prev, enum open_flags flags)
49 open_view(prev, &status_view, flags);
52 #endif
53 /* vim: set ts=8 sw=8 noexpandtab: */