2020-10-27 10:09:27 +03:00
|
|
|
#ifndef __LIB__READLINE_H__
|
|
|
|
#define __LIB__READLINE_H__
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2020-11-02 11:20:34 +03:00
|
|
|
#define GETCHAR_CURSOR_LEFT (-10)
|
|
|
|
#define GETCHAR_CURSOR_RIGHT (-11)
|
|
|
|
#define GETCHAR_CURSOR_UP (-12)
|
|
|
|
#define GETCHAR_CURSOR_DOWN (-13)
|
|
|
|
#define GETCHAR_DELETE (-14)
|
2020-12-19 21:27:10 +03:00
|
|
|
#define GETCHAR_END (-15)
|
|
|
|
#define GETCHAR_HOME (-16)
|
|
|
|
#define GETCHAR_PGUP (-17)
|
|
|
|
#define GETCHAR_PGDOWN (-18)
|
|
|
|
#define GETCHAR_F10 (-19)
|
2021-05-19 09:13:15 +03:00
|
|
|
#define GETCHAR_ESCAPE (-20)
|
2020-11-02 11:20:34 +03:00
|
|
|
|
2022-09-02 03:29:12 +03:00
|
|
|
#if defined (BIOS)
|
2021-08-25 23:28:32 +03:00
|
|
|
# define GETCHAR_RCTRL 0x4
|
|
|
|
# define GETCHAR_LCTRL GETCHAR_RCTRL
|
2022-09-02 03:29:12 +03:00
|
|
|
#elif defined (UEFI)
|
2021-08-25 23:28:32 +03:00
|
|
|
# define GETCHAR_RCTRL EFI_RIGHT_CONTROL_PRESSED
|
|
|
|
# define GETCHAR_LCTRL EFI_LEFT_CONTROL_PRESSED
|
|
|
|
#endif
|
|
|
|
|
2020-11-02 11:20:34 +03:00
|
|
|
int getchar(void);
|
2020-10-27 10:09:27 +03:00
|
|
|
void readline(const char *orig_str, char *buf, size_t limit);
|
|
|
|
|
|
|
|
#endif
|