summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2014-10-20 23:35:29 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2014-10-20 23:35:29 +0000
commit7b01a986e07898793077ec84a6ed15b9483f3f3e (patch)
treed069775902e0885e3702066e951d5a8302805cfd /usr.bin
parentb6045de1676bf019916f0fbccbc4b03f03f8b2cb (diff)
Move template defines back into .c files.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-break-pane.c4
-rw-r--r--usr.bin/tmux/cmd-choose-buffer.c5
-rw-r--r--usr.bin/tmux/cmd-choose-client.c8
-rw-r--r--usr.bin/tmux/cmd-choose-tree.c11
-rw-r--r--usr.bin/tmux/cmd-display-message.c7
-rw-r--r--usr.bin/tmux/cmd-find-window.c7
-rw-r--r--usr.bin/tmux/cmd-list-buffers.c5
-rw-r--r--usr.bin/tmux/cmd-list-clients.c7
-rw-r--r--usr.bin/tmux/cmd-list-sessions.c10
-rw-r--r--usr.bin/tmux/cmd-list-windows.c18
-rw-r--r--usr.bin/tmux/cmd-new-session.c4
-rw-r--r--usr.bin/tmux/cmd-new-window.c4
-rw-r--r--usr.bin/tmux/cmd-split-window.c4
-rw-r--r--usr.bin/tmux/tmux.h74
14 files changed, 80 insertions, 88 deletions
diff --git a/usr.bin/tmux/cmd-break-pane.c b/usr.bin/tmux/cmd-break-pane.c
index 6e16fad2d05..50c028cdce4 100644
--- a/usr.bin/tmux/cmd-break-pane.c
+++ b/usr.bin/tmux/cmd-break-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-break-pane.c,v 1.24 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-break-pane.c,v 1.25 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -26,6 +26,8 @@
* Break pane off into a window.
*/
+#define BREAK_PANE_TEMPLATE "#{session_name}:#{window_index}.#{pane_index}"
+
enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_break_pane_entry = {
diff --git a/usr.bin/tmux/cmd-choose-buffer.c b/usr.bin/tmux/cmd-choose-buffer.c
index 2595c865911..b4f11ddbfc4 100644
--- a/usr.bin/tmux/cmd-choose-buffer.c
+++ b/usr.bin/tmux/cmd-choose-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-choose-buffer.c,v 1.19 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-choose-buffer.c,v 1.20 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -27,6 +27,9 @@
* Enter choice mode to choose a buffer.
*/
+#define CHOOSE_BUFFER_TEMPLATE \
+ "#{buffer_name}: #{buffer_size} bytes: #{buffer_sample}"
+
enum cmd_retval cmd_choose_buffer_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_choose_buffer_entry = {
diff --git a/usr.bin/tmux/cmd-choose-client.c b/usr.bin/tmux/cmd-choose-client.c
index 8c1e9b32152..f8ae6c40d15 100644
--- a/usr.bin/tmux/cmd-choose-client.c
+++ b/usr.bin/tmux/cmd-choose-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-choose-client.c,v 1.20 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-choose-client.c,v 1.21 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -27,6 +27,12 @@
* Enter choice mode to choose a client.
*/
+#define CHOOSE_CLIENT_TEMPLATE \
+ "#{client_tty}: #{session_name} " \
+ "[#{client_width}x#{client_height} #{client_termname}]" \
+ "#{?client_utf8, (utf8),}#{?client_readonly, (ro),} " \
+ "(last used #{client_activity_string})"
+
enum cmd_retval cmd_choose_client_exec(struct cmd *, struct cmd_q *);
void cmd_choose_client_callback(struct window_choose_data *);
diff --git a/usr.bin/tmux/cmd-choose-tree.c b/usr.bin/tmux/cmd-choose-tree.c
index 29cabe22754..e5c2039b123 100644
--- a/usr.bin/tmux/cmd-choose-tree.c
+++ b/usr.bin/tmux/cmd-choose-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-choose-tree.c,v 1.26 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-choose-tree.c,v 1.27 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2012 Thomas Adam <thomas@xteddy.org>
@@ -32,6 +32,15 @@
* Enter choice mode to choose a session and/or window.
*/
+#define CHOOSE_TREE_SESSION_TEMPLATE \
+ "#{session_name}: #{session_windows} windows" \
+ "#{?session_grouped, (group ,}" \
+ "#{session_group}#{?session_grouped,),}" \
+ "#{?session_attached, (attached),}"
+#define CHOOSE_TREE_WINDOW_TEMPLATE \
+ "#{window_index}: #{window_name}#{window_flags} " \
+ "\"#{pane_title}\""
+
enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_choose_tree_entry = {
diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c
index 74dfb5be569..edb9a1d5743 100644
--- a/usr.bin/tmux/cmd-display-message.c
+++ b/usr.bin/tmux/cmd-display-message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-display-message.c,v 1.25 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-display-message.c,v 1.26 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -27,6 +27,11 @@
* Displays a message in the status line.
*/
+#define DISPLAY_MESSAGE_TEMPLATE \
+ "[#{session_name}] #{window_index}:" \
+ "#{window_name}, current pane #{pane_index} " \
+ "- (%H:%M %d-%b-%y)"
+
enum cmd_retval cmd_display_message_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_display_message_entry = {
diff --git a/usr.bin/tmux/cmd-find-window.c b/usr.bin/tmux/cmd-find-window.c
index fd1cc182f60..25fc7829650 100644
--- a/usr.bin/tmux/cmd-find-window.c
+++ b/usr.bin/tmux/cmd-find-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-find-window.c,v 1.28 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-find-window.c,v 1.29 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,6 +28,11 @@
* Find window containing text.
*/
+#define FIND_WINDOW_TEMPLATE \
+ "#{window_index}: #{window_name} " \
+ "[#{window_width}x#{window_height}] " \
+ "(#{window_panes} panes) #{window_find_matches}"
+
enum cmd_retval cmd_find_window_exec(struct cmd *, struct cmd_q *);
void cmd_find_window_callback(struct window_choose_data *);
diff --git a/usr.bin/tmux/cmd-list-buffers.c b/usr.bin/tmux/cmd-list-buffers.c
index ce6438a7980..dad16ad7865 100644
--- a/usr.bin/tmux/cmd-list-buffers.c
+++ b/usr.bin/tmux/cmd-list-buffers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-buffers.c,v 1.22 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-list-buffers.c,v 1.23 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -27,6 +27,9 @@
* List paste buffers.
*/
+#define LIST_BUFFERS_TEMPLATE \
+ "#{buffer_name}: #{buffer_size} bytes: \"#{buffer_sample}\""
+
enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_buffers_entry = {
diff --git a/usr.bin/tmux/cmd-list-clients.c b/usr.bin/tmux/cmd-list-clients.c
index 3271b835fdb..013b9fe2dd3 100644
--- a/usr.bin/tmux/cmd-list-clients.c
+++ b/usr.bin/tmux/cmd-list-clients.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-clients.c,v 1.18 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-list-clients.c,v 1.19 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,6 +28,11 @@
* List all clients.
*/
+#define LIST_CLIENTS_TEMPLATE \
+ "#{client_tty}: #{session_name} " \
+ "[#{client_width}x#{client_height} #{client_termname}]" \
+ "#{?client_utf8, (utf8),} #{?client_readonly, (ro),}"
+
enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_clients_entry = {
diff --git a/usr.bin/tmux/cmd-list-sessions.c b/usr.bin/tmux/cmd-list-sessions.c
index 30287bcb184..dcc5357cb65 100644
--- a/usr.bin/tmux/cmd-list-sessions.c
+++ b/usr.bin/tmux/cmd-list-sessions.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-sessions.c,v 1.17 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-list-sessions.c,v 1.18 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,6 +28,14 @@
* List all sessions.
*/
+#define LIST_SESSIONS_TEMPLATE \
+ "#{session_name}: #{session_windows} windows " \
+ "(created #{session_created_string}) " \
+ "[#{session_width}x#{session_height}]" \
+ "#{?session_grouped, (group ,}" \
+ "#{session_group}#{?session_grouped,),}" \
+ "#{?session_attached, (attached),}"
+
enum cmd_retval cmd_list_sessions_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_list_sessions_entry = {
diff --git a/usr.bin/tmux/cmd-list-windows.c b/usr.bin/tmux/cmd-list-windows.c
index 111070d9bea..d9d8081e4b3 100644
--- a/usr.bin/tmux/cmd-list-windows.c
+++ b/usr.bin/tmux/cmd-list-windows.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-windows.c,v 1.28 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-list-windows.c,v 1.29 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -27,11 +27,23 @@
* List windows on given session.
*/
+#define LIST_WINDOWS_TEMPLATE \
+ "#{window_index}: #{window_name}#{window_flags} " \
+ "(#{window_panes} panes) " \
+ "[#{window_width}x#{window_height}] " \
+ "[layout #{window_layout}] #{window_id}" \
+ "#{?window_active, (active),}";
+#define LIST_WINDOWS_WITH_SESSION_TEMPLATE \
+ "#{session_name}:" \
+ "#{window_index}: #{window_name}#{window_flags} " \
+ "(#{window_panes} panes) " \
+ "[#{window_width}x#{window_height}] "
+
enum cmd_retval cmd_list_windows_exec(struct cmd *, struct cmd_q *);
void cmd_list_windows_server(struct cmd *, struct cmd_q *);
-void cmd_list_windows_session(
- struct cmd *, struct session *, struct cmd_q *, int);
+void cmd_list_windows_session(struct cmd *, struct session *,
+ struct cmd_q *, int);
const struct cmd_entry cmd_list_windows_entry = {
"list-windows", "lsw",
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c
index b4ec363bc9f..f0cdc007df7 100644
--- a/usr.bin/tmux/cmd-new-session.c
+++ b/usr.bin/tmux/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-session.c,v 1.62 2014/10/20 22:57:46 nicm Exp $ */
+/* $OpenBSD: cmd-new-session.c,v 1.63 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -31,6 +31,8 @@
* Create a new session and attach to the current terminal unless -d is given.
*/
+#define NEW_SESSION_TEMPLATE "#{session_name}:"
+
enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_session_entry = {
diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c
index 22c7c6acd85..c0cbea5a2a6 100644
--- a/usr.bin/tmux/cmd-new-window.c
+++ b/usr.bin/tmux/cmd-new-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-window.c,v 1.42 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-new-window.c,v 1.43 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -30,6 +30,8 @@
* Create a new window.
*/
+#define NEW_WINDOW_TEMPLATE "#{session_name}:#{window_index}.#{pane_index}"
+
enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_window_entry = {
diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index bd7ae3e52f5..daca7d7b1e8 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.52 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.53 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -31,6 +31,8 @@
* Split a window (add a new pane).
*/
+#define SPLIT_WINDOW_TEMPLATE "#{session_name}:#{window_index}.#{pane_index}"
+
enum cmd_retval cmd_split_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_split_window_entry = {
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index a2b353cd44d..959fa9fd279 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.474 2014/10/20 23:27:14 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.475 2014/10/20 23:35:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -80,78 +80,6 @@ extern char **environ;
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
-/* Default template for choose-buffer. */
-#define CHOOSE_BUFFER_TEMPLATE \
- "#{buffer_name}: #{buffer_size} bytes: #{buffer_sample}"
-
-/* Default template for choose-client. */
-#define CHOOSE_CLIENT_TEMPLATE \
- "#{client_tty}: #{session_name} " \
- "[#{client_width}x#{client_height} #{client_termname}]" \
- "#{?client_utf8, (utf8),}#{?client_readonly, (ro),} " \
- "(last used #{client_activity_string})"
-
-/* Default templates for choose-tree. */
-#define CHOOSE_TREE_SESSION_TEMPLATE \
- "#{session_name}: #{session_windows} windows" \
- "#{?session_grouped, (group ,}" \
- "#{session_group}#{?session_grouped,),}" \
- "#{?session_attached, (attached),}"
-#define CHOOSE_TREE_WINDOW_TEMPLATE \
- "#{window_index}: #{window_name}#{window_flags} " \
- "\"#{pane_title}\""
-
-/* Default template for display-message. */
-#define DISPLAY_MESSAGE_TEMPLATE \
- "[#{session_name}] #{window_index}:" \
- "#{window_name}, current pane #{pane_index} " \
- "- (%H:%M %d-%b-%y)"
-
-/* Default template for find-window. */
-#define FIND_WINDOW_TEMPLATE \
- "#{window_index}: #{window_name} " \
- "[#{window_width}x#{window_height}] " \
- "(#{window_panes} panes) #{window_find_matches}"
-
-/* Default template for list-buffers. */
-#define LIST_BUFFERS_TEMPLATE \
- "#{buffer_name}: #{buffer_size} bytes: " \
- "\"#{buffer_sample}\""
-
-/* Default template for list-clients. */
-#define LIST_CLIENTS_TEMPLATE \
- "#{client_tty}: #{session_name} " \
- "[#{client_width}x#{client_height} #{client_termname}]" \
- "#{?client_utf8, (utf8),} #{?client_readonly, (ro),}"
-
-/* Default template for list-sessions. */
-#define LIST_SESSIONS_TEMPLATE \
- "#{session_name}: #{session_windows} windows " \
- "(created #{session_created_string}) " \
- "[#{session_width}x#{session_height}]" \
- "#{?session_grouped, (group ,}" \
- "#{session_group}#{?session_grouped,),}" \
- "#{?session_attached, (attached),}"
-
-/* Default templates for list-windows. */
-#define LIST_WINDOWS_TEMPLATE \
- "#{window_index}: #{window_name}#{window_flags} " \
- "(#{window_panes} panes) " \
- "[#{window_width}x#{window_height}] " \
- "[layout #{window_layout}] #{window_id}" \
- "#{?window_active, (active),}";
-#define LIST_WINDOWS_WITH_SESSION_TEMPLATE \
- "#{session_name}:" \
- "#{window_index}: #{window_name}#{window_flags} " \
- "(#{window_panes} panes) " \
- "[#{window_width}x#{window_height}] "
-
-/* Default templates for break-pane, new-window and split-window. */
-#define BREAK_PANE_TEMPLATE "#{session_name}:#{window_index}.#{pane_index}"
-#define NEW_SESSION_TEMPLATE "#{session_name}:"
-#define NEW_WINDOW_TEMPLATE BREAK_PANE_TEMPLATE
-#define SPLIT_WINDOW_TEMPLATE BREAK_PANE_TEMPLATE
-
/* Bell option values. */
#define BELL_NONE 0
#define BELL_ANY 1