File: filedlg.h

package info (click to toggle)
cgdb 0.6.7-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 3,276 kB
  • sloc: ansic: 17,828; sh: 5,176; exp: 1,019; lex: 611; makefile: 287; yacc: 255; cpp: 10
file content (65 lines) | stat: -rw-r--r-- 1,822 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _FILEDLG_H_
#define _FILEDLG_H_

struct filedlg;

/* filedlg_new: Create a new file dialog.
 * ____________
 *
 *   pos_r:   position of the viewer (row)
 *   pos_c:   position of the viewer (column)
 *   height:  height (in lines) of the viewer
 *   width:   width (in columns) of the viewer
 *
 * return value:  a new filedlg object on success, null on failure.
 */
struct filedlg *filedlg_new(int pos_r, int pos_c, int height, int width);

/* filedlg_free:  Release the memory associated with a file dialog.
 * ------------
 *
 *   fdlg:  The file dialog to free.
 */
void filedlg_free(struct filedlg *fdlg);

/* filedlg_add_file_choice:  Add a file to the list of source files.
 * -----------
 *
 * file_choice: A path to a file that the user will be able to choose from.
 *
 * Return Value:  Zero on success, non-zero on error.
 */
int filedlg_add_file_choice(struct filedlg *fd, const char *file_choice);

/* filedlg_clear: Clears all the file_choice's in the dialog.
 * ______________
 */
void filedlg_clear(struct filedlg *fd);

/* filedlg_recv_char: Sens a character to the filedlg.
 *
 *   fdlg:  The file dialog to free.
 *   key :  The next key of input to process
 *   file:  The file the user selected
 *
 *  returns -1 when aborted by user.
 *  returns 0 when needs more input
 *  returns 1 when done ( file is valid )
 */
int filedlg_recv_char(struct filedlg *fd, int key, char *file);

/* filedlg_display_message: Displays a message on the filedlg window status bar.
 * ------------------------
 *
 * fd:      The file dialog to use.
 * message: The message to display
 */
void filedlg_display_message(struct filedlg *fd, char *message);

/* filedlg_display: Redraws the file dialog.
 *
 * Returns 0 on success or -1 on error
 */
int filedlg_display(struct filedlg *fd);

#endif /* _FILEDLG_H_ */