Merge branch '2692_manpage_broken_date'
[midnight-commander.git] / src / diffviewer / internal.h
blobbdd2c2961f505430ae3143ec15de790aaa206246
1 #ifndef MC__DIFFVIEW_INTERNAL_H
2 #define MC__DIFFVIEW_INTERNAL_H
4 #include "lib/global.h"
5 #include "lib/mcconfig.h"
6 #include "lib/search.h"
7 #include "lib/tty/color.h"
8 #include "lib/widget.h"
10 /*** typedefs(not structures) and defined constants **********************************************/
12 typedef int (*DFUNC) (void *ctx, int ch, int line, off_t off, size_t sz, const char *str);
13 typedef int PAIR[2];
15 #define error_dialog(h, s) query_dialog(h, s, D_ERROR, 1, _("&Dismiss"))
17 /*** enums ***************************************************************************************/
19 typedef enum
21 DATA_SRC_MEM = 0,
22 DATA_SRC_TMP = 1,
23 DATA_SRC_ORG = 2
24 } DSRC;
26 typedef enum
28 DIFF_NONE = 0,
29 DIFF_ADD = 1,
30 DIFF_DEL = 2,
31 DIFF_CHG = 3
32 } DiffState;
34 /*** structures declarations (and typedefs of structures)*****************************************/
36 typedef struct
38 int fd;
39 int pos;
40 int len;
41 char *buf;
42 int flags;
43 void *data;
44 } FBUF;
46 typedef struct
48 int a[2][2];
49 int cmd;
50 } DIFFCMD;
53 typedef struct
55 int off;
56 int len;
57 } BRACKET[2];
59 typedef struct
61 int ch;
62 int line;
63 union
65 off_t off;
66 size_t len;
67 } u;
68 void *p;
69 } DIFFLN;
71 typedef struct
73 FBUF *f;
74 GArray *a;
75 DSRC dsrc;
76 } PRINTER_CTX;
78 typedef struct WDiff
80 Widget widget;
82 const char *args; /* Args passed to diff */
83 const char *file[2]; /* filenames */
84 char *label[2];
85 FBUF *f[2];
86 const char *backup_sufix;
87 gboolean merged;
88 GArray *a[2];
89 GPtrArray *hdiff;
90 int ndiff; /* number of hunks */
91 DSRC dsrc; /* data source: memory or temporary file */
93 int view_quit:1; /* Quit flag */
95 int height;
96 int half1;
97 int half2;
98 int width1;
99 int width2;
100 int bias;
101 int new_frame;
102 int skip_rows;
103 int skip_cols;
104 int display_symbols;
105 int display_numbers;
106 int show_cr;
107 int tab_size;
108 int ord;
109 int full;
110 gboolean utf8;
111 /* converter for translation of text */
112 GIConv converter;
113 struct
115 int quality;
116 gboolean strip_trailing_cr;
117 gboolean ignore_tab_expansion;
118 gboolean ignore_space_change;
119 gboolean ignore_all_space;
120 gboolean ignore_case;
121 } opt;
123 /* Search variables */
124 struct
126 mc_search_t *handle;
127 gchar *last_string;
129 ssize_t last_found_line;
130 ssize_t last_accessed_num_line;
131 } search;
133 } WDiff;
135 /*** global variables defined in .c file *********************************************************/
137 /*** declarations of public functions ************************************************************/
139 /* search.c */
140 void dview_search_cmd (WDiff * dview);
141 void dview_continue_search_cmd (WDiff * dview);
143 /* ydiff.c */
144 void dview_update (WDiff * dview);
146 #endif /* MC__DIFFVIEW_INTERNAL_H */