TAILQ -> SLIST.

This commit is contained in:
Nicholas Marriott 2008-11-05 01:19:24 +00:00
parent 4e4aefaf7e
commit 4198a9c376
4 changed files with 19 additions and 17 deletions

2
TODO
View File

@ -32,6 +32,8 @@
- better mode features: search, back word, forward word, etc
- flags to centre screen in window
- better terminal emulation (identify, insert mode, some other bits)
- save stack for last window
- paste stack should be an SLIST. also key bindings? others?
-- For 0.5 --------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
/* $Id: session.c,v 1.43 2008-09-26 06:45:27 nicm Exp $ */
/* $Id: session.c,v 1.44 2008-11-05 01:19:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -33,13 +33,13 @@ session_alert_cancel(struct session *s, struct winlink *wl)
{
struct session_alert *sa, *sb;
sa = TAILQ_FIRST(&s->alerts);
sa = SLIST_FIRST(&s->alerts);
while (sa != NULL) {
sb = sa;
sa = TAILQ_NEXT(sa, entry);
sa = SLIST_NEXT(sa, entry);
if (wl == NULL || sb->wl == wl) {
TAILQ_REMOVE(&s->alerts, sb, entry);
SLIST_REMOVE(&s->alerts, sb, session_alert, entry);
xfree(sb);
}
}
@ -60,7 +60,7 @@ session_alert_add(struct session *s, struct window *w, int type)
sa = xmalloc(sizeof *sa);
sa->wl = wl;
sa->type = type;
TAILQ_INSERT_HEAD(&s->alerts, sa, entry);
SLIST_INSERT_HEAD(&s->alerts, sa, entry);
}
}
}
@ -70,7 +70,7 @@ session_alert_has(struct session *s, struct winlink *wl, int type)
{
struct session_alert *sa;
TAILQ_FOREACH(sa, &s->alerts, entry) {
SLIST_FOREACH(sa, &s->alerts, entry) {
if (sa->wl == wl && sa->type == type)
return (1);
}
@ -83,7 +83,7 @@ session_alert_has_window(struct session *s, struct window *w, int type)
{
struct session_alert *sa;
TAILQ_FOREACH(sa, &s->alerts, entry) {
SLIST_FOREACH(sa, &s->alerts, entry) {
if (sa->wl->window == w && sa->type == type)
return (1);
}
@ -119,7 +119,7 @@ session_create(const char *name, const char *cmd, u_int sx, u_int sy)
fatal("gettimeofday");
s->curw = s->lastw = NULL;
RB_INIT(&s->windows);
TAILQ_INIT(&s->alerts);
SLIST_INIT(&s->alerts);
paste_init_stack(&s->buffers);
options_init(&s->options, &global_options);

8
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.194 2008-11-04 20:41:10 nicm Exp $ */
/* $Id: tmux.h,v 1.195 2008-11-05 01:19:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -629,7 +629,7 @@ struct session_alert {
struct winlink *wl;
int type;
TAILQ_ENTRY(session_alert) entry;
SLIST_ENTRY(session_alert) entry;
};
struct session {
@ -647,7 +647,7 @@ struct session {
struct paste_stack buffers;
TAILQ_HEAD(, session_alert) alerts;
SLIST_HEAD(, session_alert) alerts;
#define SESSION_UNATTACHED 0x1 /* not attached to any clients */
int flags;
@ -671,7 +671,7 @@ struct tty_term {
#define TERM_256COLOURS 0x2
int flags;
TAILQ_ENTRY(tty_term) entry;
SLIST_ENTRY(tty_term) entry;
};
struct tty {

10
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.48 2008-10-27 20:13:37 nicm Exp $ */
/* $Id: tty.c,v 1.49 2008-11-05 01:19:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -98,7 +98,7 @@ void (*tty_cmds[])(struct tty *, struct screen *, va_list) = {
tty_cmd_cell,
};
TAILQ_HEAD(, tty_term) tty_terms = TAILQ_HEAD_INITIALIZER(tty_terms);
SLIST_HEAD(, tty_term) tty_terms = SLIST_HEAD_INITIALIZER(tty_terms);
void
tty_init(struct tty *tty, char *path, char *term)
@ -256,7 +256,7 @@ tty_find_term(char *name, int fd, char **cause)
struct tty_term *term;
int error;
TAILQ_FOREACH(term, &tty_terms, entry) {
SLIST_FOREACH(term, &tty_terms, entry) {
if (strcmp(term->name, name) == 0) {
term->references++;
return (term);
@ -267,7 +267,7 @@ tty_find_term(char *name, int fd, char **cause)
term->name = xstrdup(name);
term->term = NULL;
term->references = 1;
TAILQ_INSERT_HEAD(&tty_terms, term, entry);
SLIST_INSERT_HEAD(&tty_terms, term, entry);
if (setupterm(name, fd, &error) != OK) {
switch (error) {
@ -370,7 +370,7 @@ tty_free_term(struct tty_term *term)
if (--term->references != 0)
return;
TAILQ_REMOVE(&tty_terms, term, entry);
SLIST_REMOVE(&tty_terms, term, tty_term, entry);
#ifdef __FreeBSD___
/*