forked from fish-shell/fish-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_common.h
59 lines (48 loc) · 1.39 KB
/
input_common.h
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
/** \file input_common.h
Header file for the low level input library
*/
#ifndef INPUT_COMMON_H
#define INPUT_COMMON_H
#include <wchar.h>
/**
Use unencoded private-use keycodes for internal characters
*/
#define INPUT_COMMON_RESERVED 0xe000
enum
{
/**
R_NULL is sometimes returned by the input when a character was
requested but none could be delivered, or when an exception
happened.
*/
R_NULL = INPUT_COMMON_RESERVED,
R_EOF
}
;
/**
Init the library
*/
void input_common_init( int (*ih)() );
/* Sets a callback to be invoked every time a byte is read */
void input_common_set_poll_callback(void (*handler)(void));
/**
Free memory used by the library
*/
void input_common_destroy();
/**
Function used by input_readch to read bytes from stdin until enough
bytes have been read to convert them to a wchar_t. Conversion is
done using mbrtowc. If a character has previously been read and
then 'unread' using \c input_common_unreadch, that character is
returned. If timed is true, readch2 will wait at most
WAIT_ON_ESCAPE milliseconds for a character to be available for
reading before returning with the value WEOF.
*/
wchar_t input_common_readch( int timed );
/**
Push a character or a readline function onto the stack of unread
characters that input_readch will return before actually reading from fd
0.
*/
void input_common_unreadch( wint_t ch );
#endif