1 /*
2 
3     File: intrf.h
4 
5     Copyright (C) 1998-2008 Christophe GRENIER <grenier@cgsecurity.org>
6 
7     This software 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.
11 
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.
16 
17     You should have received a copy of the GNU General Public License along
18     with this program; if not, write the Free Software Foundation, Inc., 51
19     Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 
21  */
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct MenuItem
27 {
28     const int key; /* Keyboard shortcut; if zero, then there is no more items in the menu item table */
29     const char *name; /* Item name, should be eight characters with current implementation */
30     const char *desc; /* Item description to be printed when item is selected */
31 };
32 #define MAX_LINES		200
33 #define BUFFER_LINE_LENGTH 	255
34 #define MAXIMUM_PARTS 		60
35 
36 #define INTER_OPTION_X  	0
37 #define INTER_OPTION_Y		10
38 #define INTER_PARTITION_X  	0
39 #define INTER_PARTITION_Y	8
40 #define INTER_MAIN_X		0
41 #define INTER_MAIN_Y		18
42 #define INTER_GEOM_X		0
43 #define INTER_GEOM_Y  		18
44 /* Constants for menuType parameter of menuSelect function */
45 #define MENU_HORIZ 		1
46 #define MENU_VERT 		2
47 #define MENU_ACCEPT_OTHERS 	4
48 #define MENU_BUTTON 		8
49 #define MENU_VERT_WARN		16
50 #define MENU_VERT_ARROW2VALID	32
51 /* Miscellenous constants */
52 #define MENU_SPACING 		2
53 #define MENU_MAX_ITEMS 		256 /* for simpleMenu function */
54 #define key_CR 			'\015'
55 #define key_ESC 		'\033'
56 /* '\014' == ^L */
57 #define key_REDRAWKEY 		'\014'
58 
59 void log_CHS_from_LBA(const disk_t *disk_car, const unsigned long int pos_LBA);
60 const char *aff_part_aux(const unsigned int newline, const disk_t *disk_car, const partition_t *partition);
61 void aff_part_buffer(const unsigned int newline,const disk_t *disk_car,const partition_t *partition);
62 
63 uint64_t atouint64(const char *nptr);
64 uint64_t ask_number_cli(char **current_cmd, const uint64_t val_cur, const uint64_t val_min, const uint64_t val_max, const char * _format, ...) __attribute__ ((format (printf, 5, 6)));
65 void screen_buffer_reset(void);
66 int screen_buffer_add(const char *_format, ...)  __attribute__ ((format (printf, 1, 2)));
67 void screen_buffer_to_log(void);
68 int get_partition_status(const partition_t *partition);
69 
70 #ifdef __cplusplus
71 } /* closing brace for extern "C" */
72 #endif
73