aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-03-09 21:33:28 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-03-09 21:33:28 +0000
commit2ac6501698d5499967b33013d9f3fc8091fddc41 (patch)
treee699425a8ea2296d96aa0cd953646188a81df955 /session.c
parent06ac399ce6dc25201cfd1670b08ed8758034e2dc (diff)
parentdde5d49a5ed305cfa32f18c08d6f1b769d8ccef7 (diff)
downloadrtmux-2ac6501698d5499967b33013d9f3fc8091fddc41.tar.gz
rtmux-2ac6501698d5499967b33013d9f3fc8091fddc41.tar.bz2
rtmux-2ac6501698d5499967b33013d9f3fc8091fddc41.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'session.c')
-rw-r--r--session.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/session.c b/session.c
index 72e8fb05..74eb06a5 100644
--- a/session.c
+++ b/session.c
@@ -29,7 +29,7 @@
/* Global session list. */
struct sessions sessions;
struct sessions dead_sessions;
-u_int next_session;
+u_int next_session_id;
struct session_groups session_groups;
struct winlink *session_next_alert(struct winlink *);
@@ -69,14 +69,14 @@ session_find(const char *name)
return (RB_FIND(sessions, &sessions, &s));
}
-/* Find session by index. */
+/* Find session by id. */
struct session *
-session_find_by_index(u_int idx)
+session_find_by_id(u_int id)
{
struct session *s;
RB_FOREACH(s, sessions, &sessions) {
- if (s->idx == idx)
+ if (s->id == id)
return (s);
}
return (NULL);
@@ -120,13 +120,13 @@ session_create(const char *name, const char *cmd, const char *cwd,
if (name != NULL) {
s->name = xstrdup(name);
- s->idx = next_session++;
+ s->id = next_session_id++;
} else {
s->name = NULL;
do {
- s->idx = next_session++;
+ s->id = next_session_id++;
free (s->name);
- xasprintf(&s->name, "%u", s->idx);
+ xasprintf(&s->name, "%u", s->id);
} while (RB_FIND(sessions, &sessions, s) != NULL);
}
RB_INSERT(sessions, &sessions, s);