diff options
author | nicm <nicm> | 2015-04-25 18:09:28 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-04-25 18:09:28 +0000 |
commit | 6dbd63ba4f2da666d55267692c610b9ed8d1d8dd (patch) | |
tree | 371fc59e074cf40d3ac07964916dd64d1953bfc7 /session.c | |
parent | d23af6cca0c4d55097d567bbfea42aecf0ca36b0 (diff) | |
download | rtmux-6dbd63ba4f2da666d55267692c610b9ed8d1d8dd.tar.gz rtmux-6dbd63ba4f2da666d55267692c610b9ed8d1d8dd.tar.bz2 rtmux-6dbd63ba4f2da666d55267692c610b9ed8d1d8dd.zip |
Move the functions to convert ids from strings into session.c and window.c.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -70,6 +70,22 @@ session_find(const char *name) return (RB_FIND(sessions, &sessions, &s)); } +/* Find session by id parsed from a string. */ +struct session * +session_find_by_id_str(const char *s) +{ + const char *errstr; + u_int id; + + if (*s != '$') + return (NULL); + + id = strtonum(s + 1, 0, UINT_MAX, &errstr); + if (errstr != NULL) + return (NULL); + return (session_find_by_id(id)); +} + /* Find session by id. */ struct session * session_find_by_id(u_int id) |