diff options
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/pdcurses')
38 files changed, 429 insertions, 429 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addch.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addch.c index 586d1a71fa..5934b54b96 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addch.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addch.c @@ -43,41 +43,41 @@ RCSID("$Id: addch.c,v 1.54 2008/07/13 16:08:17 wmcbrine Exp $") mvaddch() moves the cursor to the specified (y, x) position, and adds ch to stdscr. mvadd_wch() is the wide version. - mvwaddch() moves the cursor to the specified position and adds + mvwaddch() moves the cursor to the specified position and adds ch to the specified window. mvwadd_wch() is the wide version. - echochar() adds ch to stdscr at the current cursor position and + echochar() adds ch to stdscr at the current cursor position and calls refresh(). echo_wchar() is the wide version. - wechochar() adds ch to the specified window and calls + wechochar() adds ch to the specified window and calls wrefresh(). wecho_wchar() is the wide version. addrawch(), waddrawch(), mvaddrawch() and mvwaddrawch() are - PDCurses-specific wrappers for addch() etc. that disable the + PDCurses-specific wrappers for addch() etc. that disable the translation of control characters. The following applies to all these functions: - If the cursor moves on to the right margin, an automatic newline - is performed. If scrollok is enabled, and a character is added - to the bottom right corner of the window, the scrolling region - will be scrolled up one line. If scrolling is not allowed, ERR + If the cursor moves on to the right margin, an automatic newline + is performed. If scrollok is enabled, and a character is added + to the bottom right corner of the window, the scrolling region + will be scrolled up one line. If scrolling is not allowed, ERR will be returned. - If ch is a tab, newline, or backspace, the cursor will be moved - appropriately within the window. If ch is a newline, the - clrtoeol routine is called before the cursor is moved to the - beginning of the next line. If newline mapping is off, the - cursor will be moved to the next line, but the x coordinate will - be unchanged. If ch is a tab the cursor is moved to the next - tab position within the window. If ch is another control - character, it will be drawn in the ^X notation. Calling the - inch() routine after adding a control character returns the - representation of the control character, not the control + If ch is a tab, newline, or backspace, the cursor will be moved + appropriately within the window. If ch is a newline, the + clrtoeol routine is called before the cursor is moved to the + beginning of the next line. If newline mapping is off, the + cursor will be moved to the next line, but the x coordinate will + be unchanged. If ch is a tab the cursor is moved to the next + tab position within the window. If ch is another control + character, it will be drawn in the ^X notation. Calling the + inch() routine after adding a control character returns the + representation of the control character, not the control character. - Video attributes can be combined with a character by ORing them - into the parameter. Text, including attributes, can be copied + Video attributes can be combined with a character by ORing them + into the parameter. Text, including attributes, can be copied from one place to another by using inch() and addch(). Note that in PDCurses, for now, a cchar_t and a chtype are the @@ -205,9 +205,9 @@ int waddch(WINDOW *win, const chtype ch) if (!(attr & A_COLOR)) attr |= win->_attrs; - /* wrs (4/10/93): Apply the same sort of logic for the window - background, in that it only takes precedence if other color - attributes are not there and that the background character + /* wrs (4/10/93): Apply the same sort of logic for the window + background, in that it only takes precedence if other color + attributes are not there and that the background character will only print if the printing character is blank. */ if (!(attr & A_COLOR)) diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addchstr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addchstr.c index 0eea85a741..249ea8d457 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addchstr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/addchstr.c @@ -29,15 +29,15 @@ RCSID("$Id: addchstr.c,v 1.43 2008/07/13 16:08:17 wmcbrine Exp $") int n); Description: - These routines write a chtype or cchar_t string directly into - the window structure, starting at the current or specified - position. The four routines with n as the last argument copy at - most n elements, but no more than will fit on the line. If n = - -1 then the whole string is copied, up to the maximum number + These routines write a chtype or cchar_t string directly into + the window structure, starting at the current or specified + position. The four routines with n as the last argument copy at + most n elements, but no more than will fit on the line. If n = + -1 then the whole string is copied, up to the maximum number that will fit on the line. - The cursor position is not advanced. These routines do not check - for newline or other special characters, nor does any line + The cursor position is not advanced. These routines do not check + for newline or other special characters, nor does any line wrapping occur. Return Value: @@ -97,7 +97,7 @@ int waddchnstr(WINDOW *win, const chtype *ch, int n) PDC_LOG(("y %d x %d minx %d maxx %d *ptr %x *ch" " %x firstch: %d lastch: %d\n", - y, x, minx, maxx, *ptr, *ch, + y, x, minx, maxx, *ptr, *ch, win->_firstch[y], win->_lastch[y])); *ptr = *ch; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/attr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/attr.c index 532384b357..123cb90859 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/attr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/attr.c @@ -45,24 +45,24 @@ RCSID("$Id: attr.c,v 1.41 2008/07/13 16:08:17 wmcbrine Exp $") chtype getattrs(WINDOW *win); Description: - These functions manipulate the current attributes and/or colors - of the named window. These attributes can be any combination + These functions manipulate the current attributes and/or colors + of the named window. These attributes can be any combination of A_STANDOUT, A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE. These constants are defined in <curses.h> and can be combined with the bitwise-OR operator (|). - The current attributes of a window are applied to all chtypes - that are written into the window with waddch(). Attributes are - a property of the chtype, and move with the character through + The current attributes of a window are applied to all chtypes + that are written into the window with waddch(). Attributes are + a property of the chtype, and move with the character through any scrolling or insert/delete operations. - attrset() sets the current attributes of the given window to - attrs. attroff() turns off the named attributes without - affecting any other attributes; attron() turns them on. + attrset() sets the current attributes of the given window to + attrs. attroff() turns off the named attributes without + affecting any other attributes; attron() turns them on. color_set() sets the window color to the value of color_pair. - standout() is the same as attron(A_STANDOUT). standend() is the + standout() is the same as attron(A_STANDOUT). standend() is the same as attrset(A_NORMAL); that is, it turns off all attributes. Return Value: @@ -125,7 +125,7 @@ int wattron(WINDOW *win, chtype attrs) if (!win) return ERR; - if ((win->_attrs & A_COLOR) && (attrs & A_COLOR)) + if ((win->_attrs & A_COLOR) && (attrs & A_COLOR)) { oldcolr = win->_attrs & A_COLOR; oldattr = win->_attrs ^ oldcolr; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/bkgd.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/bkgd.c index 083239e1da..d511efe8b3 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/bkgd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/bkgd.c @@ -39,7 +39,7 @@ RCSID("$Id: bkgd.c,v 1.39 2008/07/13 16:08:18 wmcbrine Exp $") there is a conflict (e.g., different color pairs). Return Value: - bkgd() and wbkgd() return OK, unless the window is NULL, in + bkgd() and wbkgd() return OK, unless the window is NULL, in which case they return ERR. Portability X/Open BSD SYS V @@ -86,7 +86,7 @@ int wbkgd(WINDOW *win, chtype ch) newch = win->_bkgd & A_CHARTEXT; - /* what follows is what seems to occur in the System V + /* what follows is what seems to occur in the System V implementation of this routine */ for (y = 0; y < win->_maxy; y++) @@ -97,26 +97,26 @@ int wbkgd(WINDOW *win, chtype ch) ch = *winptr; - /* determine the colors and attributes of the character read + /* determine the colors and attributes of the character read from the window */ colr = ch & A_COLOR; attr = ch & (A_ATTRIBUTES ^ A_COLOR); - /* if the color is the same as the old background color, + /* if the color is the same as the old background color, then make it the new background color, otherwise leave it */ if (colr == oldcolr) colr = newcolr; - /* remove any attributes (non color) from the character that - were part of the old background, then combine the + /* remove any attributes (non color) from the character that + were part of the old background, then combine the remaining ones with the new background */ attr ^= oldattr; attr |= newattr; - /* change character if it is there because it was the old + /* change character if it is there because it was the old background character */ ch &= A_CHARTEXT; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/border.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/border.c index ec86aafdff..2a2ebcf5f7 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/border.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/border.c @@ -9,9 +9,9 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $") Name: border Synopsis: - int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, + int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); - int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, + int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); int box(WINDOW *win, chtype verch, chtype horch); int hline(chtype ch, int n); @@ -42,8 +42,8 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $") int mvwvline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n); Description: - border(), wborder(), and box() draw a border around the edge of - the window. If any argument is zero, an appropriate default is + border(), wborder(), and box() draw a border around the edge of + the window. If any argument is zero, an appropriate default is used: ls left side of border ACS_VLINE @@ -55,14 +55,14 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $") bl bottom left corner of border ACS_LLCORNER br bottom right corner of border ACS_LRCORNER - hline() and whline() draw a horizontal line, using ch, starting - from the current cursor position. The cursor position does not - change. The line is at most n characters long, or as many as + hline() and whline() draw a horizontal line, using ch, starting + from the current cursor position. The cursor position does not + change. The line is at most n characters long, or as many as will fit in the window. - vline() and wvline() draw a vertical line, using ch, starting - from the current cursor position. The cursor position does not - change. The line is at most n characters long, or as many as + vline() and wvline() draw a vertical line, using ch, starting + from the current cursor position. The cursor position does not + change. The line is at most n characters long, or as many as will fit in the window. Return Value: @@ -94,28 +94,28 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $") **man-end****************************************************************/ -/* _attr_passthru() -- Takes a single chtype 'ch' and checks if the - current attribute of window 'win', as set by wattrset(), and/or the - current background of win, as set by wbkgd(), should by combined with +/* _attr_passthru() -- Takes a single chtype 'ch' and checks if the + current attribute of window 'win', as set by wattrset(), and/or the + current background of win, as set by wbkgd(), should by combined with it. Attributes set explicitly in ch take precedence. */ static chtype _attr_passthru(WINDOW *win, chtype ch) { chtype attr; - /* If the incoming character doesn't have its own attribute, then - use the current attributes for the window. If the incoming - character has attributes, but not a color component, OR the - attributes to the current attributes for the window. If the - incoming character has a color component, use only the attributes + /* If the incoming character doesn't have its own attribute, then + use the current attributes for the window. If the incoming + character has attributes, but not a color component, OR the + attributes to the current attributes for the window. If the + incoming character has a color component, use only the attributes from the incoming character. */ attr = ch & A_ATTRIBUTES; if (!(attr & A_COLOR)) attr |= win->_attrs; - /* wrs (4/10/93) -- Apply the same sort of logic for the window - background, in that it only takes precedence if other color + /* wrs (4/10/93) -- Apply the same sort of logic for the window + background, in that it only takes precedence if other color attributes are not there. */ if (!(attr & A_COLOR)) @@ -128,7 +128,7 @@ static chtype _attr_passthru(WINDOW *win, chtype ch) return ch; } -int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, +int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) { int i, ymax, xmax; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c index eda33855d0..0128df5cb8 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c @@ -19,14 +19,14 @@ RCSID("$Id: clear.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $") int wclrtoeol(WINDOW *win); Description: - erase() and werase() copy blanks (i.e. the background chtype) to + erase() and werase() copy blanks (i.e. the background chtype) to every cell of the window. clear() and wclear() are similar to erase() and werase(), but - they also call clearok() to ensure that the the window is + they also call clearok() to ensure that the the window is cleared on the next wrefresh(). - clrtobot() and wclrtobot() clear the window from the current + clrtobot() and wclrtobot() clear the window from the current cursor position to the end of the window. clrtoeol() and wclrtoeol() clear the window from the current diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/color.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/color.c index 038f760457..7e8fc4c318 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/color.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/color.c @@ -24,10 +24,10 @@ RCSID("$Id: color.c,v 1.83 2008/07/13 16:08:18 wmcbrine Exp $") Description: To use these routines, start_color() must be called, usually - immediately after initscr(). Colors are always used in pairs, - referred to as color-pairs. A color-pair consists of a - foreground color and a background color. A color-pair is - initialized via init_pair(). After initialization, COLOR_PAIR(n) + immediately after initscr(). Colors are always used in pairs, + referred to as color-pairs. A color-pair consists of a + foreground color and a background color. A color-pair is + initialized via init_pair(). After initialization, COLOR_PAIR(n) can be used like any other video attribute. start_color() initializes eight basic colors (black, red, green, @@ -36,16 +36,16 @@ RCSID("$Id: color.c,v 1.83 2008/07/13 16:08:18 wmcbrine Exp $") maximum number of colors and color-pairs the terminal is capable of displaying). - init_pair() changes the definition of a color-pair. It takes - three arguments: the number of the color-pair to be redefined, - and the new values of the foreground and background colors. The - pair number must be between 0 and COLOR_PAIRS - 1, inclusive. - The foreground and background must be between 0 and COLORS - 1, - inclusive. If the color pair was previously initialized, the - screen is refreshed, and all occurrences of that color-pair are + init_pair() changes the definition of a color-pair. It takes + three arguments: the number of the color-pair to be redefined, + and the new values of the foreground and background colors. The + pair number must be between 0 and COLOR_PAIRS - 1, inclusive. + The foreground and background must be between 0 and COLORS - 1, + inclusive. If the color pair was previously initialized, the + screen is refreshed, and all occurrences of that color-pair are changed to the new definition. - has_colors() indicates if the terminal supports, and can + has_colors() indicates if the terminal supports, and can maniplulate color. It returns TRUE or FALSE. can_change_color() indicates if the terminal has the capability @@ -145,8 +145,8 @@ int init_pair(short pair, short fg, short bg) _normalize(&fg, &bg); - /* To allow the PDC_PRESERVE_SCREEN option to work, we only reset - curscr if this call to init_pair() alters a color pair created by + /* To allow the PDC_PRESERVE_SCREEN option to work, we only reset + curscr if this call to init_pair() alters a color pair created by the user. */ if (pair_set[pair]) @@ -196,7 +196,7 @@ int color_content(short color, short *red, short *green, short *blue) return PDC_color_content(color, red, green, blue); else { - /* Simulated values for platforms that don't support palette + /* Simulated values for platforms that don't support palette changing */ short maxval = (color & 8) ? 1000 : 680; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/debug.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/debug.c index 95dc7d445f..812b0ee040 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/debug.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/debug.c @@ -14,12 +14,12 @@ RCSID("$Id: debug.c,v 1.7 2008/07/13 16:08:18 wmcbrine Exp $") void PDC_debug(const char *, ...); Description: - traceon() and traceoff() toggle the recording of debugging - information to the file "trace". Although not standard, similar + traceon() and traceoff() toggle the recording of debugging + information to the file "trace". Although not standard, similar functions are in some other curses implementations. - PDC_debug() is the function that writes to the file, based on - whether traceon() has been called. It's used from the PDC_LOG() + PDC_debug() is the function that writes to the file, based on + whether traceon() has been called. It's used from the PDC_LOG() macro. Portability X/Open BSD SYS V @@ -43,7 +43,7 @@ void PDC_debug(const char *fmt, ...) time_t now; if (!pdc_trace_on) - return; + return; /* open debug log file append */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deleteln.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deleteln.c index c856e90a38..7e26d9bcde 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deleteln.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deleteln.c @@ -27,10 +27,10 @@ RCSID("$Id: deleteln.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $") current line are moved up one line. The bottom line of the window is cleared. The cursor position does not change. - With the insertln() and winsertn() functions, a blank line is + With the insertln() and winsertn() functions, a blank line is inserted above the current line and the bottom line is lost. - mvdeleteln(), mvwdeleteln(), mvinsertln() and mvwinsertln() + mvdeleteln(), mvwdeleteln(), mvinsertln() and mvwinsertln() allow moving the cursor and inserting/deleting in one call. Return Value: @@ -76,7 +76,7 @@ int wdeleteln(WINDOW *win) for (ptr = temp; (ptr - temp < win->_maxx); ptr++) *ptr = blank; /* make a blank line */ - if (win->_cury <= win->_bmarg) + if (win->_cury <= win->_bmarg) { win->_firstch[win->_bmarg] = 0; win->_lastch[win->_bmarg] = win->_maxx - 1; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deprec.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deprec.c index 83e6131102..028d47a8ce 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deprec.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/deprec.c @@ -4,8 +4,8 @@ RCSID("$Id: deprec.c,v 1.6 2008/07/13 16:08:18 wmcbrine Exp $") -/* Deprecated functions. These should not be used, and will eventually - be removed. They're here solely for the benefit of applications that +/* Deprecated functions. These should not be used, and will eventually + be removed. They're here solely for the benefit of applications that linked to them in older versions of PDCurses. */ bool PDC_check_bios_key(void) diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getch.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getch.c index 87677bae2e..f37d69afd1 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getch.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getch.c @@ -27,13 +27,13 @@ RCSID("$Id: getch.c,v 1.72 2008/07/13 16:08:18 wmcbrine Exp $") int PDC_return_key_modifiers(bool flag); Description: - With the getch(), wgetch(), mvgetch(), and mvwgetch() functions, - a character is read from the terminal associated with the window. - In nodelay mode, if there is no input waiting, the value ERR is - returned. In delay mode, the program will hang until the system - passes text through to the program. Depending on the setting of - cbreak(), this will be after one character or after the first - newline. Unless noecho() has been set, the character will also + With the getch(), wgetch(), mvgetch(), and mvwgetch() functions, + a character is read from the terminal associated with the window. + In nodelay mode, if there is no input waiting, the value ERR is + returned. In delay mode, the program will hang until the system + passes text through to the program. Depending on the setting of + cbreak(), this will be after one character or after the first + newline. Unless noecho() has been set, the character will also be echoed into the designated window. If keypad() is TRUE, and a function key is pressed, the token for @@ -44,25 +44,25 @@ RCSID("$Id: getch.c,v 1.72 2008/07/13 16:08:18 wmcbrine Exp $") If nodelay(win, TRUE) has been called on the window and no input is waiting, the value ERR is returned. - ungetch() places ch back onto the input queue to be returned by + ungetch() places ch back onto the input queue to be returned by the next call to wgetch(). - flushinp() throws away any type-ahead that has been typed by the + flushinp() throws away any type-ahead that has been typed by the user and has not yet been read by the program. - PDC_get_key_modifiers() returns the keyboard modifiers (shift, - control, alt, numlock) effective at the time of the last getch() - call, if PDC_save_key_modifiers(TRUE) has been called before the - getch(). Use the macros PDC_KEY_MODIFIER_* to determine which - modifier(s) were set. PDC_return_key_modifiers() tells getch() - to return modifier keys pressed alone as keystrokes (KEY_ALT_L, + PDC_get_key_modifiers() returns the keyboard modifiers (shift, + control, alt, numlock) effective at the time of the last getch() + call, if PDC_save_key_modifiers(TRUE) has been called before the + getch(). Use the macros PDC_KEY_MODIFIER_* to determine which + modifier(s) were set. PDC_return_key_modifiers() tells getch() + to return modifier keys pressed alone as keystrokes (KEY_ALT_L, etc.). These may not work on all platforms. - NOTE: getch() and ungetch() are implemented as macros, to avoid + NOTE: getch() and ungetch() are implemented as macros, to avoid conflict with many DOS compiler's runtime libraries. Return Value: - These functions return ERR or the value of the character, meta + These functions return ERR or the value of the character, meta character or function key token. Portability X/Open BSD SYS V @@ -173,7 +173,7 @@ int wgetch(WINDOW *win) else if (win->_delayms) { - /* Can't really do millisecond intervals, so delay in + /* Can't really do millisecond intervals, so delay in 1/20ths of a second (50ms) */ waitcount = win->_delayms / 50; @@ -181,7 +181,7 @@ int wgetch(WINDOW *win) waitcount = 1; } - /* refresh window when wgetch is called if there have been changes + /* refresh window when wgetch is called if there have been changes to it and it is not a pad */ if (!(win->_flags & _PAD) && ((!win->_leaveit && @@ -240,7 +240,7 @@ int wgetch(WINDOW *win) if (!win->_use_keypad) key = -1; - /* filter mouse events; translate mouse clicks in the slk + /* filter mouse events; translate mouse clicks in the slk area to function keys */ else if (key == KEY_MOUSE) diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getstr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getstr.c index c6386d3158..744e5e65fe 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getstr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getstr.c @@ -28,20 +28,20 @@ RCSID("$Id: getstr.c,v 1.51 2008/07/14 04:24:51 wmcbrine Exp $") int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n); Description: - These routines call wgetch() repeatedly to build a string, - interpreting erase and kill characters along the way, until a - newline or carriage return is received. When PDCurses is built - with wide-character support enabled, the narrow-character - functions convert the wgetch()'d values into a multibyte string - in the current locale before returning it. The resulting string - is placed in the area pointed to by *str. The routines with n as + These routines call wgetch() repeatedly to build a string, + interpreting erase and kill characters along the way, until a + newline or carriage return is received. When PDCurses is built + with wide-character support enabled, the narrow-character + functions convert the wgetch()'d values into a multibyte string + in the current locale before returning it. The resulting string + is placed in the area pointed to by *str. The routines with n as the last argument read at most n characters. - Note that there's no way to know how long the buffer passed to + Note that there's no way to know how long the buffer passed to wgetstr() is, so use wgetnstr() to avoid buffer overflows. Return Value: - This functions return ERR on failure or any other value on + This functions return ERR on failure or any other value on success. Portability X/Open BSD SYS V @@ -118,7 +118,7 @@ int wgetnstr(WINDOW *win, char *str, int n) { if (chars < n) { - if (oldecho) + if (oldecho) waddch(win, ch); *p++ = ch; ++chars; @@ -131,7 +131,7 @@ int wgetnstr(WINDOW *win, char *str, int n) case _ECHAR: /* CTRL-H -- Delete character */ if (p > str) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = (unsigned char)(*--p); if ((ch < ' ') && (oldecho)) @@ -143,7 +143,7 @@ int wgetnstr(WINDOW *win, char *str, int n) case _DLCHAR: /* CTRL-U -- Delete line */ while (p > str) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = (unsigned char)(*--p); if ((ch < ' ') && (oldecho)) @@ -156,7 +156,7 @@ int wgetnstr(WINDOW *win, char *str, int n) while ((p > str) && (*(p - 1) == ' ')) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); --p; /* remove space */ @@ -164,7 +164,7 @@ int wgetnstr(WINDOW *win, char *str, int n) } while ((p > str) && (*(p - 1) != ' ')) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = (unsigned char)(*--p); @@ -177,7 +177,7 @@ int wgetnstr(WINDOW *win, char *str, int n) case '\n': case '\r': stop = TRUE; - if (oldecho) + if (oldecho) waddch(win, '\n'); break; @@ -187,7 +187,7 @@ int wgetnstr(WINDOW *win, char *str, int n) if (!SP->key_code && ch < 0x100) { *p++ = ch; - if (oldecho) + if (oldecho) waddch(win, ch); chars++; } @@ -196,7 +196,7 @@ int wgetnstr(WINDOW *win, char *str, int n) beep(); break; - + } wrefresh(win); @@ -315,7 +315,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) { if (chars < n) { - if (oldecho) + if (oldecho) waddch(win, ch); *p++ = ch; ++chars; @@ -328,7 +328,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) case _ECHAR: /* CTRL-H -- Delete character */ if (p > wstr) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = *--p; if ((ch < ' ') && (oldecho)) @@ -340,7 +340,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) case _DLCHAR: /* CTRL-U -- Delete line */ while (p > wstr) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = *--p; if ((ch < ' ') && (oldecho)) @@ -353,7 +353,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) while ((p > wstr) && (*(p - 1) == ' ')) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); --p; /* remove space */ @@ -361,7 +361,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) } while ((p > wstr) && (*(p - 1) != ' ')) { - if (oldecho) + if (oldecho) waddstr(win, "\b \b"); ch = *--p; @@ -374,7 +374,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) case '\n': case '\r': stop = TRUE; - if (oldecho) + if (oldecho) waddch(win, '\n'); break; @@ -393,7 +393,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) beep(); break; - + } wrefresh(win); diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getyx.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getyx.c index fd0564d904..1c0391766c 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getyx.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/getyx.c @@ -27,12 +27,12 @@ RCSID("$Id: getyx.c,v 1.29 2008/07/15 17:13:26 wmcbrine Exp $") int getmaxx(WINDOW *win); Description: - The getyx() macro (defined in curses.h -- the prototypes here - are merely illustrative) puts the current cursor position of the - specified window into y and x. getbegyx() and getmaxyx() return - the starting coordinates and size of the specified window, - respectively. getparyx() returns the starting coordinates of the - parent's window, if the specified window is a subwindow; + The getyx() macro (defined in curses.h -- the prototypes here + are merely illustrative) puts the current cursor position of the + specified window into y and x. getbegyx() and getmaxyx() return + the starting coordinates and size of the specified window, + respectively. getparyx() returns the starting coordinates of the + parent's window, if the specified window is a subwindow; otherwise it sets y and x to -1. These are all macros. getsyx() gets the coordinates of the virtual screen cursor, and diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inch.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inch.c index 7347e74032..6609b29383 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inch.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inch.c @@ -20,14 +20,14 @@ RCSID("$Id: inch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $") int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval); Description: - The inch() functions retrieve the character and attribute from - the current or specified window position, in the form of a + The inch() functions retrieve the character and attribute from + the current or specified window position, in the form of a chtype. If a NULL window is specified, (chtype)ERR is returned. - The in_wch() functions are the wide-character versions; instead - of returning a chtype, they store a cchar_t at the address - specified by wcval, and return OK or ERR. (No value is stored - when ERR is returned.) Note that in PDCurses, chtype and cchar_t + The in_wch() functions are the wide-character versions; instead + of returning a chtype, they store a cchar_t at the address + specified by wcval, and return OK or ERR. (No value is stored + when ERR is returned.) Note that in PDCurses, chtype and cchar_t are the same. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inchstr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inchstr.c index 50b8cf5bc7..f061cdb38f 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inchstr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inchstr.c @@ -28,12 +28,12 @@ RCSID("$Id: inchstr.c,v 1.34 2008/07/13 16:08:18 wmcbrine Exp $") int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wch, int n); Description: - These routines read a chtype or cchar_t string from the window, - starting at the current or specified position, and ending at the + These routines read a chtype or cchar_t string from the window, + starting at the current or specified position, and ending at the right margin, or after n elements, whichever is less. Return Value: - All functions return the number of elements read, or ERR on + All functions return the number of elements read, or ERR on error. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/initscr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/initscr.c index d80fa0cf4e..2fb2600455 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/initscr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/initscr.c @@ -22,23 +22,23 @@ RCSID("$Id: initscr.c,v 1.114 2008/07/13 16:08:18 wmcbrine Exp $") const char *curses_version(void); Description: - initscr() should be the first curses routine called. It will - initialize all curses data structures, and arrange that the - first call to refresh() will clear the screen. In case of - error, initscr() will write a message to standard error and end + initscr() should be the first curses routine called. It will + initialize all curses data structures, and arrange that the + first call to refresh() will clear the screen. In case of + error, initscr() will write a message to standard error and end the program. - endwin() should be called before exiting or escaping from curses - mode temporarily. It will restore tty modes, move the cursor to - the lower left corner of the screen and reset the terminal into - the proper non-visual mode. To resume curses after a temporary + endwin() should be called before exiting or escaping from curses + mode temporarily. It will restore tty modes, move the cursor to + the lower left corner of the screen and reset the terminal into + the proper non-visual mode. To resume curses after a temporary escape, call refresh() or doupdate(). - isendwin() returns TRUE if endwin() has been called without a + isendwin() returns TRUE if endwin() has been called without a subsequent refresh, unless SP is NULL. - In some implementations of curses, newterm() allows the use of - multiple terminals. Here, it's just an alternative interface for + In some implementations of curses, newterm() allows the use of + multiple terminals. Here, it's just an alternative interface for initscr(). It always returns SP, or NULL. delscreen() frees the memory allocated by newterm() or @@ -46,29 +46,29 @@ RCSID("$Id: initscr.c,v 1.114 2008/07/13 16:08:18 wmcbrine Exp $") usually not needed. In PDCurses, the parameter must be the value of SP, and delscreen() sets SP to NULL. - set_term() does nothing meaningful in PDCurses, but is included + set_term() does nothing meaningful in PDCurses, but is included for compatibility with other curses implementations. - resize_term() is effectively two functions: When called with - nonzero values for nlines and ncols, it attempts to resize the - screen to the given size. When called with (0, 0), it merely - adjusts the internal structures to match the current size after - the screen is resized by the user. On the currently supported - platforms, this functionality is mutually exclusive: X11 allows - user resizing, while DOS, OS/2 and Win32 allow programmatic - resizing. If you want to support user resizing, you should check - for getch() returning KEY_RESIZE, and/or call is_termresized() - at appropriate times; if either condition occurs, call - resize_term(0, 0). Then, with either user or programmatic - resizing, you'll have to resize any windows you've created, as + resize_term() is effectively two functions: When called with + nonzero values for nlines and ncols, it attempts to resize the + screen to the given size. When called with (0, 0), it merely + adjusts the internal structures to match the current size after + the screen is resized by the user. On the currently supported + platforms, this functionality is mutually exclusive: X11 allows + user resizing, while DOS, OS/2 and Win32 allow programmatic + resizing. If you want to support user resizing, you should check + for getch() returning KEY_RESIZE, and/or call is_termresized() + at appropriate times; if either condition occurs, call + resize_term(0, 0). Then, with either user or programmatic + resizing, you'll have to resize any windows you've created, as appropriate; resize_term() only handles stdscr and curscr. is_termresized() returns TRUE if the curses screen has been - resized by the user, and a call to resize_term() is needed. - Checking for KEY_RESIZE is generally preferable, unless you're + resized by the user, and a call to resize_term() is needed. + Checking for KEY_RESIZE is generally preferable, unless you're not handling the keyboard. - curses_version() returns a string describing the version of + curses_version() returns a string describing the version of PDCurses. Return Value: @@ -169,7 +169,7 @@ WINDOW *Xinitscr(int argc, char *argv[]) PDC_slk_initialize(); LINES -= SP->slklines; - /* We have to sort out ripped off lines here, and reduce the height + /* We have to sort out ripped off lines here, and reduce the height of stdscr by the number of lines ripped off */ for (i = 0; i < linesrippedoff; i++) @@ -247,7 +247,7 @@ int endwin(void) bool isendwin(void) { PDC_LOG(("isendwin() - called\n")); - + return SP ? !(SP->alive) : FALSE; } diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inopts.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inopts.c index 6d33fc2a38..b02654f077 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inopts.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/inopts.c @@ -33,57 +33,57 @@ RCSID("$Id: inopts.c,v 1.43 2008/07/13 16:08:18 wmcbrine Exp $") int nocrmode(void); Description: - cbreak() and nocbreak() toggle cbreak mode. In cbreak mode, - characters typed by the user are made available immediately, and - erase/kill character processing is not performed. In nocbreak - mode, typed characters are buffered until a newline or carriage - return. Interrupt and flow control characters are unaffected by + cbreak() and nocbreak() toggle cbreak mode. In cbreak mode, + characters typed by the user are made available immediately, and + erase/kill character processing is not performed. In nocbreak + mode, typed characters are buffered until a newline or carriage + return. Interrupt and flow control characters are unaffected by this mode. PDCurses always starts in cbreak mode. - echo() and noecho() control whether typed characters are echoed - by the input routine. Initially, input characters are echoed. + echo() and noecho() control whether typed characters are echoed + by the input routine. Initially, input characters are echoed. Subsequent calls to echo() and noecho() do not flush type-ahead. - halfdelay() is similar to cbreak(), but allows for a time limit - to be specified, in tenths of a second. This causes getch() to - block for that period before returning ERR if no key has been + halfdelay() is similar to cbreak(), but allows for a time limit + to be specified, in tenths of a second. This causes getch() to + block for that period before returning ERR if no key has been received. tenths must be between 1 and 255. - keypad() controls whether getch() returns function/special keys - as single key codes (e.g., the left arrow key as KEY_LEFT). Per - X/Open, the default for keypad mode is OFF. You'll probably want - it on. With keypad mode off, if a special key is pressed, + keypad() controls whether getch() returns function/special keys + as single key codes (e.g., the left arrow key as KEY_LEFT). Per + X/Open, the default for keypad mode is OFF. You'll probably want + it on. With keypad mode off, if a special key is pressed, getch() does nothing or returns ERR. - nodelay() controls whether wgetch() is a non-blocking call. If - the option is enabled, and no input is ready, wgetch() will - return ERR. If disabled, wgetch() will hang until input is + nodelay() controls whether wgetch() is a non-blocking call. If + the option is enabled, and no input is ready, wgetch() will + return ERR. If disabled, wgetch() will hang until input is ready. - nl() enables the translation of a carriage return into a newline - on input. nonl() disables this. Initially, the translation does + nl() enables the translation of a carriage return into a newline + on input. nonl() disables this. Initially, the translation does occur. - raw() and noraw() toggle raw mode. Raw mode is similar to cbreak - mode, in that characters typed are immediately passed through to - the user program. The difference is that in raw mode, the INTR, - QUIT, SUSP, and STOP characters are passed through without being + raw() and noraw() toggle raw mode. Raw mode is similar to cbreak + mode, in that characters typed are immediately passed through to + the user program. The difference is that in raw mode, the INTR, + QUIT, SUSP, and STOP characters are passed through without being interpreted, and without generating a signal. In PDCurses, the meta() function sets raw mode on or off. - timeout() and wtimeout() set blocking or non-blocking reads for - the specified window. The delay is measured in milliseconds. If - it's negative, a blocking read is used; if zero, then non- - blocking reads are done -- if no input is waiting, ERR is - returned immediately. If the delay is positive, the read blocks + timeout() and wtimeout() set blocking or non-blocking reads for + the specified window. The delay is measured in milliseconds. If + it's negative, a blocking read is used; if zero, then non- + blocking reads are done -- if no input is waiting, ERR is + returned immediately. If the delay is positive, the read blocks for the delay period; if the period expires, ERR is returned. intrflush(), notimeout(), noqiflush(), qiflush() and typeahead() - do nothing in PDCurses, but are included for compatibility with + do nothing in PDCurses, but are included for compatibility with other curses implementations. - crmode() and nocrmode() are archaic equivalents to cbreak() and + crmode() and nocrmode() are archaic equivalents to cbreak() and nocbreak(), respectively. Return Value: @@ -274,7 +274,7 @@ void wtimeout(WINDOW *win, int delay) if (delay < 0) { - /* This causes a blocking read on the window, so turn on delay + /* This causes a blocking read on the window, so turn on delay mode */ win->_nodelay = FALSE; @@ -282,7 +282,7 @@ void wtimeout(WINDOW *win, int delay) } else if (!delay) { - /* This causes a non-blocking read on the window, so turn off + /* This causes a non-blocking read on the window, so turn off delay mode */ win->_nodelay = TRUE; @@ -290,8 +290,8 @@ void wtimeout(WINDOW *win, int delay) } else { - /* This causes the read on the window to delay for the number of - milliseconds. Also forces the window into non-blocking read + /* This causes the read on the window to delay for the number of + milliseconds. Also forces the window into non-blocking read mode */ /*win->_nodelay = TRUE;*/ diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insch.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insch.c index 50527f2f5b..67b9f4784b 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insch.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insch.c @@ -25,20 +25,20 @@ RCSID("$Id: insch.c,v 1.44 2008/07/13 16:08:18 wmcbrine Exp $") int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch); Description: - The insch() functions insert a chtype into the window at the - current or specified cursor position. The cursor is NOT - advanced. A newline is equivalent to clrtoeol(); tabs are - expanded; other control characters are converted as with + The insch() functions insert a chtype into the window at the + current or specified cursor position. The cursor is NOT + advanced. A newline is equivalent to clrtoeol(); tabs are + expanded; other control characters are converted as with unctrl(). The ins_wch() functions are the wide-character equivalents, taking cchar_t pointers rather than chtypes. Video attributes can be combined with a character by ORing - them into the parameter. Text, including attributes, can be + them into the parameter. Text, including attributes, can be copied from one place to another using inch() and insch(). - insrawch() etc. are PDCurses-specific wrappers for insch() etc. + insrawch() etc. are PDCurses-specific wrappers for insch() etc. that disable the translation of control characters. Return Value: diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insstr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insstr.c index 38fa38915c..a731eaf436 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insstr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/insstr.c @@ -32,12 +32,12 @@ RCSID("$Id: insstr.c,v 1.46 2008/07/13 16:08:18 wmcbrine Exp $") at the current cursor position, by repeatedly calling winsch(). When PDCurses is built with wide-character support enabled, the narrow-character functions treat the string as a multibyte - string in the current locale, and convert it first. All - characters to the right of the cursor are moved to the right, - with the possibility of the rightmost characters on the line - being lost. The cursor position does not change (after moving - to y, x, if specified). The routines with n as the last - argument insert at most n characters; if n is negative, then the + string in the current locale, and convert it first. All + characters to the right of the cursor are moved to the right, + with the possibility of the rightmost characters on the line + being lost. The cursor position does not change (after moving + to y, x, if specified). The routines with n as the last + argument insert at most n characters; if n is negative, then the entire string is inserted. Return Value: diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/instr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/instr.c index bbf369cc8d..733a348eb6 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/instr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/instr.c @@ -28,16 +28,16 @@ RCSID("$Id: instr.c,v 1.44 2008/07/13 16:08:18 wmcbrine Exp $") int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n); Description: - These functions take characters (or wide characters) from the - current or specified position in the window, and return them as - a string in str (or wstr). Attributes are ignored. The functions - with n as the last argument return a string at most n characters + These functions take characters (or wide characters) from the + current or specified position in the window, and return them as + a string in str (or wstr). Attributes are ignored. The functions + with n as the last argument return a string at most n characters long. Return Value: - Upon successful completion, innstr(), mvinnstr(), mvwinnstr() + Upon successful completion, innstr(), mvinnstr(), mvwinnstr() and winnstr() return the number of characters actually read into - the string; instr(), mvinstr(), mvwinstr() and winstr() return + the string; instr(), mvinstr(), mvwinstr() and winstr() return OK. Otherwise, all these functions return ERR. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/kernel.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/kernel.c index 7e41ccfdea..1a2f835125 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/kernel.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/kernel.c @@ -45,17 +45,17 @@ RCSID("$Id: kernel.c,v 1.78 2008/07/15 17:13:26 wmcbrine Exp $") 0 makes it disappear; 1 makes it appear "normal" (usually an underline) and 2 makes it "highly visible" (usually a block). - ripoffline() reduces the size of stdscr by one line. If the - "line" parameter is positive, the line is removed from the top - of the screen; if negative, from the bottom. Up to 5 lines can - be ripped off stdscr by calling ripoffline() repeatedly. The - function argument, init, is called from within initscr() or - newterm(), so ripoffline() must be called before either of these - functions. The init function receives a pointer to a one-line - WINDOW, and the width of the window. Calling ripoffline() with a + ripoffline() reduces the size of stdscr by one line. If the + "line" parameter is positive, the line is removed from the top + of the screen; if negative, from the bottom. Up to 5 lines can + be ripped off stdscr by calling ripoffline() repeatedly. The + function argument, init, is called from within initscr() or + newterm(), so ripoffline() must be called before either of these + functions. The init function receives a pointer to a one-line + WINDOW, and the width of the window. Calling ripoffline() with a NULL init function pointer is an error. - napms() suspends the program for the specified number of + napms() suspends the program for the specified number of milliseconds. draino() is an archaic equivalent. resetterm(), fixterm() and saveterm() are archaic equivalents @@ -193,7 +193,7 @@ int curs_set(int visibility) ret_vis = PDC_curs_set(visibility); - /* If the cursor is changing from invisible to visible, update + /* If the cursor is changing from invisible to visible, update its position */ if (visibility && !ret_vis) diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/keyname.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/keyname.c index 6d02cef81c..4d300ff621 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/keyname.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/keyname.c @@ -16,13 +16,13 @@ RCSID("$Id: keyname.c,v 1.8 2008/07/13 16:08:18 wmcbrine Exp $") bool has_key(int key); Description: - keyname() returns a string corresponding to the argument key. + keyname() returns a string corresponding to the argument key. key may be any key returned by wgetch(). - key_name() is the wide-character version. It takes a wchar_t + key_name() is the wide-character version. It takes a wchar_t parameter, but still returns a char *. - has_key() returns TRUE for recognized keys, FALSE otherwise. + has_key() returns TRUE for recognized keys, FALSE otherwise. This function is an ncurses extension. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/mouse.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/mouse.c index 1f476dd4b9..5071886d64 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/mouse.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/mouse.c @@ -91,9 +91,9 @@ RCSID("$Id: mouse.c,v 1.45 2008/07/13 16:08:18 wmcbrine Exp $") reported) through 1000ms. In x11, the timeout can also be set via the clickPeriod resource. The return value from mouseinterval() is the old timeout. To check the old value - without setting a new one, call it with a parameter of -1. Note - that although there's no classic equivalent for this function - (apart from the clickPeriod resource), the value set applies in + without setting a new one, call it with a parameter of -1. Note + that although there's no classic equivalent for this function + (apart from the clickPeriod resource), the value set applies in both interfaces. wenclose() reports whether the given screen-relative y, x @@ -111,23 +111,23 @@ RCSID("$Id: mouse.c,v 1.45 2008/07/13 16:08:18 wmcbrine Exp $") mousemask() is nearly equivalent to mouse_set(), but instead of OK/ERR, it returns the value of the mask after setting it. (This isn't necessarily the same value passed in, since the mask could - be altered on some platforms.) And if the second parameter is a - non-null pointer, mousemask() stores the previous mask value - there. Also, since the ncurses interface doesn't work with + be altered on some platforms.) And if the second parameter is a + non-null pointer, mousemask() stores the previous mask value + there. Also, since the ncurses interface doesn't work with PDCurses' BUTTON_MOVED events, mousemask() filters them out. - nc_getmouse() returns the current mouse status in an MEVENT - struct. This is equivalent to ncurses' getmouse(), renamed to - avoid conflict with PDCurses' getmouse(). But if you define - NCURSES_MOUSE_VERSION (preferably as 2) before including - curses.h, it defines getmouse() to nc_getmouse(), along with a - few other redefintions needed for compatibility with ncurses - code. nc_getmouse() calls request_mouse_pos(), which (not + nc_getmouse() returns the current mouse status in an MEVENT + struct. This is equivalent to ncurses' getmouse(), renamed to + avoid conflict with PDCurses' getmouse(). But if you define + NCURSES_MOUSE_VERSION (preferably as 2) before including + curses.h, it defines getmouse() to nc_getmouse(), along with a + few other redefintions needed for compatibility with ncurses + code. nc_getmouse() calls request_mouse_pos(), which (not getmouse()) is the classic equivalent. - ungetmouse() is the mouse equivalent of ungetch(). However, - PDCurses doesn't maintain a queue of mouse events; only one can - be pushed back, and it can overwrite or be overwritten by real + ungetmouse() is the mouse equivalent of ungetch(). However, + PDCurses doesn't maintain a queue of mouse events; only one can + be pushed back, and it can overwrite or be overwritten by real mouse events. Portability X/Open BSD SYS V @@ -305,7 +305,7 @@ mmask_t mousemask(mmask_t mask, mmask_t *oldmask) if (oldmask) *oldmask = SP->_trap_mbe; - /* The ncurses interface doesn't work with our move events, so + /* The ncurses interface doesn't work with our move events, so filter them here */ mask &= ~(BUTTON1_MOVED | BUTTON2_MOVED | BUTTON3_MOVED); @@ -397,7 +397,7 @@ int ungetmouse(MEVENT *event) int shf = i * 5; short button = 0; - if (bstate & ((BUTTON1_RELEASED | BUTTON1_PRESSED | + if (bstate & ((BUTTON1_RELEASED | BUTTON1_PRESSED | BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED) << shf)) { pdc_mouse_status.changes |= 1 << i; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/outopts.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/outopts.c index 0a8fd2d564..9b04eb9dd7 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/outopts.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/outopts.c @@ -21,12 +21,12 @@ RCSID("$Id: outopts.c,v 1.39 2008/07/14 12:22:13 wmcbrine Exp $") int raw_output(bool bf); Description: - With clearok(), if bf is TRUE, the next call to wrefresh() with - this window will clear the screen completely and redraw the + With clearok(), if bf is TRUE, the next call to wrefresh() with + this window will clear the screen completely and redraw the entire screen. - immedok(), called with a second argument of TRUE, causes an - automatic wrefresh() every time a change is made to the + immedok(), called with a second argument of TRUE, causes an + automatic wrefresh() every time a change is made to the specified window. Normally, the hardware cursor is left at the location of the @@ -36,17 +36,17 @@ RCSID("$Id: outopts.c,v 1.39 2008/07/14 12:22:13 wmcbrine Exp $") the need for cursor motions. If possible, the cursor is made invisible when this option is enabled. - wsetscrreg() sets a scrolling region in a window; "top" and - "bot" are the line numbers for the top and bottom margins. If - this option and scrollok() are enabled, any attempt to move off - the bottom margin will cause all lines in the scrolling region + wsetscrreg() sets a scrolling region in a window; "top" and + "bot" are the line numbers for the top and bottom margins. If + this option and scrollok() are enabled, any attempt to move off + the bottom margin will cause all lines in the scrolling region to scroll up one line. setscrreg() is the stdscr version. - idlok() and idcok() do nothing in PDCurses, but are provided for + idlok() and idcok() do nothing in PDCurses, but are provided for compatibility with other curses implementations. - raw_output() enables the output of raw characters using the - standard *add* and *ins* curses functions (that is, it disables + raw_output() enables the output of raw characters using the + standard *add* and *ins* curses functions (that is, it disables translation of control characters). Return Value: diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/overlay.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/overlay.c index f9bba50fb9..a1d5791450 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/overlay.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/overlay.c @@ -43,7 +43,7 @@ RCSID("$Id: overlay.c,v 1.36 2008/07/14 12:35:23 wmcbrine Exp $") **man-end****************************************************************/ -/* Thanks to Andreas Otte <venn@@uni-paderborn.de> for the +/* Thanks to Andreas Otte <venn@@uni-paderborn.de> for the corrected overlay()/overwrite() behavior. */ static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr, @@ -85,7 +85,7 @@ static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr, if (fc == _NO_CHANGE) fc = col + dst_tc; - + lc = col + dst_tc; } @@ -130,7 +130,7 @@ int overlay(const WINDOW *src_w, WINDOW *dst_w) last_col = min(src_w->_begx + src_w->_maxx, dst_w->_begx + dst_w->_maxx); last_line = min(src_w->_begy + src_w->_maxy, dst_w->_begy + dst_w->_maxy); - /* determine the overlapping region of the two windows in real + /* determine the overlapping region of the two windows in real coordinates */ /* if no overlapping region, do nothing */ @@ -187,7 +187,7 @@ int overwrite(const WINDOW *src_w, WINDOW *dst_w) last_col = min(src_w->_begx + src_w->_maxx, dst_w->_begx + dst_w->_maxx); last_line = min(src_w->_begy + src_w->_maxy, dst_w->_begy + dst_w->_maxy); - /* determine the overlapping region of the two windows in real + /* determine the overlapping region of the two windows in real coordinates */ /* if no overlapping region, do nothing */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/pad.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/pad.c index ccc5db20d3..d4cad07149 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/pad.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/pad.c @@ -31,13 +31,13 @@ RCSID("$Id: pad.c,v 1.50 2008/07/14 12:22:13 wmcbrine Exp $") to specify the part of the pad to be displayed, and the location to use on the screen. - newpad() creates a new pad data structure. + newpad() creates a new pad data structure. subpad() creates a new sub-pad within a pad, at position (begy, - begx), with dimensions of nlines lines and ncols columns. This - position is relative to the pad, and not to the screen as with - subwin. Changes to either the parent pad or sub-pad will affect - both. When using sub-pads, you may need to call touchwin() + begx), with dimensions of nlines lines and ncols columns. This + position is relative to the pad, and not to the screen as with + subwin. Changes to either the parent pad or sub-pad will affect + both. When using sub-pads, you may need to call touchwin() before calling prefresh(). pnoutrefresh() copies the specified pad to the virtual screen. @@ -46,7 +46,7 @@ RCSID("$Id: pad.c,v 1.50 2008/07/14 12:22:13 wmcbrine Exp $") These routines are analogous to wnoutrefresh() and wrefresh(). (py, px) specifies the upper left corner of the part of the pad - to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen + to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen rectangle that will contain the selected part of the pad. pechochar() is functionally equivalent to addch() followed by @@ -87,7 +87,7 @@ WINDOW *newpad(int nlines, int ncols) win->_flags = _PAD; - /* save default values in case pechochar() is the first call to + /* save default values in case pechochar() is the first call to prefresh(). */ save_pminrow = 0; @@ -120,10 +120,10 @@ WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begy, int begx) (begx + ncols) > (orig->_begx + orig->_maxx)) return (WINDOW *)NULL; - if (!nlines) + if (!nlines) nlines = orig->_maxy - 1 - j; - if (!ncols) + if (!ncols) ncols = orig->_maxx - 1 - k; if ( !(win = PDC_makenew(nlines, ncols, begy, begx)) ) @@ -199,7 +199,7 @@ int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1, int sy2, int sx2) memcpy(curscr->_y[sline] + sx1, w->_y[pline] + px, num_cols * sizeof(chtype)); - if ((curscr->_firstch[sline] == _NO_CHANGE) + if ((curscr->_firstch[sline] == _NO_CHANGE) || (curscr->_firstch[sline] > sx1)) curscr->_firstch[sline] = sx1; @@ -220,8 +220,8 @@ int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1, int sy2, int sx2) curscr->_clear = TRUE; } - /* position the cursor to the pad's current position if possible -- - is the pad current position going to end up displayed? if not, + /* position the cursor to the pad's current position if possible -- + is the pad current position going to end up displayed? if not, then don't move the cursor; if so, move it to the correct place */ if (!w->_leaveit && w->_cury >= py && w->_curx >= px && @@ -241,7 +241,7 @@ int pechochar(WINDOW *pad, chtype ch) if (waddch(pad, ch) == ERR) return ERR; - return prefresh(pad, save_pminrow, save_pmincol, save_sminrow, + return prefresh(pad, save_pminrow, save_pmincol, save_sminrow, save_smincol, save_smaxrow, save_smaxcol); } @@ -253,7 +253,7 @@ int pecho_wchar(WINDOW *pad, const cchar_t *wch) if (!wch || (waddch(pad, *wch) == ERR)) return ERR; - return prefresh(pad, save_pminrow, save_pmincol, save_sminrow, + return prefresh(pad, save_pminrow, save_pmincol, save_sminrow, save_smincol, save_smaxrow, save_smaxcol); } #endif diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/panel.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/panel.c index 77028c6ffc..87b987d4b4 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/panel.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/panel.c @@ -44,61 +44,61 @@ RCSID("$Id: panel.c,v 1.8 2008/07/14 12:35:23 wmcbrine Exp $") panels, fetch and set their associated windows, shuffle panels in the deck, and manipulate panels in other ways. - bottom_panel() places pan at the bottom of the deck. The size, + bottom_panel() places pan at the bottom of the deck. The size, location and contents of the panel are unchanged. del_panel() deletes pan, but not its associated winwow. - hide_panel() removes a panel from the deck and thus hides it + hide_panel() removes a panel from the deck and thus hides it from view. - move_panel() moves the curses window associated with pan, so - that its upper lefthand corner is at the supplied coordinates. + move_panel() moves the curses window associated with pan, so + that its upper lefthand corner is at the supplied coordinates. (Do not use mvwin() on the window.) - new_panel() creates a new panel associated with win and returns - the panel pointer. The new panel is placed at the top of the + new_panel() creates a new panel associated with win and returns + the panel pointer. The new panel is placed at the top of the deck. - panel_above() returns a pointer to the panel in the deck above - pan, or NULL if pan is the top panel. If the value of pan passed - is NULL, this function returns a pointer to the bottom panel in + panel_above() returns a pointer to the panel in the deck above + pan, or NULL if pan is the top panel. If the value of pan passed + is NULL, this function returns a pointer to the bottom panel in the deck. - panel_below() returns a pointer to the panel in the deck below - pan, or NULL if pan is the bottom panel. If the value of pan - passed is NULL, this function returns a pointer to the top panel + panel_below() returns a pointer to the panel in the deck below + pan, or NULL if pan is the bottom panel. If the value of pan + passed is NULL, this function returns a pointer to the top panel in the deck. panel_hidden() returns OK if pan is hidden and ERR if it is not. - panel_userptr() - Each panel has a user pointer available for - maintaining relevant information. This function returns a - pointer to that information previously set up by + panel_userptr() - Each panel has a user pointer available for + maintaining relevant information. This function returns a + pointer to that information previously set up by set_panel_userptr(). - panel_window() returns a pointer to the curses window associated + panel_window() returns a pointer to the curses window associated with the panel. replace_panel() replaces the current window of pan with win. - set_panel_userptr() - Each panel has a user pointer available - for maintaining relevant information. This function sets the + set_panel_userptr() - Each panel has a user pointer available + for maintaining relevant information. This function sets the value of that information. - show_panel() makes a previously hidden panel visible and places + show_panel() makes a previously hidden panel visible and places it back in the deck on top. - top_panel() places pan on the top of the deck. The size, + top_panel() places pan on the top of the deck. The size, location and contents of the panel are unchanged. - update_panels() refreshes the virtual screen to reflect the - depth relationships between the panels in the deck. The user + update_panels() refreshes the virtual screen to reflect the + depth relationships between the panels in the deck. The user must use doupdate() to refresh the physical screen. Return Value: - Each routine that returns a pointer to an object returns NULL if - an error occurs. Each panel routine that returns an integer, + Each routine that returns a pointer to an object returns NULL if + an error occurs. Each panel routine that returns an integer, returns OK if it executes successfully and ERR if it does not. Portability X/Open BSD SYS V @@ -617,7 +617,7 @@ void update_panels(void) if (is_wintouched(stdscr)) Wnoutrefresh(&_stdscr_pseudo_panel); - + pan = _bottom_panel; while (pan) diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/printw.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/printw.c index 9be0c5fc20..ac67f919bb 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/printw.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/printw.c @@ -17,13 +17,13 @@ RCSID("$Id: printw.c,v 1.40 2008/07/13 16:08:18 wmcbrine Exp $") int vw_printw(WINDOW *win, const char *fmt, va_list varglist); Description: - The printw() functions add a formatted string to the window at - the current or specified cursor position. The format strings are - the same as used in the standard C library's printf(). (printw() + The printw() functions add a formatted string to the window at + the current or specified cursor position. The format strings are + the same as used in the standard C library's printf(). (printw() can be used as a drop-in replacement for printf().) Return Value: - All functions return the number of characters printed, or + All functions return the number of characters printed, or ERR on error. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/refresh.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/refresh.c index 0b8e1ca5ed..da4bb76edd 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/refresh.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/refresh.c @@ -17,28 +17,28 @@ RCSID("$Id: refresh.c,v 1.56 2008/07/13 16:08:18 wmcbrine Exp $") int wredrawln(WINDOW *win, int beg_line, int num_lines); Description: - wrefresh() copies the named window to the physical terminal - screen, taking into account what is already there in order to - optimize cursor movement. refresh() does the same, using stdscr. - These routines must be called to get any output on the terminal, - as other routines only manipulate data structures. Unless - leaveok() has been enabled, the physical cursor of the terminal + wrefresh() copies the named window to the physical terminal + screen, taking into account what is already there in order to + optimize cursor movement. refresh() does the same, using stdscr. + These routines must be called to get any output on the terminal, + as other routines only manipulate data structures. Unless + leaveok() has been enabled, the physical cursor of the terminal is left at the location of the window's cursor. - wnoutrefresh() and doupdate() allow multiple updates with more - efficiency than wrefresh() alone. wrefresh() works by first - calling wnoutrefresh(), which copies the named window to the - virtual screen. It then calls doupdate(), which compares the - virtual screen to the physical screen and does the actual - update. A series of calls to wrefresh() will result in - alternating calls to wnoutrefresh() and doupdate(), causing - several bursts of output to the screen. By first calling - wnoutrefresh() for each window, it is then possible to call + wnoutrefresh() and doupdate() allow multiple updates with more + efficiency than wrefresh() alone. wrefresh() works by first + calling wnoutrefresh(), which copies the named window to the + virtual screen. It then calls doupdate(), which compares the + virtual screen to the physical screen and does the actual + update. A series of calls to wrefresh() will result in + alternating calls to wnoutrefresh() and doupdate(), causing + several bursts of output to the screen. By first calling + wnoutrefresh() for each window, it is then possible to call doupdate() only once. - In PDCurses, redrawwin() is equivalent to touchwin(), and - wredrawln() is the same as touchline(). In some other curses - implementations, there's a subtle distinction, but it has no + In PDCurses, redrawwin() is equivalent to touchwin(), and + wredrawln() is the same as touchline(). In some other curses + implementations, there's a subtle distinction, but it has no meaning in PDCurses. Return Value: @@ -79,7 +79,7 @@ int wnoutrefresh(WINDOW *win) int first = win->_firstch[i]; /* first changed */ int last = win->_lastch[i]; /* last changed */ - /* ignore areas on the outside that are marked as changed, + /* ignore areas on the outside that are marked as changed, but really aren't */ while (first <= last && src[first] == dest[first]) @@ -95,7 +95,7 @@ int wnoutrefresh(WINDOW *win) memcpy(dest + first, src + first, (last - first + 1) * sizeof(chtype)); - first += begx; + first += begx; last += begx; if (first < curscr->_firstch[j] || diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scanw.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scanw.c index af2bcb9e1b..47f205052b 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scanw.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scanw.c @@ -130,17 +130,17 @@ int vw_scanw(WINDOW *win, const char *fmt, va_list varglist) #ifndef HAVE_VSSCANF -/* _pdc_vsscanf() - Internal routine to parse and format an input - buffer. It scans a series of input fields; each field is formatted - according to a supplied format string and the formatted input is - stored in the variable number of addresses passed. Returns the number +/* _pdc_vsscanf() - Internal routine to parse and format an input + buffer. It scans a series of input fields; each field is formatted + according to a supplied format string and the formatted input is + stored in the variable number of addresses passed. Returns the number of input fields or EOF on error. - Don't compile this unless required. Some compilers (at least Borland + Don't compile this unless required. Some compilers (at least Borland C++ 3.0) have to link with math libraries due to the use of floats. - Based on vsscanf.c and input.c from emx 0.8f library source, - Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to + Based on vsscanf.c and input.c from emx 0.8f library source, + Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to its inclusion in PDCurses. */ #define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n') diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scr_dump.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scr_dump.c index e02046e5ff..6727ba36a2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scr_dump.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scr_dump.c @@ -17,32 +17,32 @@ RCSID("$Id: scr_dump.c,v 1.30 2008/07/13 16:08:18 wmcbrine Exp $") int scr_set(const char *filename); Description: - getwin() reads window-related data previously stored in a file - by putwin(). It then creates and initialises a new window using + getwin() reads window-related data previously stored in a file + by putwin(). It then creates and initialises a new window using that data. - putwin() writes all data associated with a window into a file, - using an unspecified format. This information can be retrieved + putwin() writes all data associated with a window into a file, + using an unspecified format. This information can be retrieved later using getwin(). - scr_dump() writes the current contents of the virtual screen to + scr_dump() writes the current contents of the virtual screen to the file named by filename in an unspecified format. - scr_restore() function sets the virtual screen to the contents - of the file named by filename, which must have been written - using scr_dump(). The next refresh operation restores the screen + scr_restore() function sets the virtual screen to the contents + of the file named by filename, which must have been written + using scr_dump(). The next refresh operation restores the screen to the way it looked in the dump file. - In PDCurses, scr_init() does nothing, and scr_set() is a synonym - for scr_restore(). Also, scr_dump() and scr_restore() save and - load from curscr. This differs from some other implementations, - where scr_init() works with curscr, and scr_restore() works with - newscr; but the effect should be the same. (PDCurses has no + In PDCurses, scr_init() does nothing, and scr_set() is a synonym + for scr_restore(). Also, scr_dump() and scr_restore() save and + load from curscr. This differs from some other implementations, + where scr_init() works with curscr, and scr_restore() works with + newscr; but the effect should be the same. (PDCurses has no newscr.) Return Value: - On successful completion, getwin() returns a pointer to the - window it created. Otherwise, it returns a null pointer. Other + On successful completion, getwin() returns a pointer to the + window it created. Otherwise, it returns a null pointer. Other functions return OK or ERR. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scroll.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scroll.c index c53e295468..bc6c082e37 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scroll.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/scroll.c @@ -14,15 +14,15 @@ RCSID("$Id: scroll.c,v 1.36 2008/07/13 16:08:18 wmcbrine Exp $") int wscrl(WINDOW *win, int n); Description: - scroll() causes the window to scroll up one line. This involves + scroll() causes the window to scroll up one line. This involves moving the lines in the window data strcture. - - With a positive n, scrl() and wscrl() scroll the window up n - lines (line i + n becomes i); otherwise they scroll the window + + With a positive n, scrl() and wscrl() scroll the window up n + lines (line i + n becomes i); otherwise they scroll the window down n lines. - - For these functions to work, scrolling must be enabled via - scrollok(). Note also that scrolling is not allowed if the + + For these functions to work, scrolling must be enabled via + scrollok(). Note also that scrolling is not allowed if the supplied window is a pad. Return Value: @@ -60,7 +60,7 @@ int wscrl(WINDOW *win, int n) dir = -1; } - for (l = 0; l < (n * dir); l++) + for (l = 0; l < (n * dir); l++) { temp = win->_y[start]; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/slk.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/slk.c index f97f406e37..1491e2bbf0 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/slk.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/slk.c @@ -34,17 +34,17 @@ RCSID("$Id: slk.c,v 1.61 2008/07/13 16:08:18 wmcbrine Exp $") wchar_t *slk_wlabel(int labnum) Description: - These functions manipulate a window that contain Soft Label Keys - (SLK). To use the SLK functions, a call to slk_init() must be - made BEFORE initscr() or newterm(). slk_init() removes 1 or 2 + These functions manipulate a window that contain Soft Label Keys + (SLK). To use the SLK functions, a call to slk_init() must be + made BEFORE initscr() or newterm(). slk_init() removes 1 or 2 lines from the useable screen, depending on the format selected. - The line(s) removed from the screen are used as a separate + The line(s) removed from the screen are used as a separate window, in which SLKs are displayed. - slk_init() requires a single parameter which describes the + slk_init() requires a single parameter which describes the format of the SLKs as follows: - + 0 3-2-3 format 1 4-4 format 2 4-4-4 format (ncurses extension) @@ -116,7 +116,7 @@ int slk_init(int fmt) if (SP) return ERR; - switch (fmt) + switch (fmt) { case 0: /* 3 - 2 - 3 */ labels = LABEL_NORMAL; @@ -218,7 +218,7 @@ int slk_set(int labnum, const char *label, int justify) labnum--; - if (!label || !(*label)) + if (!label || !(*label)) { /* Clear the label */ @@ -433,7 +433,7 @@ static void _slk_calc(void) col += label_length; if (i == 3) - col = COLS - (label_length * 4) + 1; + col = COLS - (label_length * 4) + 1; } break; @@ -497,7 +497,7 @@ void PDC_slk_initialize(void) if (!SP->slk_winptr) { - if ( !(SP->slk_winptr = newwin(SP->slklines, COLS, + if ( !(SP->slk_winptr = newwin(SP->slklines, COLS, LINES - SP->slklines, 0)) ) return; @@ -555,7 +555,7 @@ int PDC_mouse_in_slk(int y, int x) PDC_LOG(("PDC_mouse_in_slk() - called: y->%d x->%d\n", y, x)); - /* If the line on which the mouse was clicked is NOT the last line + /* If the line on which the mouse was clicked is NOT the last line of the screen, we are not interested in it. */ if (!slk || !SP->slk_winptr || (y != SP->slk_winptr->_begy + label_line)) @@ -578,7 +578,7 @@ int slk_wset(int labnum, const wchar_t *label, int justify) labnum--; - if (!label || !(*label)) + if (!label || !(*label)) { /* Clear the label */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/termattr.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/termattr.c index 06e9ee856e..f25ee95e03 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/termattr.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/termattr.c @@ -25,16 +25,16 @@ RCSID("$Id: termattr.c,v 1.54 2008/07/13 16:08:18 wmcbrine Exp $") char wordchar(void); Description: - baudrate() is supposed to return the output speed of the + baudrate() is supposed to return the output speed of the terminal. In PDCurses, it simply returns INT_MAX. - has_ic and has_il() return TRUE. These functions have meaning in + has_ic and has_il() return TRUE. These functions have meaning in some other implementations of curses. - erasechar() and killchar() return ^H and ^U, respectively -- the - ERASE and KILL characters. In other curses implementations, - these may vary by terminal type. erasewchar() and killwchar() - are the wide-character versions; they take a pointer to a + erasechar() and killchar() return ^H and ^U, respectively -- the + ERASE and KILL characters. In other curses implementations, + these may vary by terminal type. erasewchar() and killwchar() + are the wide-character versions; they take a pointer to a location in which to store the character, and return OK or ERR. longname() returns a pointer to a static area containing a @@ -48,8 +48,8 @@ RCSID("$Id: termattr.c,v 1.54 2008/07/13 16:08:18 wmcbrine Exp $") termattrs() returns a logical OR of all video attributes supported by the terminal. - wordchar() is a PDCurses extension of the concept behind the - functions erasechar() and killchar(), returning the "delete + wordchar() is a PDCurses extension of the concept behind the + functions erasechar() and killchar(), returning the "delete word" character, ^W. Portability X/Open BSD SYS V @@ -131,7 +131,7 @@ attr_t term_attrs(void) { PDC_LOG(("term_attrs() - called\n")); - return WA_BLINK | WA_BOLD | WA_INVIS | WA_LEFT | WA_REVERSE | + return WA_BLINK | WA_BOLD | WA_INVIS | WA_LEFT | WA_REVERSE | WA_RIGHT | WA_UNDERLINE; } diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c index c099ada728..abae4f2614 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c @@ -35,10 +35,10 @@ RCSID("$Id: terminfo.c,v 1.37 2008/07/21 12:29:20 wmcbrine Exp $") int tputs(const char *, int, int (*)(int)); Description: - mvcur() lets you move the physical cursor without updating any + mvcur() lets you move the physical cursor without updating any window cursor positions. It returns OK or ERR. - The rest of these functions are currently implemented as stubs, + The rest of these functions are currently implemented as stubs, returning the appropriate errors and doing nothing else. Portability X/Open BSD SYS V diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/touch.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/touch.c index 9355aa1f40..c808058b81 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/touch.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/touch.c @@ -17,26 +17,26 @@ RCSID("$Id: touch.c,v 1.29 2008/07/13 16:08:18 wmcbrine Exp $") bool is_wintouched(WINDOW *win); Description: - touchwin() and touchline() throw away all information about - which parts of the window have been touched, pretending that the - entire window has been drawn on. This is sometimes necessary - when using overlapping windows, since a change to one window - will affect the other window, but the records of which lines - have been changed in the other window will not reflect the + touchwin() and touchline() throw away all information about + which parts of the window have been touched, pretending that the + entire window has been drawn on. This is sometimes necessary + when using overlapping windows, since a change to one window + will affect the other window, but the records of which lines + have been changed in the other window will not reflect the change. - untouchwin() marks all lines in the window as unchanged since + untouchwin() marks all lines in the window as unchanged since the last call to wrefresh(). - wtouchln() makes n lines in the window, starting at line y, look - as if they have (changed == 1) or have not (changed == 0) been + wtouchln() makes n lines in the window, starting at line y, look + as if they have (changed == 1) or have not (changed == 0) been changed since the last call to wrefresh(). - is_linetouched() returns TRUE if the specified line in the - specified window has been changed since the last call to + is_linetouched() returns TRUE if the specified line in the + specified window has been changed since the last call to wrefresh(). - is_wintouched() returns TRUE if the specified window + is_wintouched() returns TRUE if the specified window has been changed since the last call to wrefresh(). Return Value: @@ -125,7 +125,7 @@ int wtouchln(WINDOW *win, int y, int n, int changed) win->_firstch[i] = 0; win->_lastch[i] = win->_maxx - 1; } - else + else { win->_firstch[i] = _NO_CHANGE; win->_lastch[i] = _NO_CHANGE; diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/util.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/util.c index f0673fca4a..9972143516 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/util.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/util.c @@ -25,38 +25,38 @@ RCSID("$Id: util.c,v 1.71 2008/07/13 16:08:18 wmcbrine Exp $") size_t PDC_wcstombs(char *dest, const wchar_t *src, size_t n); Description: - unctrl() expands the text portion of the chtype c into a - printable string. Control characters are changed to the "^X" - notation; others are passed through. wunctrl() is the wide- + unctrl() expands the text portion of the chtype c into a + printable string. Control characters are changed to the "^X" + notation; others are passed through. wunctrl() is the wide- character version of the function. filter() and use_env() are no-ops in PDCurses. delay_output() inserts an ms millisecond pause in output. - getcchar() works in two modes: When wch is not NULL, it reads - the cchar_t pointed to by wcval and stores the attributes in + getcchar() works in two modes: When wch is not NULL, it reads + the cchar_t pointed to by wcval and stores the attributes in attrs, the color pair in color_pair, and the text in the - wide-character string wch. When wch is NULL, getcchar() merely - returns the number of wide characters in wcval. In either mode, + wide-character string wch. When wch is NULL, getcchar() merely + returns the number of wide characters in wcval. In either mode, the opts argument is unused. - setcchar constructs a cchar_t at wcval from the wide-character - text at wch, the attributes in attr and the color pair in + setcchar constructs a cchar_t at wcval from the wide-character + text at wch, the attributes in attr and the color pair in color_pair. The opts argument is unused. Currently, the length returned by getcchar() is always 1 or 0. Similarly, setcchar() will only take the first wide character from wch, and ignore any others that it "should" take (i.e., - combining characters). Nor will it correctly handle any + combining characters). Nor will it correctly handle any character outside the basic multilingual plane (UCS-2). Return Value: - unctrl() and wunctrl() return NULL on failure. delay_output() + unctrl() and wunctrl() return NULL on failure. delay_output() always returns OK. - getcchar() returns the number of wide characters wcval points to - when wch is NULL; when it's not, getcchar() returns OK or ERR. + getcchar() returns the number of wide characters wcval points to + when wch is NULL; when it's not, getcchar() returns OK or ERR. setcchar() returns OK or ERR. diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/window.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/window.c index dbfd58494c..b5634c7c37 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/window.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/window.c @@ -36,8 +36,8 @@ RCSID("$Id: window.c,v 1.62 2008/07/13 16:08:18 wmcbrine Exp $") LINES - begy; ncols to COLS - begx. Create a new full-screen window by calling newwin(0, 0, 0, 0). - delwin() deletes the named window, freeing all associated - memory. In the case of overlapping windows, subwindows should be + delwin() deletes the named window, freeing all associated + memory. In the case of overlapping windows, subwindows should be deleted before the main window. mvwin() moves the window so that the upper left-hand corner is @@ -78,12 +78,12 @@ RCSID("$Id: window.c,v 1.62 2008/07/13 16:08:18 wmcbrine Exp $") wsyncdown() causes a touchwin() of the current window if any of its parent's windows have been touched. - resize_window() allows the user to resize an existing window. It + resize_window() allows the user to resize an existing window. It returns the pointer to the new window, or NULL on failure. wresize() is an ncurses-compatible wrapper for resize_window(). Note that, unlike ncurses, it will NOT process any subwindows of - the window. (However, you still can call it _on_ subwindows.) It + the window. (However, you still can call it _on_ subwindows.) It returns OK or ERR. PDC_makenew() allocates all data for a new WINDOW * except the |