diff options
| author | Dan Lynch | 2006-06-21 12:29:13 +0200 |
|---|---|---|
| committer | Dan Lynch | 2006-06-21 12:29:13 +0200 |
| commit | 14f5d3203d5e7b8e4d52ac169b46edced002f566 (patch) | |
| tree | 1301ece6d3abd72253ddd5c232439fabcb7d5a02 /src | |
| parent | - added doxygen @file header (diff) | |
| download | ipxe-14f5d3203d5e7b8e4d52ac169b46edced002f566.tar.gz ipxe-14f5d3203d5e7b8e4d52ac169b46edced002f566.tar.xz ipxe-14f5d3203d5e7b8e4d52ac169b46edced002f566.zip | |
- removed slk references
- corrected minor algo errors in primitives
- added doxygen @file header
Diffstat (limited to 'src')
| -rw-r--r-- | src/hci/mucurses/core.c | 16 | ||||
| -rw-r--r-- | src/hci/mucurses/core.h | 24 |
2 files changed, 16 insertions, 24 deletions
diff --git a/src/hci/mucurses/core.c b/src/hci/mucurses/core.c index a29f79fa4..7805f4283 100644 --- a/src/hci/mucurses/core.c +++ b/src/hci/mucurses/core.c @@ -1,6 +1,12 @@ #include <curses.h> #include "core.h" +/** @file + * + * MuCurses core functions + * + */ + WINDOW _stdscr = { .attrs = A_DEFAULT, .ori_y = 0, @@ -10,8 +16,6 @@ WINDOW _stdscr = { .scr = curscr, }; -struct _softlabelkeys *slks; - /* * Primitives */ @@ -29,14 +33,14 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) { win->scr->movetoyx( win->scr, win->ori_y + win->curs_y, win->ori_x + win->curs_x ); win->scr->putc(win->scr, ch); - if ( ++(win->curs_x) == win->width ) { + if ( ++(win->curs_x) - win->width == 0 ) { if ( wrap == WRAP ) { win->curs_x = 0; /* specification says we should really scroll, but we have no buffer to scroll with, so we can only overwrite back at the beginning of the window */ - if ( ++(win->curs_y) == win->height ) + if ( ++(win->curs_y) - win->height == 0 ) win->curs_y = 0; } else { (win->curs_x)--; @@ -82,8 +86,8 @@ void _wputstr ( WINDOW *win, const char *str, int wrap, int n ) { */ int wmove ( WINDOW *win, int y, int x ) { /* chech for out-of-bounds errors */ - if ( ( ( (unsigned)x - win->ori_x ) > win->width ) || - ( ( (unsigned)y - win->ori_y ) > win->height ) ) { + if ( ( (unsigned)y >= win->height ) || + ( (unsigned)x >= win->width ) ) { return ERR; } diff --git a/src/hci/mucurses/core.h b/src/hci/mucurses/core.h index 37351dc34..08df8f8d0 100644 --- a/src/hci/mucurses/core.h +++ b/src/hci/mucurses/core.h @@ -1,6 +1,12 @@ #ifndef CORE_H #define CORE_H +/** @file + * + * MuCurses core implementation specific header file + * + */ + #define WRAP 0 #define NOWRAP 1 @@ -13,24 +19,6 @@ unsigned int *_COLOUR_PAIRS; /* basically this is an array, but as its pointer and malloc the array into being ... */ -struct _softlabel { - // label string - char *label; - /* Format of soft label - 0: left justify - 1: centre justify - 2: right justify - */ - unsigned short fmt; -}; - -struct _softlabelkeys { - struct _softlabel fkeys[12]; - attr_t attrs; - unsigned short fmt; - unsigned short maxlablen; -}; - void _wputch ( WINDOW *win, chtype ch, int wrap ); void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n ); void _wputstr ( WINDOW *win, const char *str, int wrap, int n ); |
