IRIX fixes thanks to Elias Pipping.

This commit is contained in:
Nicholas Marriott 2008-06-23 16:58:49 +00:00
parent c24d849fa4
commit 91f3165b2d
9 changed files with 60 additions and 52 deletions

View File

@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.30 2008-06-22 21:52:41 nicm Exp $ # $Id: GNUmakefile,v 1.31 2008-06-23 16:58:49 nicm Exp $
.PHONY: clean .PHONY: clean
@ -53,6 +53,17 @@ INSTALLDIR= install -d
INSTALLBIN= install -g bin -o root -m 555 INSTALLBIN= install -g bin -o root -m 555
INSTALLMAN= install -g bin -o root -m 444 INSTALLMAN= install -g bin -o root -m 444
ifeq ($(shell uname),IRIX64)
INCDIRS+= -Icompat -I/usr/local/include/ncurses
SRCS+= compat/strlcpy.c compat/strtonum.c compat/daemon.c \
compat/asprintf.c compat/fgetln.c
CFLAGS+= -DNO_STRLCPY -DNO_STRTONUM -DNO_TREE_H -DNO_SETPROCTITLE \
-DNO_DAEMON -DNO_FORKPTY -DNO_PROGNAME -DNO_ASPRINTF -DNO_FGETLN \
-D_SGI_SOURCE -std=c99
LDFLAGS+= -L/usr/local/lib
LIBS+= -lgen
endif
ifeq ($(shell uname),SunOS) ifeq ($(shell uname),SunOS)
INCDIRS+= -Icompat -I/usr/local/include/ncurses INCDIRS+= -Icompat -I/usr/local/include/ncurses
SRCS+= compat/strtonum.c compat/daemon.c compat/forkpty-sunos.c \ SRCS+= compat/strtonum.c compat/daemon.c compat/forkpty-sunos.c \
@ -75,10 +86,8 @@ INCDIRS+= -Icompat
SRCS+= compat/strlcpy.c compat/strlcat.c compat/strtonum.c SRCS+= compat/strlcpy.c compat/strlcat.c compat/strtonum.c
CFLAGS+= $(shell getconf LFS_CFLAGS) -D_GNU_SOURCE \ CFLAGS+= $(shell getconf LFS_CFLAGS) -D_GNU_SOURCE \
-DNO_STRLCPY -DNO_STRLCAT -DNO_STRTONUM -DNO_SETPROCTITLE \ -DNO_STRLCPY -DNO_STRLCAT -DNO_STRTONUM -DNO_SETPROCTITLE \
-DNO_QUEUE_H -DNO_TREE_H -DUSE_PTY_H -DNO_QUEUE_H -DNO_TREE_H -DUSE_PTY_H -std=c99
LIBS+= -lrt -lutil LIBS+= -lrt -lutil
# Required for LLONG_MAX and friends
CFLAGS+= -std=c99
endif endif
OBJS= $(patsubst %.c,%.o,$(SRCS)) OBJS= $(patsubst %.c,%.o,$(SRCS))

View File

@ -1,4 +1,4 @@
/* $Id: client.c,v 1.32 2008-06-19 19:36:55 nicm Exp $ */ /* $Id: client.c,v 1.33 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -44,10 +44,8 @@ client_init(const char *path, struct client_ctx *cctx, int start_server)
int mode; int mode;
u_int retries; u_int retries;
struct buffer *b; struct buffer *b;
pid_t pid;
char *name; char *name;
pid = 0;
retries = 0; retries = 0;
retry: retry:
if (stat(path, &sb) != 0) { if (stat(path, &sb) != 0) {

View File

@ -1,4 +1,4 @@
/* $Id: cmd-has-session.c,v 1.9 2008-06-05 21:25:00 nicm Exp $ */ /* $Id: cmd-has-session.c,v 1.10 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -45,7 +45,7 @@ cmd_has_session_exec(struct cmd *self, struct cmd_ctx *ctx)
struct cmd_target_data *data = self->data; struct cmd_target_data *data = self->data;
struct session *s; struct session *s;
if ((s = cmd_find_session(ctx, data->target)) == NULL) if (cmd_find_session(ctx, data->target) == NULL)
return; return;
if (ctx->cmdclient != NULL) if (ctx->cmdclient != NULL)

View File

@ -36,6 +36,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "tmux.h" #include "tmux.h"

View File

@ -1,4 +1,4 @@
/* $Id: input-keys.c,v 1.8 2008-06-18 22:21:51 nicm Exp $ */ /* $Id: input-keys.c,v 1.9 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -30,35 +30,35 @@ struct {
} input_keys[] = { } input_keys[] = {
/* { KEYC_BACKSPACE, "\010" }, */ /* { KEYC_BACKSPACE, "\010" }, */
{ KEYC_DC, "\e[3~" }, { KEYC_DC, "\033[3~" },
{ KEYC_F1, "\eOP" }, { KEYC_F1, "\033OP" },
{ KEYC_F10, "\e[21~" }, { KEYC_F10, "\033[21~" },
{ KEYC_F11, "\e[23~" }, { KEYC_F11, "\033[23~" },
{ KEYC_F12, "\e[24~" }, { KEYC_F12, "\033[24~" },
{ KEYC_F2, "\eOQ" }, { KEYC_F2, "\033OQ" },
{ KEYC_F3, "\eOR" }, { KEYC_F3, "\033OR" },
{ KEYC_F4, "\eOS" }, { KEYC_F4, "\033OS" },
{ KEYC_F5, "\e[15~" }, { KEYC_F5, "\033[15~" },
{ KEYC_F6, "\e[17~" }, { KEYC_F6, "\033[17~" },
{ KEYC_F7, "\e[18~" }, { KEYC_F7, "\033[18~" },
{ KEYC_F8, "\e[19~" }, { KEYC_F8, "\033[19~" },
{ KEYC_F9, "\e[20~" }, { KEYC_F9, "\033[20~" },
{ KEYC_FIND, "\e[1~" }, { KEYC_FIND, "\033[1~" },
{ KEYC_IC, "\e[2~" }, { KEYC_IC, "\033[2~" },
{ KEYC_NPAGE, "\e[6~" }, { KEYC_NPAGE, "\033[6~" },
{ KEYC_PPAGE, "\e[5~" }, { KEYC_PPAGE, "\033[5~" },
{ KEYC_SELECT, "\e[4~" }, { KEYC_SELECT, "\033[4~" },
{ KEYC_UP, "\eOA" }, { KEYC_UP, "\033OA" },
{ KEYC_DOWN, "\eOB" }, { KEYC_DOWN, "\033OB" },
{ KEYC_LEFT, "\eOD" }, { KEYC_LEFT, "\033OD" },
{ KEYC_RIGHT, "\eOC" }, { KEYC_RIGHT, "\033OC" },
{ KEYC_A1, "\eOw" }, { KEYC_A1, "\033Ow" },
{ KEYC_A3, "\eOy" }, { KEYC_A3, "\033Oy" },
{ KEYC_B2, "\eOu" }, { KEYC_B2, "\033Ou" },
{ KEYC_C1, "\eOq" }, { KEYC_C1, "\033Oq" },
{ KEYC_C3, "\eOs" } { KEYC_C3, "\033Os" }
}; };
#define NINPUTKEYS (sizeof input_keys / sizeof input_keys[0]) #define NINPUTKEYS (sizeof input_keys / sizeof input_keys[0])

View File

@ -1,4 +1,4 @@
/* $Id: status.c,v 1.38 2008-06-23 07:41:21 nicm Exp $ */ /* $Id: status.c,v 1.39 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -444,7 +444,7 @@ status_prompt_key(struct client *c, int key)
break; break;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case '\e': /* escape */ case '\033': /* escape */
c->prompt_callback(c->prompt_data, NULL); c->prompt_callback(c->prompt_data, NULL);
server_clear_client_prompt(c); server_clear_client_prompt(c);
break; break;

6
tmux.c
View File

@ -1,4 +1,4 @@
/* $Id: tmux.c,v 1.67 2008-06-23 07:41:21 nicm Exp $ */ /* $Id: tmux.c,v 1.68 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -176,11 +176,11 @@ main(int argc, char **argv)
struct hdr hdr; struct hdr hdr;
const char *shell; const char *shell;
struct passwd *pw; struct passwd *pw;
char *client, *path, *name, *cause, *home; char *path, *cause, *home;
char rpath[MAXPATHLEN]; char rpath[MAXPATHLEN];
int n, opt; int n, opt;
client = path = name = NULL; path = NULL;
while ((opt = getopt(argc, argv, "f:qS:Vv")) != EOF) { while ((opt = getopt(argc, argv, "f:qS:Vv")) != EOF) {
switch (opt) { switch (opt) {
case 'f': case 'f':

View File

@ -1,4 +1,4 @@
/* $Id: tty-keys.c,v 1.3 2008-06-06 17:20:30 nicm Exp $ */ /* $Id: tty-keys.c,v 1.4 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -201,7 +201,7 @@ tty_keys_init(struct tty *tty)
s = tigetstr(tty_keys[i].name); s = tigetstr(tty_keys[i].name);
if (s == (char *) -1 || s == (char *) 0) if (s == (char *) -1 || s == (char *) 0)
continue; continue;
if (s[0] != '\e' || s[1] == '\0') if (s[0] != '\033' || s[1] == '\0')
continue; continue;
tk = xmalloc(sizeof *tk); tk = xmalloc(sizeof *tk);
@ -240,7 +240,7 @@ tty_keys_next(struct tty *tty, int *code)
return (1); return (1);
log_debug("keys have %zu bytes", BUFFER_USED(tty->in)); log_debug("keys have %zu bytes", BUFFER_USED(tty->in));
if (*BUFFER_OUT(tty->in) != '\e') { if (*BUFFER_OUT(tty->in) != '\033') {
*code = buffer_read8(tty->in); *code = buffer_read8(tty->in);
return (0); return (0);
} }
@ -268,7 +268,7 @@ tty_keys_next(struct tty *tty, int *code)
/* /*
* XXX Pass through unchanged. * XXX Pass through unchanged.
*/ */
*code = '\e'; *code = '\033';
buffer_remove(tty->in, 1); buffer_remove(tty->in, 1);
return (0); return (0);
} }

12
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.34 2008-06-22 16:54:08 nicm Exp $ */ /* $Id: tty.c,v 1.35 2008-06-23 16:58:49 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -387,7 +387,7 @@ tty_set_title(struct tty *tty, const char *title)
strcmp(tty->termname, "screen") != 0) strcmp(tty->termname, "screen") != 0)
return; return;
tty_puts(tty, "\e]0;"); tty_puts(tty, "\033]0;");
tty_puts(tty, title); tty_puts(tty, title);
tty_putc(tty, '\007'); tty_putc(tty, '\007');
} }
@ -591,11 +591,11 @@ tty_vwrite(struct tty *tty, struct screen *s, int cmd, va_list ap)
#endif #endif
case TTY_MOUSEOFF: case TTY_MOUSEOFF:
if (key_mouse != NULL) if (key_mouse != NULL)
tty_puts(tty, "\e[?1000l"); tty_puts(tty, "\033[?1000l");
break; break;
case TTY_MOUSEON: case TTY_MOUSEON:
if (key_mouse != NULL) if (key_mouse != NULL)
tty_puts(tty, "\e[?1000h"); tty_puts(tty, "\033[?1000h");
break; break;
case TTY_ATTRIBUTES: case TTY_ATTRIBUTES:
ua = va_arg(ap, u_int); ua = va_arg(ap, u_int);
@ -650,7 +650,7 @@ tty_attributes(struct tty *tty, u_char attr, u_char colr)
fg = 7; fg = 7;
if (fg == 8) if (fg == 8)
tty_puts(tty, "\e[39m"); tty_puts(tty, "\033[39m");
else if (set_a_foreground != NULL) else if (set_a_foreground != NULL)
tty_puts(tty, tparm(set_a_foreground, fg)); tty_puts(tty, tparm(set_a_foreground, fg));
} }
@ -661,7 +661,7 @@ tty_attributes(struct tty *tty, u_char attr, u_char colr)
bg = 0; bg = 0;
if (bg == 8) if (bg == 8)
tty_puts(tty, "\e[49m"); tty_puts(tty, "\033[49m");
else if (set_a_background != NULL) else if (set_a_background != NULL)
tty_puts(tty, tparm(set_a_background, bg)); tty_puts(tty, tparm(set_a_background, bg));
} }