aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-09-21 16:31:15 +0000
committerTiago Cunha <tcunha@gmx.com>2011-09-21 16:31:15 +0000
commit40af1a854c17722e70f9c28882020f2fa65a1959 (patch)
tree1fea7d8f5afb8717986352f29c44c86eafd2af70 /tmux.h
parentfb5b95883777c61cae129d4b01abc6776ba9005c (diff)
downloadrtmux-40af1a854c17722e70f9c28882020f2fa65a1959.tar.gz
rtmux-40af1a854c17722e70f9c28882020f2fa65a1959.tar.bz2
rtmux-40af1a854c17722e70f9c28882020f2fa65a1959.zip
Sync OpenBSD patchset 953:
Add initial framework for more powerful formatting of command output and use it for list-{panes,windows,sessions}. This allows more descriptive replacements (such as #{session_name}) and conditionals. Later this will be used for status_replace and list-keys and other places.
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tmux.h b/tmux.h
index 4458813b..74add288 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1299,6 +1299,15 @@ struct options_table_entry {
long long default_num;
};
+/* Tree of format entries. */
+struct format_entry {
+ char *key;
+ char *value;
+
+ RB_ENTRY(format_entry) entry;
+};
+RB_HEAD(format_tree, format_entry);
+
/* List of configuration causes. */
ARRAY_DECL(causelist, char *);
@@ -1341,6 +1350,20 @@ extern struct causelist cfg_causes;
void printflike2 cfg_add_cause(struct causelist *, const char *, ...);
int load_cfg(const char *, struct cmd_ctx *, struct causelist *);
+/* format.c */
+int format_cmp(struct format_entry *, struct format_entry *);
+RB_PROTOTYPE(format_tree, format_entry, entry, format_cmp);
+struct format_tree *format_create(void);
+void format_free(struct format_tree *);
+void format_add(
+ struct format_tree *, const char *, const char *, ...);
+const char *format_find(struct format_tree *, const char *);
+char *format_expand(struct format_tree *, const char *);
+void format_session(struct format_tree *, struct session *);
+void format_winlink(
+ struct format_tree *, struct session *, struct winlink *);
+void format_window_pane(struct format_tree *, struct window_pane *);
+
/* mode-key.c */
extern const struct mode_key_table mode_key_tables[];
extern struct mode_key_tree mode_key_tree_vi_edit;