aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/window.c b/window.c
index 14cdfc00..92d955c0 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.50 2008-09-26 06:45:28 nicm Exp $ */
+/* $Id: window.c,v 1.51 2008-11-16 10:10:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -164,6 +164,32 @@ winlink_previous(unused struct winlinks *wwl, struct winlink *wl)
#endif
}
+void
+winlink_stack_push(struct winlink_stack *stack, struct winlink *wl)
+{
+ if (wl == NULL)
+ return;
+
+ winlink_stack_remove(stack, wl);
+ SLIST_INSERT_HEAD(stack, wl, sentry);
+}
+
+void
+winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl)
+{
+ struct winlink *wl2;
+
+ if (wl == NULL)
+ return;
+
+ SLIST_FOREACH(wl2, stack, sentry) {
+ if (wl2 == wl) {
+ SLIST_REMOVE(stack, wl, winlink, sentry);
+ return;
+ }
+ }
+}
+
struct window *
window_create(const char *name,
const char *cmd, const char **envp, u_int sx, u_int sy, u_int hlimit)