From: Christian Heller Date: Sat, 24 Aug 2013 03:47:11 +0000 (+0200) Subject: shift_active_win() returns error code of its update_wins() call. X-Git-Tag: tce~1064 X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/todos?a=commitdiff_plain;h=32de5451545b3ba43c1dbd379d2a5e312d7e51dd;p=plomrogue shift_active_win() returns error code of its update_wins() call. --- diff --git a/src/windows.c b/src/windows.c index 74fb6cf..13dbed0 100644 --- a/src/windows.c +++ b/src/windows.c @@ -533,13 +533,13 @@ extern void cycle_active_win(struct WinMeta * wmeta, char dir) -extern void shift_active_win(struct WinMeta * wmeta, char dir) +extern uint8_t shift_active_win(struct WinMeta * wmeta, char dir) { if ( 0 == wmeta->active /* No shifting with less */ || wmeta->chain_start == wmeta->chain_end /* than two windows visible */ || (dir != 'f' && dir != 'b')) /* or wrong direction char. */ { - return; + return 0; } if ('f' == dir) { @@ -549,7 +549,7 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir) { shift_win_backward(wmeta); } - update_wins(wmeta, wmeta->chain_start); + return update_wins(wmeta, wmeta->chain_start); } diff --git a/src/windows.h b/src/windows.h index 98f5d9a..e556444 100644 --- a/src/windows.h +++ b/src/windows.h @@ -148,8 +148,11 @@ extern void cycle_active_win(struct WinMeta * wmeta, char dir); /* Move active window forwards (set dir="f") or backwards (set dir="b"). Wrap - * around in the window chain if start / end of it is met. */ -extern void shift_active_win(struct WinMeta * wmeta, char dir); + * around in the window chain if start / end of it is met. + * + * Returns 0 on success, 1 on (ncurses window/pad memory allocation) error. + */ +extern uint8_t shift_active_win(struct WinMeta * wmeta, char dir);