diff options
| author | Michael Brown | 2006-12-18 21:46:41 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-18 21:46:41 +0100 |
| commit | ba26defa6e6bd87546708c7a7e66d9a12f2d0a02 (patch) | |
| tree | 66c694bb96a53d840d1118d9691cb92a9a80c1d2 | |
| parent | wmove() is part of the public curses API, and already defined in curses.h (diff) | |
| download | ipxe-ba26defa6e6bd87546708c7a7e66d9a12f2d0a02.tar.gz ipxe-ba26defa6e6bd87546708c7a7e66d9a12f2d0a02.tar.xz ipxe-ba26defa6e6bd87546708c7a7e66d9a12f2d0a02.zip | |
Convert _{store,restore}_cursor_pos to static inlines.
| -rw-r--r-- | src/hci/mucurses/cursor.c | 31 | ||||
| -rw-r--r-- | src/hci/mucurses/cursor.h | 22 |
2 files changed, 20 insertions, 33 deletions
diff --git a/src/hci/mucurses/cursor.c b/src/hci/mucurses/cursor.c deleted file mode 100644 index 956056942..000000000 --- a/src/hci/mucurses/cursor.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <curses.h> -#include "cursor.h" - -/** @file - * - * MuCurses cursor preserving functions - * - */ - -/** - * Restore cursor position from encoded backup variable - * - * @v *win window on which to operate - * @v *pos pointer to struct in which original cursor position is stored - */ -void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ) { - win->curs_y = pos->y; - win->curs_x = pos->x; - win->scr->movetoyx ( win->scr, win->curs_y, win->curs_x ); -} - -/** - * Store cursor position for later restoration - * - * @v *win window on which to operate - * @v *pos pointer to struct in which to store cursor position - */ -void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ) { - pos->y = win->curs_y; - pos->x = win->curs_x; -} diff --git a/src/hci/mucurses/cursor.h b/src/hci/mucurses/cursor.h index 72c6d0382..af86519ca 100644 --- a/src/hci/mucurses/cursor.h +++ b/src/hci/mucurses/cursor.h @@ -11,7 +11,25 @@ struct cursor_pos { unsigned int y, x; }; -void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ); -void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ); +/** + * Restore cursor position from encoded backup variable + * + * @v *win window on which to operate + * @v *pos pointer to struct in which original cursor position is stored + */ +static inline void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ) { + wmove ( win, pos->y, pos->x ); +} + +/** + * Store cursor position for later restoration + * + * @v *win window on which to operate + * @v *pos pointer to struct in which to store cursor position + */ +static inline void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ) { + pos->y = win->curs_y; + pos->x = win->curs_x; +} #endif /* CURSOR_H */ |
