1 /*
2  * Samba Unix/Linux SMB client library
3  * Registry Editor
4  * Copyright (C) Christopher Davis 2012
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef _HEXEDIT_H_
21 #define _HEXEDIT_H_
22 
23 #include <ncurses.h>
24 
25 enum {
26 	HE_CURSOR_UP = 0x1000,
27 	HE_CURSOR_DOWN = 0x1100,
28 	HE_CURSOR_LEFT = 0x1200,
29 	HE_CURSOR_RIGHT = 0x1300,
30 	HE_CURSOR_PGUP = 0x1400,
31 	HE_CURSOR_PGDN = 0x1500,
32 	HE_BACKSPACE = 0x1600,
33 	HE_DELETE = 0x1700,
34 };
35 
36 #define LINE_WIDTH 44
37 struct hexedit;
38 
39 struct hexedit *hexedit_new(TALLOC_CTX *ctx, WINDOW *parent, const void *data,
40 			    size_t sz);
41 WERROR hexedit_set_buf(struct hexedit *buf, const void *data, size_t sz);
42 const void *hexedit_get_buf(struct hexedit *buf);
43 size_t hexedit_get_buf_len(struct hexedit *buf);
44 void hexedit_set_cursor(struct hexedit *buf);
45 void hexedit_refresh(struct hexedit *buf);
46 void hexedit_driver(struct hexedit *buf, int c);
47 WERROR hexedit_resize_buffer(struct hexedit *buf, size_t newsz);
48 
49 #endif
50