summaryrefslogtreecommitdiff
path: root/bboxfix.h
blob: b78d1b07e265c753430a299248f5f0f6766430d7 (plain)
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
#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