diff options
Diffstat (limited to 'src/screen_list.c')
-rw-r--r-- | src/screen_list.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/screen_list.c b/src/screen_list.c index fddeeb025..31e8adaf1 100644 --- a/src/screen_list.c +++ b/src/screen_list.c @@ -86,11 +86,15 @@ screen_list_resize(unsigned cols, unsigned rows) } const char * -screen_get_name(unsigned i) +screen_get_name(const struct screen_functions *sf) { - assert(i < NUM_SCREENS); + unsigned i; + + for (i = 0; i < NUM_SCREENS; ++i) + if (screens[i].functions == sf) + return screens[i].name; - return screens[i].name; + return NULL; } const struct screen_functions * @@ -104,15 +108,3 @@ screen_lookup_name(const char *name) return NULL; } - -int -lookup_mode(const struct screen_functions *sf) -{ - unsigned i; - - for (i = 0; i < NUM_SCREENS; ++i) - if (screens[i].functions == sf) - return i; - - return -1; -} |