diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-07 10:07:22 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-07 10:07:22 +0000 |
commit | f47a063841f2baa1590fb9e53713b3713a03020d (patch) | |
tree | 8f21004a7ea01ea5c72519e8cd3e44535c57fc45 /session.c | |
parent | bc3580fa066ee38fd752b8414cb72af7bf3861b8 (diff) | |
download | rtmux-f47a063841f2baa1590fb9e53713b3713a03020d.tar.gz rtmux-f47a063841f2baa1590fb9e53713b3713a03020d.tar.bz2 rtmux-f47a063841f2baa1590fb9e53713b3713a03020d.zip |
Rename session idx to session id throughout and add $ prefix to targets to use
it, extended from a diff from George Nachman.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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); |