From fb70ff1a3441d1076ba9eafe61d94b81190dda44 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 25 Sep 2008 21:21:29 +0200 Subject: screen: removed screen.mode Everything is now managed with a pointer to the screen_functions struct. --- src/screen_list.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/screen_list.c') 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; -} -- cgit v1.2.3