summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0b3bcb6)
raw | patch | inline | side by side (parent: 0b3bcb6)
author | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 10:27:29 +0000 (12:27 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 10:27:29 +0000 (12:27 +0200) |
Add missing prototypes, and fix wrong prototypes. Convert lots of
functions to "static" when they are only used within the current
source file.
functions to "static" when they are only used within the current
source file.
15 files changed:
src/command.c | patch | blob | history | |
src/main.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history | |
src/ncmpc.h | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen.h | patch | blob | history | |
src/screen_file.c | patch | blob | history | |
src/screen_lyrics.c | patch | blob | history | |
src/screen_play.c | patch | blob | history | |
src/screen_search.c | patch | blob | history | |
src/screen_utils.c | patch | blob | history | |
src/src_lyrics.c | patch | blob | history | |
src/src_lyrics.h | patch | blob | history | |
src/wreadln.c | patch | blob | history | |
src/wreadln.h | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 4f4a8e938b0a6f0f23951f2abb63315d33729763..733bf6a314567d26a04b78a4c84e26848b1f5640 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#include "config.h"
#include "ncmpc.h"
#include "command.h"
+#include "mpdclient.h"
+#include "screen.h"
#undef DEBUG_KEYS
#define DK(x)
#endif
-extern void sigstop(void);
-extern void screen_resize(void);
-
#define BS KEY_BACKSPACE
#define DEL KEY_DC
#define UP KEY_UP
}
}
-int
+static int
set_key_flags(command_definition_t *cp, command_t command, int flags)
{
int i;
diff --git a/src/main.c b/src/main.c
index 022802c8027d31b2d252d2c7075b1cc1f21ac713..6a6ba34f36bf4ff5c3b9ca8adfe3e8c414a10cfc 100644 (file)
--- a/src/main.c
+++ b/src/main.c
}
}
-void
+static void
exit_and_cleanup(void)
{
screen_exit();
g_timer_destroy(timer);
}
-void
+static void
catch_sigint( int sig )
{
printf("\n%s\n", _("Exiting..."));
exit(EXIT_SUCCESS);
}
-void
+
+static void
catch_sigcont( int sig )
{
D("catch_sigcont()\n");
diff --git a/src/mpdclient.h b/src/mpdclient.h
index 5f231c3833386ae10a661210fa1dbe626d8776c1..c8cb8686b6b1d0fce6e6f07362970e86f2c62945 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
} mpdclient_t;
/** functions ***************************************************************/
+
+gint
+mpdclient_finish_command(mpdclient_t *c);
+
mpdclient_t *mpdclient_new(void);
mpdclient_t *mpdclient_free(mpdclient_t *c);
gint mpdclient_connect(mpdclient_t *c, gchar *host, gint port,
diff --git a/src/ncmpc.h b/src/ncmpc.h
index 9caf8601a2aa45795f4b46c6770e8f0b082095c1..0d87ebaecd6a32f8b965442af42f98934575a67b 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
#define DEFAULT_SCROLL TRUE
#define DEFAULT_SCROLL_SEP " *** "
+void
+sigstop(void);
+
#endif /* NCMPC_H */
diff --git a/src/screen.c b/src/screen.c
index af3417a3ed104e8079fc732e656b21c84302a489..4624974c1ad6e157db1fe58189119b32b8ae6b4d 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
return -1;
}
-gint get_cur_mode_id()
+gint get_cur_mode_id(void)
{
return screens[screen->mode].id;
}
}
void
-ncurses_init()
+ncurses_init(void)
{
/* initialize the curses library */
}
}
+int
screen_init(mpdclient_t *c)
{
gint i;
diff --git a/src/screen.h b/src/screen.h
index 4f3057df8172b7ba4292c71d9a1a7f3f3f52bd17..0ecd9ef2c2a33f3fa7d34cd7f7b04f0196479287 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
screen_get_lw_fn_t get_lw;
} screen_functions_t;
+void
+ncurses_init(void);
int screen_init(mpdclient_t *c);
int screen_exit(void);
gint screen_get_id(const char *name);
-gint get_cur_mode_id();
+gint get_cur_mode_id(void);
int screen_get_mouse_event(mpdclient_t *c,
list_window_t *lw, int lw_length,
unsigned long *bstate, int *row);
+screen_functions_t *
+get_screen_search(void);
+
+screen_functions_t *
+get_screen_browse(void);
+
+screen_functions_t *
+get_screen_playlist(void);
+
+screen_functions_t *
+get_screen_help(void);
+
+screen_functions_t *
+get_screen_lyrics(void);
+
+screen_functions_t *
+get_screen_keydef(void);
+
+screen_functions_t *
+get_screen_clock(void);
+
#endif
diff --git a/src/screen_file.c b/src/screen_file.c
index 35245a194f6050fea2e59ef53688dcbf809126d1..0dbaab45c64bd47896f93f8813bfb42f461e2a58 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
return list_window_cmd(lw, filelist->length, cmd);
}
-list_window_t *
-get_filelist_window()
+static list_window_t *
+get_filelist_window(void)
{
return lw;
}
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 4417d138596a9dad125e3b56c9fb8c6c89b80ae7..793eae7eeb672f53aef2d9f81ec27d6e4012f11d 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
static void lyrics_paint(screen_t *screen, mpdclient_t *c);
-FILE *create_lyr_file(char *artist, char *title)
+static FILE *create_lyr_file(char *artist, char *title)
{
char path[1024];
}
-int store_lyr_hd()
+static int store_lyr_hd(void)
{
char artist[512];
char title[512];
}
-void check_repaint()
+static void check_repaint(void)
{
if(screen_get_id("lyrics") == get_cur_mode_id())lyrics_paint(NULL, NULL);
}
-gpointer get_lyr(void *c)
+static gpointer get_lyr(void *c)
{
mpd_Status *status = ((retrieval_spec*)c)->client->status;
mpd_Song *cur = ((retrieval_spec*)c)->client->song;
diff --git a/src/screen_play.c b/src/screen_play.c
index 1878bd9ce8ae9bd85854a67773657834539d7e39..6cd28d6ace2c8997a5b8628d001ab31faf77d901 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
#include "colors.h"
#include "screen.h"
#include "screen_utils.h"
+#include "screen_play.h"
#define MAX_SONG_LENGTH 512
return 0;
}
-void save_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
+static void
+save_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
{
completion_callback_data_t *tmp = (completion_callback_data_t *)data;
GList **list = tmp->list;
}
}
-void save_post_completion_cb(GCompletion *gcmp, gchar *line, GList *items,
- void *data)
+static void
+save_post_completion_cb(GCompletion *gcmp, gchar *line, GList *items,
+ void *data)
{
completion_callback_data_t *tmp = (completion_callback_data_t *)data;
screen_t *screen = tmp->screen;
return 0;
}
-void add_dir(GCompletion *gcmp, gchar *dir, GList **dir_list, GList **list,
- mpdclient_t *c)
+static void add_dir(GCompletion *gcmp, gchar *dir, GList **dir_list,
+ GList **list, mpdclient_t *c)
{
g_completion_remove_items(gcmp, *list);
*list = string_list_remove(*list, dir);
*dir_list = g_list_append(*dir_list, g_strdup(dir));
}
-void add_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
+static void add_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
{
completion_callback_data_t *tmp = (completion_callback_data_t *)data;
GList **dir_list = tmp->dir_list;
}
}
-void add_post_completion_cb(GCompletion *gcmp, gchar *line, GList *items,
- void *data)
+static void add_post_completion_cb(GCompletion *gcmp, gchar *line,
+ GList *items, void *data)
{
completion_callback_data_t *tmp = (completion_callback_data_t *)data;
GList **dir_list = tmp->dir_list;
diff --git a/src/screen_search.c b/src/screen_search.c
index 816968619bc3c5f248da7641eae8f6f4390e8601..a74ef6092ccedf1669ada7f2a0940e22f97867b5 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
}
#ifdef FUTURE
-mpdclient_filelist_t *
+static mpdclient_filelist_t *
filelist_search(mpdclient_t *c, int exact_match, int table, gchar *pattern)
{
mpdclient_filelist_t *list, *list2;
}
static list_window_t *
-get_filelist_window()
+get_filelist_window(void)
{
return lw;
}
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 9b3bfa26628d7f311f679917c74d108cf821c604..a1cdedb2c24d26f854f721d10ac045cce82b5895 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
return screen_readln(w, prompt, NULL, NULL, NULL);
}
-char *
+static char *
screen_read_password(WINDOW *w, const char *prompt)
{
if(w == NULL)
curs_set(0);
}
-gint
+static gint
_screen_auth(mpdclient_t *c, gint recursion)
{
mpd_clearError(c->connection);
diff --git a/src/src_lyrics.c b/src/src_lyrics.c
index ecacef250f85c76f1f5fa7b918608b80547d50eb..4d41aea3752db1aba0459a9c076bbd75b2ae1cd3 100644 (file)
--- a/src/src_lyrics.c
+++ b/src/src_lyrics.c
int register_lyr_hd (src_lyr *source_descriptor);
#endif
-int src_lyr_stack_init ()
+static int src_lyr_plugins_load(void);
+
+void src_lyr_stack_init(void)
{
src_lyr_stack = g_array_new (TRUE, FALSE, sizeof (src_lyr*));
#endif
}
-int src_lyr_init ()
+int src_lyr_init(void)
{
src_lyr_stack_init ();
return 0;
}
-int src_lyr_load_plugin_file (const char *file)
+static int src_lyr_load_plugin_file(const char *file)
{
GString *path;
path = g_string_new (PLUGIN_DIR_SYSTEM);
return 0;
}
-void src_lyr_plugins_load_from_dir (GDir *plugin_dir)
+static void src_lyr_plugins_load_from_dir(GDir *plugin_dir)
{
const gchar *cur_file;
}
}
-int src_lyr_plugins_load ()
+static int src_lyr_plugins_load(void)
{
GDir *plugin_dir;
diff --git a/src/src_lyrics.h b/src/src_lyrics.h
index 140906e26f4259ca36f6add45791e9e015cb6e16..7a2e7eaee322b98de4dc7476c43cbd145f9270b6 100644 (file)
--- a/src/src_lyrics.h
+++ b/src/src_lyrics.h
char *description;
int (*register_src_lyr) (src_lyr *source_descriptor);
- int (*deregister_src_lyr) ();
+ int (*deregister_src_lyr)(void);
int (*check_lyr) (char *artist, char *title, char *url);
int (*get_lyr) (char *artist, char *title);
- int (*state_lyr) ();
+ int (*state_lyr)(void);
#ifndef DISABLE_PLUGIN_SYSTEM
GModule *module;
GArray *src_lyr_stack;
-int src_lyr_stack_init ();
-int src_lyr_init ();
+int get_text_line(formed_text *text, int num, char *dest, int len);
+
+void src_lyr_stack_init(void);
+int src_lyr_init(void);
int get_lyr_by_src (int priority, char *artist, char *title);
#endif
diff --git a/src/wreadln.c b/src/wreadln.c
index e49308a3f78cd4cd1810d7cacf2ac3928683b3df..f6b848cdd86788df9ade64319e474e8c8f052fad 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
/* libcurses version */
-gchar *
+static gchar *
_wreadln(WINDOW *w,
const gchar *prompt,
const gchar *initial_value,
/* libcursesw version */
-gchar *
+static gchar *
_wreadln(WINDOW *w,
const gchar *prompt,
const gchar *initial_value,
diff --git a/src/wreadln.h b/src/wreadln.h
index 35e91bcf2a90006acc0735ee87c75ad50e948c98..d448f4119bd71e105597f160cc3ab57c3b2b360f 100644 (file)
--- a/src/wreadln.h
+++ b/src/wreadln.h
GCompletion *gcmp /* a GCompletion structure or NULL */
);
+gchar *
+wreadln_masked(WINDOW *w,
+ const gchar *prompt,
+ const gchar *initial_value,
+ gint x1,
+ GList **history,
+ GCompletion *gcmp);
#endif