summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-03-25 10:11:45 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-03-25 10:11:45 +0000
commit6fee3e9e4b4c68c5d3d7f333c779ac865af7bf86 (patch)
tree9ea9b10bb53304355591a8c1889fd6e2a04519aa /session.c
parent748acdc77ca11a09e637324946a6a4f189defc8e (diff)
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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/session.c b/session.c
index b1944bc3..c7b54a2b 100644
--- a/session.c
+++ b/session.c
@@ -30,7 +30,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 *);
@@ -70,14 +70,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);
@@ -121,13 +121,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);