aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_list.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-25 21:21:29 +0200
committerMax Kellermann <max@duempel.org>2008-09-25 21:21:29 +0200
commitfb70ff1a3441d1076ba9eafe61d94b81190dda44 (patch)
treeb0016efae9e322393e9e86964169c26210bf167d /src/screen_list.c
parent5c752834b88e5f956e535da674f5a712757f69e7 (diff)
downloadmpd-fb70ff1a3441d1076ba9eafe61d94b81190dda44.tar.gz
mpd-fb70ff1a3441d1076ba9eafe61d94b81190dda44.tar.xz
mpd-fb70ff1a3441d1076ba9eafe61d94b81190dda44.zip
screen: removed screen.mode
Everything is now managed with a pointer to the screen_functions struct.
Diffstat (limited to '')
-rw-r--r--src/screen_list.c22
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;
-}