diff options
author | Max Kellermann <max@duempel.org> | 2008-11-27 17:56:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-27 17:56:32 +0100 |
commit | 45352152fbdcac20b39161069406ad6d5288bd98 (patch) | |
tree | 0fd7d529b7680de22ce33b8cc670c8994ef455ee /src/list_window.h | |
parent | f7d53b74a7743e120f9f1019c594cbd2de708caf (diff) | |
download | mpd-45352152fbdcac20b39161069406ad6d5288bd98.tar.gz mpd-45352152fbdcac20b39161069406ad6d5288bd98.tar.xz mpd-45352152fbdcac20b39161069406ad6d5288bd98.zip |
list_window: use "bool" instead of "int"
For flags and return values, use the "bool" data type instead of
"int".
Diffstat (limited to '')
-rw-r--r-- | src/list_window.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/list_window.h b/src/list_window.h index 11c4cddab..bcf3e3228 100644 --- a/src/list_window.h +++ b/src/list_window.h @@ -5,6 +5,7 @@ #include "command.h" #include <glib.h> +#include <stdbool.h> #ifdef HAVE_NCURSESW_NCURSES_H #include <ncursesw/ncurses.h> @@ -15,7 +16,7 @@ #define LW_HIDE_CURSOR 0x01 typedef const char *(*list_window_callback_fn_t)(unsigned index, - int *highlight, + bool *highlight, void *data); typedef struct list_window { @@ -45,13 +46,14 @@ void list_window_paint(struct list_window *lw, void *callback_data); /* perform basic list window commands (movement) */ -int list_window_cmd(struct list_window *lw, unsigned rows, command_t cmd); +bool +list_window_cmd(struct list_window *lw, unsigned rows, command_t cmd); /** * Scroll the window. Returns non-zero if the command has been * consumed. */ -int +bool list_window_scroll_cmd(struct list_window *lw, unsigned rows, command_t cmd); #ifdef HAVE_GETMOUSE @@ -59,7 +61,7 @@ list_window_scroll_cmd(struct list_window *lw, unsigned rows, command_t cmd); * The mouse was clicked. Check if the list should be scrolled * Returns non-zero if the mouse event has been handled. */ -int +bool list_window_mouse(struct list_window *lw, unsigned rows, unsigned long bstate, int y); #endif @@ -72,19 +74,20 @@ void list_window_set_selected(struct list_window *lw, unsigned n); void list_window_check_selected(struct list_window *lw, unsigned length); /* find a string in a list window */ -int list_window_find(struct list_window *lw, - list_window_callback_fn_t callback, - void *callback_data, - const char *str, - int wrap); +bool +list_window_find(struct list_window *lw, + list_window_callback_fn_t callback, + void *callback_data, + const char *str, + bool wrap); /* find a string in a list window (reversed) */ -int +bool list_window_rfind(struct list_window *lw, list_window_callback_fn_t callback, void *callback_data, const char *str, - int wrap, + bool wrap, unsigned rows); #endif |