commit - ba4f502b21b11dc2b15f628f8d85530cf233d74a
commit + b01e7d3b675302f732c8f7d4798bbd621d4f387a
blob - aeac875436cd6ccf6485d823fcecffdabef330be
blob + 6ddb4fe45911e4fedf75c85370274526080a4ce1
--- tog/tog.c
+++ tog/tog.c
struct commit_queue {
int ncommits;
struct commit_queue_head head;
+};
+
+struct tog_diff_view_state {
+ FILE *f;
+ int first_displayed_line;
+ int last_displayed_line;
+};
+
+struct tog_log_view_state {
+ struct got_commit_graph *graph;
+ struct commit_queue commits;
+ struct commit_queue_entry *first_displayed_entry;
+ struct commit_queue_entry *last_displayed_entry;
+ struct commit_queue_entry *selected_entry;
+ int selected;
+ char *in_repo_path;
+ struct got_repository *repo;
};
struct tog_view {
/* type-specific state */
enum tog_view_type type;
union {
- struct {
- FILE *f;
- int first_displayed_line;
- int last_displayed_line;
- } diff;
- struct {
- struct got_commit_graph *graph;
- struct commit_queue commits;
- struct commit_queue_entry *first_displayed_entry;
- struct commit_queue_entry *last_displayed_entry;
- struct commit_queue_entry *selected_entry;
- int selected;
- char *in_repo_path;
- struct got_repository *repo;
- } log;
+ struct tog_diff_view_state diff;
+ struct tog_log_view_state log;
} state;
};