diff options
Diffstat (limited to 'bboxfix.h')
| -rw-r--r-- | bboxfix.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/bboxfix.h b/bboxfix.h new file mode 100644 index 0000000..b78d1b0 --- /dev/null +++ b/bboxfix.h @@ -0,0 +1,63 @@ +#define _GNU_SOURCE +#include <setjmp.h> +#include <termios.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <signal.h> +#include <ctype.h> +#include <stddef.h> +#include <errno.h> +#include <fcntl.h> +#include <stdarg.h> +#include <sys/stat.h> +#include <sys/poll.h> +#include <sys/ioctl.h> +#if 1 +#include "platform.h" +#define FALSE 0 +#define TRUE 1 +#define smallint int +// #define KEYCODE_BUFFER_SIZE 16 +struct globals *ptr_to_globals; +#define SET_PTR_TO_GLOBALS(x) ptr_to_globals = (x) +#define xzalloc malloc +#define xstrndup strndup +#define xstrdup strdup +#define xmalloc malloc +#define xrealloc realloc +#define xfree free +#define bb_putchar putchar +#define bb_perror_msg perror +// #define bb_error_msg_and_die(...) exit((fprintf(stderr, __VA_ARGS__)&0)|(EXIT_FAILURE)) +#define ssize_t size_t +#define FAST_FUNC +#define NOINLINE +#include "keycodes.h" +#define TERMIOS_RAW_CRNL (1 << 1) +#define TERMIOS_CLEAR_ISIG (1 << 0) +#define TERMIOS_RAW_INPUT (1 << 2) +#define ARRAY_SIZE(x) ((unsigned)((sizeof(x)) / (sizeof(x[0])))) +#define LOGMODE_STDIO 0 +extern const char *applet_name; +#if 1 +int FAST_FUNC get_terminal_width_height(int fd, unsigned *width, unsigned *height); +int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout); +int FAST_FUNC set_termios_to_raw(int fd, struct termios *oldterm, int flags); +int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp); +int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) FAST_FUNC; +void FAST_FUNC bb_error_msg_and_die(const char *s, ...); +ssize_t FAST_FUNC full_read(int fd, void *buf, size_t len); +ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len); +static int wh_helper(int value, int def_val, const char *env_name, int *err); +ssize_t FAST_FUNC safe_write(int fd, const void *buf, size_t count); +ssize_t FAST_FUNC safe_read(int fd, void *buf, size_t count); +void xfunc_die(); +#endif +#endif + +#define ENABLE_FEATURE_EDITING_ASK_TERMINAL 1 +#define ENABLE_FEATURE_VI_ASK_TERMINAL 1 +#define ENABLE_FEATURE_LESS_ASK_TERMINAL 1 |
