diff options
author | Max Kellermann <max@duempel.org> | 2008-09-16 19:11:40 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-16 19:11:40 +0200 |
commit | 1f5d824d59709708350d37e6808383fc948e5dab (patch) | |
tree | 3619f58f58adb56672cb2bf160f23e00b4f17f1c /src/screen.c | |
parent | 318c4f1db7644b0c6e4cb1650b83bd550c297a49 (diff) | |
download | mpd-1f5d824d59709708350d37e6808383fc948e5dab.tar.gz mpd-1f5d824d59709708350d37e6808383fc948e5dab.tar.xz mpd-1f5d824d59709708350d37e6808383fc948e5dab.zip |
screen: added struct names
Let us declare struct names in addition to typedef names, so we can
forward-declare them.
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/screen.c b/src/screen.c index e89e4ebf8..da7e132fa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -50,26 +50,23 @@ /* screens */ -extern screen_functions_t *get_screen_playlist(void); -extern screen_functions_t *get_screen_browse(void); -extern screen_functions_t *get_screen_help(void); -extern screen_functions_t *get_screen_search(void); -extern screen_functions_t *get_screen_artist(void); -extern screen_functions_t *get_screen_keydef(void); -extern screen_functions_t *get_screen_clock(void); -extern screen_functions_t *get_screen_lyrics(void); - -typedef screen_functions_t * (*screen_get_mode_functions_fn_t) (void); - -typedef struct +extern struct screen_functions *get_screen_playlist(void); +extern struct screen_functions *get_screen_browse(void); +extern struct screen_functions *get_screen_help(void); +extern struct screen_functions *get_screen_search(void); +extern struct screen_functions *get_screen_artist(void); +extern struct screen_functions *get_screen_keydef(void); +extern struct screen_functions *get_screen_clock(void); +extern struct screen_functions *get_screen_lyrics(void); + +typedef struct screen_functions * (*screen_get_mode_functions_fn_t) (void); + +static const struct { gint id; const gchar *name; screen_get_mode_functions_fn_t get_mode_functions; -} screen_mode_info_t; - - -static screen_mode_info_t screens[] = { +} screens[] = { { SCREEN_PLAYLIST_ID, "playlist", get_screen_playlist }, { SCREEN_BROWSE_ID, "browse", get_screen_browse }, #ifdef ENABLE_ARTIST_SCREEN @@ -93,7 +90,7 @@ static screen_mode_info_t screens[] = { static gboolean welcome = TRUE; static screen_t *screen = NULL; -static screen_functions_t *mode_fn = NULL; +static struct screen_functions *mode_fn = NULL; static int seek_id = -1; static int seek_target_time = 0; @@ -416,7 +413,7 @@ screen_exit(void) /* close and exit all screens (playlist,browse,help...) */ i=0; while (screens[i].get_mode_functions) { - screen_functions_t *sf = screens[i].get_mode_functions(); + struct screen_functions *sf = screens[i].get_mode_functions(); if (sf && sf->close) sf->close(); @@ -480,7 +477,7 @@ screen_resize(void) /* close and exit all screens (playlist,browse,help...) */ i=0; while (screens[i].get_mode_functions) { - screen_functions_t *sf = screens[i].get_mode_functions(); + struct screen_functions *sf = screens[i].get_mode_functions(); if (sf && sf->resize) sf->resize(screen->main_window.cols, screen->main_window.rows); @@ -629,7 +626,7 @@ screen_init(mpdclient_t *c) i=0; while( screens[i].get_mode_functions ) { - screen_functions_t *fn = screens[i].get_mode_functions(); + struct screen_functions *fn = screens[i].get_mode_functions(); if( fn && fn->init ) fn->init(screen->main_window.w, |