summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-05-25 10:56:19 +0000
committersabetts <sabetts>2003-05-25 10:56:19 +0000
commite6f71abbce1ae8f8dc840b56aa4f3ccd36ebd735 (patch)
tree5270321337709993548139d4caee6be1353d94b1
parentb6d1a9b5096e8e26acbe392ca44216d8573427e4 (diff)
downloadratpoison-e6f71abbce1ae8f8dc840b56aa4f3ccd36ebd735.zip
* src/window.c: do not include ctype.h
* src/ratpoison.h (str_comp): new prototype * src/messages.h (MESSAGE_PROMPT_SWITCH_TO_GROUP): new define * src/main.c: include ctype.h (str_comp): moved from window.c * src/group.h (groups_find_group_by_name): new prototype. (groups_find_group_by_number): likewise. (groups_merge): likewise (group_move_window): likewise * src/group.c: include string.h (group_new): new argument, name. All callers updated. prototype updated. (init_groups): create the first group with DEFAULT_GROUP_NAME as its name. (group_new): new argument, name. All callers updated. Prototype updated. (group_free): free the group's name. (group_add_new_group): new argument, name. All callers updated. Prototype updated. (groups_find_group_by_name): new function (groups_find_group_by_number): likewise (group_move_window): likewise (groups_merge): likewise * src/conf.h (DEFAULT_GROUP_NAME): new define * src/actions.h (cmd_gselect): new prototype (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise (cmd_gnewbg): likewise * src/actions.c (user_commands): new commands gselect, groups, gmove, gmerge, gnewbg. (cmd_gnewbg): new function (find_group): likewise (cmd_gselect): likewise (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise
-rw-r--r--ChangeLog46
-rw-r--r--src/actions.c139
-rw-r--r--src/actions.h7
-rw-r--r--src/bar.c2
-rw-r--r--src/bar.h2
-rw-r--r--src/communications.c2
-rw-r--r--src/communications.h2
-rw-r--r--src/conf.h5
-rw-r--r--src/data.h2
-rw-r--r--src/events.c2
-rw-r--r--src/events.h2
-rw-r--r--src/frame.c2
-rw-r--r--src/frame.h2
-rw-r--r--src/globals.c20
-rw-r--r--src/globals.h20
-rw-r--r--src/group.c126
-rw-r--r--src/group.h9
-rw-r--r--src/input.c2
-rw-r--r--src/input.h2
-rw-r--r--src/linkedlist.h2
-rw-r--r--src/main.c15
-rw-r--r--src/manage.c2
-rw-r--r--src/manage.h2
-rw-r--r--src/messages.h3
-rw-r--r--src/number.c2
-rw-r--r--src/number.h2
-rw-r--r--src/ratpoison.h3
-rw-r--r--src/sbuf.c2
-rw-r--r--src/sbuf.h2
-rw-r--r--src/screen.c2
-rw-r--r--src/screen.h2
-rw-r--r--src/split.c2
-rw-r--r--src/split.h2
-rw-r--r--src/window.c15
-rw-r--r--src/window.h2
35 files changed, 403 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index ec6dbdf..ce70955 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,51 @@
2003-05-25 Shawn Betts <sabetts@sfu.ca>
+ * src/window.c: do not include ctype.h
+
+ * src/ratpoison.h (str_comp): new prototype
+
+ * src/messages.h (MESSAGE_PROMPT_SWITCH_TO_GROUP): new define
+
+ * src/main.c: include ctype.h
+ (str_comp): moved from window.c
+
+ * src/group.h (groups_find_group_by_name): new prototype.
+ (groups_find_group_by_number): likewise.
+ (groups_merge): likewise
+ (group_move_window): likewise
+
+ * src/group.c: include string.h
+ (group_new): new argument, name. All callers updated. prototype
+ updated.
+ (init_groups): create the first group with DEFAULT_GROUP_NAME as
+ its name.
+ (group_new): new argument, name. All callers updated. Prototype
+ updated.
+ (group_free): free the group's name.
+ (group_add_new_group): new argument, name. All callers
+ updated. Prototype updated.
+ (groups_find_group_by_name): new function
+ (groups_find_group_by_number): likewise
+ (group_move_window): likewise
+ (groups_merge): likewise
+
+ * src/conf.h (DEFAULT_GROUP_NAME): new define
+
+ * src/actions.h (cmd_gselect): new prototype
+ (cmd_groups): likewise
+ (cmd_gmove): likewise
+ (cmd_gmerge): likewise
+ (cmd_gnewbg): likewise
+
+ * src/actions.c (user_commands): new commands gselect, groups,
+ gmove, gmerge, gnewbg.
+ (cmd_gnewbg): new function
+ (find_group): likewise
+ (cmd_gselect): likewise
+ (cmd_groups): likewise
+ (cmd_gmove): likewise
+ (cmd_gmerge): likewise
+
* src/bar.c (reset_alarm): new function
(show_bar): call reset_alarm()
(count_lines): make function static. clean up code.
diff --git a/src/actions.c b/src/actions.c
index c92fabd..ab9e12e 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -101,6 +101,11 @@ static user_command user_commands[] =
{"gnext", cmd_gnext, arg_VOID},
{"gprev", cmd_gprev, arg_VOID},
{"gnew", cmd_gnew, arg_VOID},
+ {"gnewbg", cmd_gnewbg, arg_VOID},
+ {"gselect", cmd_gselect, arg_VOID},
+ {"groups", cmd_groups, arg_VOID},
+ {"gmove", cmd_gmove, arg_VOID},
+ {"gmerge", cmd_gmerge, arg_VOID},
/* Commands to set default behavior. */
{"defbargravity", cmd_defbargravity, arg_STRING},
@@ -3156,6 +3161,136 @@ cmd_gprev (int interactive, char *data)
char *
cmd_gnew (int interactive, char *data)
{
- rp_current_group = group_add_new_group ();
+ rp_current_group = group_add_new_group (data);
+ return NULL;
+}
+
+char *
+cmd_gnewbg (int interactive, char *data)
+{
+ group_add_new_group (data);
+ return NULL;
+}
+
+/* Given a string, find a matching group. First check if the string is
+ a number, then check if it's the name of a group. */
+static rp_group *
+find_group (char *str)
+{
+ rp_group *group;
+ int n;
+
+ /* Check if the user typed a group number. */
+ n = string_to_window_number (str);
+ if (n >= 0)
+ {
+ group = groups_find_group_by_number (n);
+ if (group)
+ return group;
+ }
+
+ group = groups_find_group_by_name (str);
+ return group;
+}
+
+char *
+cmd_gselect (int interactive, char *data)
+{
+ char *str;
+ rp_group *g;
+
+ if (data == NULL)
+ str = get_input (MESSAGE_PROMPT_SWITCH_TO_GROUP);
+ else
+ str = xstrdup (data);
+
+ g = find_group (str);
+
+ if (g)
+ rp_current_group = g;
+ else
+ return cmd_groups (interactive, NULL);
+
+ free (str);
+
+ return NULL;
+}
+
+/* Show all the groups, with the current one highlighted. */
+char *
+cmd_groups (int interactive, char *data)
+{
+ rp_group *cur;
+ int mark_start = 0, mark_end = 0;
+ struct sbuf *buffer;
+
+ buffer = sbuf_new (0);
+
+ list_for_each_entry (cur, &rp_groups, node)
+ {
+ char *fmt;
+
+ if (cur == rp_current_group)
+ mark_start = strlen (sbuf_get (buffer));
+
+ fmt = xsprintf ("%d-%s", cur->number, cur->name);
+ sbuf_concat (buffer, fmt);
+
+ if (cur->node.next != &rp_groups)
+ sbuf_concat (buffer, "\n");
+
+ if (cur == rp_current_group)
+ mark_end = strlen (sbuf_get (buffer));
+ }
+
+ marked_message (sbuf_get (buffer), mark_start, mark_end);
+ sbuf_free (buffer);
+
+ return NULL;
+}
+
+/* Move a window to a different group. */
+char *
+cmd_gmove (int interactive, char *data)
+{
+ rp_group *g;
+
+ if (data == NULL)
+ {
+ message (" gmove: one argument required ");
+ return NULL;
+ }
+
+ if (current_window() == NULL)
+ {
+ message (" gmove: No focused window ");
+ return NULL;
+ }
+
+ g = find_group (data);
+ if (g == NULL)
+ {
+ message (" gmove: Cannot find group ");
+ return NULL;
+ }
+
+ group_move_window (g, current_window());
+ return NULL;
+}
+
+char *
+cmd_gmerge (int interactive, char *data)
+{
+ rp_group *g;
+
+ if (data == NULL)
+ {
+ message (" gmerge: one argument required ");
+ return NULL;
+ }
+
+ g = find_group (data);
+
+ groups_merge (g, rp_current_group);
return NULL;
}
diff --git a/src/actions.h b/src/actions.h
index 617f087..efc6e76 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -1,5 +1,5 @@
/* Prototypes of all actions that can be performed with keystrokes.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -127,6 +127,11 @@ char *cmd_verbexec (int interactive, char *data);
char *cmd_version (int interactive, char *data);
char *cmd_warp(int interactive, char *data);
char *cmd_windows (int interactive, char *data);
+char *cmd_gselect (int interactive, char *data);
+char *cmd_groups (int interactive, char *data);
+char *cmd_gmove (int interactive, char *data);
+char *cmd_gmerge (int interactive, char *data);
+char *cmd_gnewbg (int interactive, char *data);
void initialize_default_keybindings (void);
void free_keybindings ();
diff --git a/src/bar.c b/src/bar.c
index 89a5603..7ff0691 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -1,7 +1,7 @@
/* Functionality for a bar across the bottom of the screen listing the
* windows currently managed.
*
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/bar.h b/src/bar.h
index d5bf4f3..e1e13fc 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -1,5 +1,5 @@
/* functions for managing the program bar
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/communications.c b/src/communications.c
index d5e96d0..4e4e509 100644
--- a/src/communications.c
+++ b/src/communications.c
@@ -1,5 +1,5 @@
/* communications.c -- Send commands to a running copy of ratpoison.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/communications.h b/src/communications.h
index 6ece873..3bd6046 100644
--- a/src/communications.h
+++ b/src/communications.h
@@ -1,5 +1,5 @@
/* communications.h -- Send commands to a running copy of ratpoison.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/conf.h b/src/conf.h
index d1b30fd..2752548 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -1,5 +1,5 @@
/* Config file for ratpoison. Edit these values and recompile.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -97,4 +97,7 @@
about bad window messages. */
#define IGNORE_BADWINDOW 1
+/* This is the name of the first group that is created. */
+#define DEFAULT_GROUP_NAME "default"
+
#endif /* !_ _RATPOISON_CONF_H */
diff --git a/src/data.h b/src/data.h
index 60f7bb9..ec255ab 100644
--- a/src/data.h
+++ b/src/data.h
@@ -1,5 +1,5 @@
/* our datatypes and global variables
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/events.c b/src/events.c
index ce006e4..5cbe73a 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1,5 +1,5 @@
/* Ratpoison X events
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/events.h b/src/events.h
index fd21111..de7284d 100644
--- a/src/events.h
+++ b/src/events.h
@@ -1,5 +1,5 @@
/* Function prototypes
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/frame.c b/src/frame.c
index c978d7c..18352c1 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,5 +1,5 @@
/* functions that manipulate the frame structure.
- * Copyright (C) 2000-2003 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/frame.h b/src/frame.h
index 0e79434..e3147c7 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/globals.c b/src/globals.c
index d9478bd..1aef12e 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -1,3 +1,23 @@
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
+ *
+ * This file is part of ratpoison.
+ *
+ * ratpoison is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * ratpoison is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ */
+
#include "ratpoison.h"
int alarm_signalled = 0;
diff --git a/src/globals.h b/src/globals.h
index 011570e..4343b80 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1,3 +1,23 @@
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
+ *
+ * This file is part of ratpoison.
+ *
+ * ratpoison is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * ratpoison is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ */
+
#ifndef GLOBALS_H
#define GLOBALS_H
diff --git a/src/group.c b/src/group.c
index cbf645e..b69212e 100644
--- a/src/group.c
+++ b/src/group.c
@@ -1,5 +1,27 @@
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
+ *
+ * This file is part of ratpoison.
+ *
+ * ratpoison is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * ratpoison is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ */
+
#include "ratpoison.h"
+#include <string.h>
+
static struct numset *group_numset;
void init_groups()
@@ -11,18 +33,22 @@ void init_groups()
/* Create the first group in the list (We always need at least
one). */
- g = group_new (numset_request (group_numset));
+ g = group_new (numset_request (group_numset), DEFAULT_GROUP_NAME);
rp_current_group = g;
list_add_tail (&g->node, &rp_groups);
}
rp_group *
-group_new (int number)
+group_new (int number, char *name)
{
rp_group *g;
g = xmalloc (sizeof (rp_group));
+ if (name)
+ g->name = xstrdup (name);
+ else
+ g->name = NULL;
g->number = number;
g->numset = numset_new();
INIT_LIST_HEAD (&g->unmapped_windows);
@@ -34,18 +60,19 @@ group_new (int number)
void
group_free (rp_group *g)
{
- /* free (g->name); */
+ if (g->name)
+ free (g->name);
numset_free (g->numset);
numset_release (group_numset, g->number);
free (g);
}
rp_group *
-group_add_new_group ()
+group_add_new_group (char *name)
{
rp_group *g;
- g = group_new (numset_request (group_numset));
+ g = group_new (numset_request (group_numset), name);
list_add_tail (&g->node, &rp_groups);
return g;
@@ -63,6 +90,37 @@ group_prev_group ()
return list_prev_entry (rp_current_group, &rp_groups, node);
}
+rp_group *
+groups_find_group_by_name (char *s)
+{
+ rp_group *cur;
+
+ list_for_each_entry (cur, &rp_groups, node)
+ {
+ if (cur->name)
+ {
+ if (str_comp (s, cur->name, strlen (s)))
+ return cur;
+ }
+ }
+
+ return NULL;
+}
+
+rp_group *
+groups_find_group_by_number (int n)
+{
+ rp_group *cur;
+
+ list_for_each_entry (cur, &rp_groups, node)
+ {
+ if (cur->number == n)
+ return cur;
+ }
+
+ return NULL;
+}
+
rp_window_elem *
group_find_window (struct list_head *list, rp_window *win)
{
@@ -331,3 +389,61 @@ group_prev_window (rp_group *g, rp_window *win)
return NULL;
}
+
+void
+group_move_window (rp_group *to, rp_window *win)
+{
+ rp_group *cur, *from = NULL;
+ rp_window_elem *we = NULL;
+
+ /* Find the group that the window belongs to. FIXME: If the window
+ exists in multiple groups, then we're going to find the first
+ group with this window in it. */
+ list_for_each_entry (cur, &rp_groups, node)
+ {
+ we = group_find_window (&cur->mapped_windows, win);
+ if (we)
+ {
+ from = cur;
+ break;
+ }
+ }
+
+ if (we == NULL || from == NULL)
+ {
+ PRINT_DEBUG (("Unable to find window in mapped window lists.\n"));
+ return;
+ }
+
+ /* Manually remove the window from one group...*/
+ numset_release (from->numset, we->number);
+ list_del (&we->node);
+
+ /* and shove it into the other one. */
+ we->number = numset_request (to->numset);
+ group_insert_window (&to->mapped_windows, we);
+}
+
+void
+groups_merge (rp_group *from, rp_group *to)
+{
+ rp_window_elem *cur;
+ struct list_head *iter, *tmp;
+
+ /* Move the unmapped windows. */
+ list_for_each_safe_entry (cur, iter, tmp, &from->unmapped_windows, node)
+ {
+ list_del (&cur->node);
+ list_add_tail (&cur->node, &to->unmapped_windows);
+ }
+
+ /* Move the mapped windows. */
+ list_for_each_safe_entry (cur, iter, tmp, &from->mapped_windows, node)
+ {
+ numset_release (from->numset, cur->number);
+ list_del (&cur->node);
+
+ cur->number = numset_request (to->numset);
+ group_insert_window (&to->mapped_windows, cur);
+ }
+}
diff --git a/src/group.h b/src/group.h
index fa58cce..748c273 100644
--- a/src/group.h
+++ b/src/group.h
@@ -5,7 +5,7 @@ void init_groups ();
void group_add_window (rp_group *g, rp_window *w);
void group_resort_window (rp_group *g, rp_window_elem *w);
void group_free (rp_group *g);
-rp_group *group_new (int number);
+rp_group *group_new (int number, char *name);
void group_del_window (rp_group *g, rp_window *win);
void groups_del_window (rp_window *win);
@@ -18,15 +18,20 @@ void groups_unmap_window (rp_window *win);
rp_window *group_prev_window (rp_group *g, rp_window *win);
rp_window *group_next_window (rp_group *g, rp_window *win);
+rp_group *groups_find_group_by_name (char *s);
+rp_group *groups_find_group_by_number (int n);
rp_window *group_last_window (rp_group *g);
rp_group *group_prev_group ();
rp_group *group_next_group ();
-rp_group *group_add_new_group ();
+rp_group *group_add_new_group (char *name);
rp_window_elem *group_find_window (struct list_head *list, rp_window *win);
rp_window_elem *group_find_window_by_number (rp_group *g, int num);
+void group_move_window (rp_group *to, rp_window *win);
+void groups_merge (rp_group *from, rp_group *to);
+
#endif
diff --git a/src/input.c b/src/input.c
index 1cb370e..80d17dc 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1,5 +1,5 @@
/* Read kdb input from the user.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/input.h b/src/input.h
index 0544f37..bc074a9 100644
--- a/src/input.h
+++ b/src/input.h
@@ -1,5 +1,5 @@
/* Function prototypes.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/linkedlist.h b/src/linkedlist.h
index e9181ee..1314f69 100644
--- a/src/linkedlist.h
+++ b/src/linkedlist.h
@@ -1,5 +1,5 @@
/*
- * Burrowed from the Linux kernel.
+ * Borrowed from the Linux kernel.
*/
#ifndef _RATPOISON_LINKLIST_H
diff --git a/src/main.c b/src/main.c
index 60ec000..e241fa4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,5 @@
/* Ratpoison.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -34,6 +34,7 @@
#include <getopt.h>
#include <string.h>
#include <sys/wait.h>
+#include <ctype.h>
#include "ratpoison.h"
@@ -151,6 +152,18 @@ xsprintf (char *fmt, ...)
return buffer;
}
+/* A case insensitive strncmp. */
+int
+str_comp (char *s1, char *s2, int len)
+{
+ int i;
+
+ for (i=0; i<len; i++)
+ if (toupper (s1[i]) != toupper (s2[i])) return 0;
+
+ return 1;
+}
+
void
sighandler (int signum)
{
diff --git a/src/manage.c b/src/manage.c
index f6d5657..414b74a 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -1,6 +1,6 @@
/* Manage windows, such as Mapping them and making sure the proper key
* Grabs have been put in place.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/manage.h b/src/manage.h
index 651355f..3d51ebf 100644
--- a/src/manage.h
+++ b/src/manage.h
@@ -1,5 +1,5 @@
/* manage.h
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/messages.h b/src/messages.h
index 2da2734..65ee6d2 100644
--- a/src/messages.h
+++ b/src/messages.h
@@ -1,5 +1,5 @@
/* Ratpoison messages.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -41,6 +41,7 @@
#define MESSAGE_PROMPT_COMMAND ":"
#define MESSAGE_PROMPT_SWITCH_WM " Switch to wm: "
#define MESSAGE_PROMPT_XTERM_COMMAND MESSAGE_PROMPT_SHELL_COMMAND TERM_PROG " -e "
+#define MESSAGE_PROMPT_SWITCH_TO_GROUP " Switch to group: "
#define MESSAGE_WELCOME " Welcome to ratpoison! Hit `%s %s' for help. "
#define MESSAGE_FRAME_STRING " Current Frame "
diff --git a/src/number.c b/src/number.c
index 62b9783..a6ddd8e 100644
--- a/src/number.c
+++ b/src/number.c
@@ -1,5 +1,5 @@
/* handles the handing out of and uniqueness of window numbers.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/number.h b/src/number.h
index 363b1df..53bf4d2 100644
--- a/src/number.h
+++ b/src/number.h
@@ -1,5 +1,5 @@
/* Function prototypes.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/ratpoison.h b/src/ratpoison.h
index e1baf21..5646d1f 100644
--- a/src/ratpoison.h
+++ b/src/ratpoison.h
@@ -1,5 +1,5 @@
/* Standard header for ratpoison.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -84,5 +84,6 @@ void *xrealloc (void *ptr, size_t size);
char *xstrdup (char *s);
char *xsprintf (char *fmt, ...);
char *xvsprintf (char *fmt, va_list ap);
+int str_comp (char *s1, char *s2, int len);
#endif /* ! _RATPOISON_H */
diff --git a/src/sbuf.c b/src/sbuf.c
index 2049dcc..c28eed8 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -1,5 +1,5 @@
/* Functions for handling string buffers.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/sbuf.h b/src/sbuf.h
index 32cb4fe..cac77f2 100644
--- a/src/sbuf.h
+++ b/src/sbuf.h
@@ -1,5 +1,5 @@
/* Function prototypes for handling string buffers.
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/screen.c b/src/screen.c
index ff9c7d0..dec512a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/screen.h b/src/screen.h
index cda098e..35ccdd7 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/split.c b/src/split.c
index b64164b..854139a 100644
--- a/src/split.c
+++ b/src/split.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/split.h b/src/split.h
index 3dc113f..ac87f4d 100644
--- a/src/split.h
+++ b/src/split.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001 Shawn Betts
+/* Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
diff --git a/src/window.c b/src/window.c
index 9b75dab..eff38ea 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,5 +1,5 @@
/* functions for handling the window list
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include "ratpoison.h"
@@ -207,18 +206,6 @@ find_window_number (int n)
return NULL;
}
-/* A case insensitive strncmp. */
-static int
-str_comp (char *s1, char *s2, int len)
-{
- int i;
-
- for (i=0; i<len; i++)
- if (toupper (s1[i]) != toupper (s2[i])) return 0;
-
- return 1;
-}
-
rp_window *
find_window_name (char *name)
{
diff --git a/src/window.h b/src/window.h
index 9103f0a..ac26881 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,5 +1,5 @@
/* functions for managing the window list
- * Copyright (C) 2000, 2001 Shawn Betts
+ * Copyright (C) 2000, 2001, 2002, 2003 Shawn Betts
*
* This file is part of ratpoison.
*