diff options
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r-- | src/nvim/os_unix.c | 64 |
1 files changed, 7 insertions, 57 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 8ab61045dc..8784559b50 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -1,6 +1,5 @@ /* * VIM - Vi IMproved by Bram Moolenaar - * OS/2 port by Paul Slootman * VMS merge by Zoltan Arpadffy * * Do ":help uganda" in Vim to read copying and usage conditions. @@ -10,7 +9,7 @@ /* * os_unix.c -- code for all flavors of Unix (BSD, SYSV, SVR4, POSIX, ...) - * Also for BeOS and Atari MiNT. + * Also for BeOS * * A lot of this file was originally written by Juergen Weigert and later * changed beyond recognition. @@ -46,7 +45,6 @@ #include "nvim/tempfile.h" #include "nvim/term.h" #include "nvim/types.h" -#include "nvim/ui.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/os/event.h" @@ -83,47 +81,22 @@ static int did_set_title = FALSE; static char_u *oldicon = NULL; static int did_set_icon = FALSE; - - -/* - * Write s[len] to the screen. - */ -void mch_write(char_u *s, int len) -{ - if (embedded_mode) { - // TODO(tarruda): This is a temporary hack to stop Neovim from writing - // messages to stdout in embedded mode. In the future, embedded mode will - // be the only possibility(GUIs will always start neovim with a msgpack-rpc - // over stdio) and this function won't exist. - // - // The reason for this is because before Neovim fully migrates to a - // msgpack-rpc-driven architecture, we must have a fully functional - // UI working - return; - } - - ignored = (int)write(1, (char *)s, len); - if (p_wd) /* Unix is too fast, slow down a bit more */ - os_microdelay(p_wd, false); -} - /* * If the machine has job control, use it to suspend the program, * otherwise fake it by starting a new shell. */ void mch_suspend(void) { - /* BeOS does have SIGTSTP, but it doesn't work. */ -#if defined(SIGTSTP) && !defined(__BEOS__) +#if defined(SIGTSTP) out_flush(); /* needed to make cursor visible on some systems */ settmode(TMODE_COOK); out_flush(); /* needed to disable mouse on some systems */ - + // Note: compiler defines _REENTRANT when given -pthread flag. # if defined(_REENTRANT) && defined(SIGCONT) sigcont_received = FALSE; # endif - kill(0, SIGTSTP); /* send ourselves a STOP signal */ + uv_kill(0, SIGTSTP); // send ourselves a STOP signal # if defined(_REENTRANT) && defined(SIGCONT) /* * Wait for the SIGCONT signal to be handled. It generally happens @@ -155,20 +128,6 @@ void mch_suspend(void) #endif } -void mch_init(void) -{ - Columns = 80; - Rows = 24; - - out_flush(); - -#ifdef MACOS_CONVERT - mac_conv_init(); -#endif - - event_init(); -} - static int get_x11_title(int test_only) { return FALSE; @@ -479,12 +438,6 @@ int mch_nodetype(char_u *name) return NODE_WRITABLE; } -void mch_early_init(void) -{ - handle_init(); - time_init(); -} - #if defined(EXITFREE) || defined(PROTO) void mch_free_mem(void) { @@ -570,9 +523,8 @@ void mch_settmode(int tmode) { static int first = TRUE; - /* Why is NeXT excluded here (and not in os_unixx.h)? */ #if defined(ECHOE) && defined(ICANON) && (defined(HAVE_TERMIO_H) || \ - defined(HAVE_TERMIOS_H)) && !defined(__NeXT__) + defined(HAVE_TERMIOS_H)) /* * for "new" tty systems */ @@ -600,9 +552,8 @@ void mch_settmode(int tmode) */ tnew.c_iflag &= ~ICRNL; tnew.c_lflag &= ~(ICANON | ECHO | ISIG | ECHOE -# if defined(IEXTEN) && !defined(__MINT__) +# if defined(IEXTEN) | IEXTEN /* IEXTEN enables typing ^V on SOLARIS */ - /* but it breaks function keys on MINT */ # endif ); # ifdef ONLCR /* don't map NL -> CR NL, we do it ourselves */ @@ -668,9 +619,8 @@ void get_stty(void) char_u buf[2]; char_u *p; - /* Why is NeXT excluded here (and not in os_unixx.h)? */ #if defined(ECHOE) && defined(ICANON) && (defined(HAVE_TERMIO_H) || \ - defined(HAVE_TERMIOS_H)) && !defined(__NeXT__) + defined(HAVE_TERMIOS_H)) /* for "new" tty systems */ # ifdef HAVE_TERMIOS_H struct termios keys; |