1
/*
2
 * Copyright 2008-2011 Various Authors
3
 * Copyright 2005 Timo Hirvonen
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License as
7
 * published by the Free Software Foundation; either version 2 of the
8
 * License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful, but
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
#ifndef CMDLINE_H
20
#define CMDLINE_H
21
22
#include "uchar.h"
23
24
struct cmdline {
25
	/* length in bytes */
26
	int blen;
27
28
	/* length in characters */
29
	int clen;
30
31
	/* pos in bytes */
32
	int bpos;
33
34
	/* pos in characters */
35
	int cpos;
36
37
	/* allocated size */
38
	int size;
39
40
	char *line;
41
};
42
43
extern struct cmdline cmdline;
44
45
extern const char cmdline_word_delimiters[];
46
extern const char cmdline_filename_delimiters[];
47
48
void cmdline_init(void);
49
void cmdline_insert_ch(uchar ch);
50
void cmdline_backspace(void);
51
void cmdline_backspace_to_bol(void);
52
void cmdline_delete_ch(void);
53
void cmdline_set_text(const char *text);
54
void cmdline_clear(void);
55
void cmdline_clear_end(void);
56
void cmdline_move_left(void);
57
void cmdline_move_right(void);
58
void cmdline_move_home(void);
59
void cmdline_move_end(void);
60
61
void cmdline_forward_word(const char *delim);
62
void cmdline_backward_word(const char *delim);
63
void cmdline_delete_word(const char *delim);
64
void cmdline_backward_delete_word(const char *delim);
65
66
#endif