diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2011-10-31 12:54:00 -0700 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2011-11-01 19:08:23 +0100 |
commit | e11835e2995d130890ca9f45cb3e304f2ea3a6a9 (patch) | |
tree | cfc5345e9d98b231de0699714771a5d7f54c6ce1 /payloads | |
parent | dd6906328904309e4d93e4bcb04a6cfa3646f29d (diff) |
libpayload: remove trailing whitespace and run dos2unix
Change-Id: Iffed3602456f5306711c65f06c873c58d4086e11
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/363
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads')
139 files changed, 1259 insertions, 1259 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/curses.h b/payloads/libpayload/curses/PDCurses-3.4/curses.h index 6f3ce19d42..88942c095e 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/curses.h +++ b/payloads/libpayload/curses/PDCurses-3.4/curses.h @@ -180,8 +180,8 @@ typedef struct #define BUTTON3_TRIPLE_CLICKED 0x00004000L #define BUTTON3_MOVED 0x00004000L /* PDCurses */ -/* For the ncurses-compatible functions only, BUTTON4_PRESSED and - BUTTON5_PRESSED are returned for mouse scroll wheel up and down; +/* For the ncurses-compatible functions only, BUTTON4_PRESSED and + BUTTON5_PRESSED are returned for mouse scroll wheel up and down; otherwise PDCurses doesn't support buttons 4 and 5 */ #define BUTTON4_RELEASED 0x00008000L @@ -261,7 +261,7 @@ typedef struct _win /* definition of a window */ struct _win *_parent; /* subwin's pointer to parent win */ } WINDOW; -/* Avoid using the SCREEN struct directly -- use the corresponding +/* Avoid using the SCREEN struct directly -- use the corresponding functions if possible. This struct may eventually be made private. */ typedef struct @@ -287,12 +287,12 @@ typedef struct unsigned long _trap_mbe; /* trap these mouse button events */ unsigned long _map_mbe_to_key; /* map mouse buttons to slk */ int mouse_wait; /* time to wait (in ms) for a - button release after a press, in + button release after a press, in order to count it as a click */ int slklines; /* lines in use by slk_init() */ WINDOW *slk_winptr; /* window for slk */ int linesrippedoff; /* lines ripped off via ripoffline() */ - int linesrippedoffontop; /* lines ripped off on + int linesrippedoffontop; /* lines ripped off on top via ripoffline() */ int delaytenths; /* 1/10ths second to wait block getch() for */ @@ -352,13 +352,13 @@ PDCEX char ttytype[]; /* terminal name/description */ PDCurses Text Attributes ======================== -Originally, PDCurses used a short (16 bits) for its chtype. To include -color, a number of things had to be sacrificed from the strict Unix and -System V support. The main problem was fitting all character attributes +Originally, PDCurses used a short (16 bits) for its chtype. To include +color, a number of things had to be sacrificed from the strict Unix and +System V support. The main problem was fitting all character attributes and color into an unsigned char (all 8 bits!). -Today, PDCurses by default uses a long (32 bits) for its chtype, as in -System V. The short chtype is still available, by undefining CHTYPE_LONG +Today, PDCurses by default uses a long (32 bits) for its chtype, as in +System V. The short chtype is still available, by undefining CHTYPE_LONG and rebuilding the library. The following is the structure of a win->_attrs chtype: @@ -370,9 +370,9 @@ short form: ------------------------------------------------- color number | attrs | character eg 'a' -The available non-color attributes are bold, reverse and blink. Others -have no effect. The high order char is an index into an array of -physical colors (defined in color.c) -- 32 foreground/background color +The available non-color attributes are bold, reverse and blink. Others +have no effect. The high order char is an index into an array of +physical colors (defined in color.c) -- 32 foreground/background color pairs (5 bits) plus 3 bits for other attributes. long form: @@ -382,8 +382,8 @@ long form: ---------------------------------------------------------------------------- color number | modifiers | character eg 'a' -The available non-color attributes are bold, underline, invisible, -right-line, left-line, protect, reverse and blink. 256 color pairs (8 +The available non-color attributes are bold, underline, invisible, +right-line, left-line, protect, reverse and blink. 256 color pairs (8 bits), 8 bits for other attributes, and 16 bits for character data. **man-end****************************************************************/ @@ -440,7 +440,7 @@ bits), 8 bits for other attributes, and 16 bits for character data. #define ATR_MSK A_ATTRIBUTES /* Obsolete */ #define ATR_NRM A_NORMAL /* Obsolete */ -/* For use with attr_t -- X/Open says, "these shall be distinct", so +/* For use with attr_t -- X/Open says, "these shall be distinct", so this is a non-conforming implementation. */ #define WA_ALTCHARSET A_ALTCHARSET @@ -463,7 +463,7 @@ bits), 8 bits for other attributes, and 16 bits for character data. /*** Alternate character set macros ***/ /* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET - 'n' = 16-bit chtype; it gets the fallback set because no bit is + 'n' = 16-bit chtype; it gets the fallback set because no bit is available for A_ALTCHARSET */ #ifdef CHTYPE_LONG @@ -888,7 +888,7 @@ void bkgdset(chtype); int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype); int box(WINDOW *, chtype, chtype); bool can_change_color(void); -int cbreak(void); +int cbreak(void); int chgat(int, attr_t, short, const void *); int clearok(WINDOW *, bool); int clear(void); @@ -903,7 +903,7 @@ int def_shell_mode(void); int delay_output(int); int delch(void); int deleteln(void); -void delscreen(SCREEN *); +void delscreen(SCREEN *); int delwin(WINDOW *); WINDOW *derwin(WINDOW *, int, int, int, int); int doupdate(void); @@ -1141,8 +1141,8 @@ int addwstr(const wchar_t *); int add_wch(const cchar_t *); int add_wchnstr(const cchar_t *, int); int add_wchstr(const cchar_t *); -int border_set(const cchar_t *, const cchar_t *, const cchar_t *, - const cchar_t *, const cchar_t *, const cchar_t *, +int border_set(const cchar_t *, const cchar_t *, const cchar_t *, + const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *); int box_set(WINDOW *, const cchar_t *, const cchar_t *); int echo_wchar(const cchar_t *); @@ -1212,7 +1212,7 @@ int wadd_wchstr(WINDOW *, const cchar_t *); int wbkgrnd(WINDOW *, const cchar_t *); void wbkgrndset(WINDOW *, const cchar_t *); int wborder_set(WINDOW *, const cchar_t *, const cchar_t *, - const cchar_t *, const cchar_t *, const cchar_t *, + const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *); int wecho_wchar(WINDOW *, const cchar_t *); int wgetbkgrnd(WINDOW *, cchar_t *); diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c b/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c index 8d7921f3df..61fd65d549 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c @@ -41,7 +41,7 @@ int main(int argc, char **argv) seed = time((time_t *)0); srand(seed); flag = 0; - + while (getch() == ERR) /* loop until a key is hit */ { do { diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c b/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c index 3eae98d439..eefc0c16f1 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c @@ -1,5 +1,5 @@ /* - * newdemo.c - A demo program using PDCurses. The program + * newdemo.c - A demo program using PDCurses. The program * illustrates the use of colors for text output. * * Hacks by jbuhler@cs.washington.edu on 12/29/96 @@ -238,7 +238,7 @@ int main(int argc, char **argv) #endif noecho(); - /* refresh stdscr so that reading from it will not cause it to + /* refresh stdscr so that reading from it will not cause it to overwrite the other windows that are being created */ refresh(); @@ -267,7 +267,7 @@ int main(int argc, char **argv) wattrset(win, COLOR_PAIR(2)); box(win, ' ', ' '); wrefresh(win); - + wattrset(win, 0); /* Do random output of a character */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c b/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c index 1134f6ffca..6071f79d0e 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c @@ -9,7 +9,7 @@ WINDOW *w4, *w5; long nap_msec = 1; -char *mod[] = +char *mod[] = { "test ", "TEST ", "(**) ", "*()* ", "<--> ", "LAST " }; @@ -84,7 +84,7 @@ void fill_panel(PANEL *pan) char num = *((char *)pan->user + 1); int y, x, maxy, maxx; - box(win, 0, 0); + box(win, 0, 0); mvwprintw(win, 1, 1, "-pan%c-", num); getmaxyx(win, maxy, maxx); diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/testcurs.c b/payloads/libpayload/curses/PDCurses-3.4/demos/testcurs.c index 5b330f558b..54d44f42d9 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/testcurs.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/testcurs.c @@ -343,7 +343,7 @@ void inputTest(WINDOW *win) sw = w / 3; sh = h / 3; - if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) + if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL) return; @@ -424,11 +424,11 @@ void inputTest(WINDOW *win) else if (BUTTON_CHANGED(3)) button = 3; - if (button && (BUTTON_STATUS(button) & + if (button && (BUTTON_STATUS(button) & BUTTON_MODIFIER_MASK)) { waddstr(win, " Modifier(s):"); - + if (BUTTON_STATUS(button) & BUTTON_SHIFT) waddstr(win, " SHIFT"); @@ -611,7 +611,7 @@ void outputTest(WINDOW *win) wmove(win1, 8, 26); wrefresh(win1); wgetch(win1); - + wclear(win1); wattron(win1, A_BLINK); @@ -892,7 +892,7 @@ void acsTest(WINDOW *win) "ACS_LARROW", "ACS_RARROW", "ACS_UARROW", "ACS_DARROW", "ACS_BOARD", "ACS_LANTERN", "ACS_BLOCK" #ifdef ACS_S3 - , "ACS_S3", "ACS_S7", "ACS_LEQUAL", "ACS_GEQUAL", + , "ACS_S3", "ACS_S7", "ACS_LEQUAL", "ACS_GEQUAL", "ACS_PI", "ACS_NEQUAL", "ACS_STERLING" #endif }; @@ -902,17 +902,17 @@ void acsTest(WINDOW *win) #if HAVE_WIDE cchar_t *wacs_values[] = { - WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER, - WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE, + WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER, + WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE, WACS_VLINE, WACS_PLUS, - WACS_S1, WACS_S9, WACS_DIAMOND, WACS_CKBOARD, WACS_DEGREE, + WACS_S1, WACS_S9, WACS_DIAMOND, WACS_CKBOARD, WACS_DEGREE, WACS_PLMINUS, WACS_BULLET, - WACS_LARROW, WACS_RARROW, WACS_UARROW, WACS_DARROW, WACS_BOARD, + WACS_LARROW, WACS_RARROW, WACS_UARROW, WACS_DARROW, WACS_BOARD, WACS_LANTERN, WACS_BLOCK # ifdef WACS_S3 - , WACS_S3, WACS_S7, WACS_LEQUAL, WACS_GEQUAL, WACS_PI, + , WACS_S3, WACS_S7, WACS_LEQUAL, WACS_GEQUAL, WACS_PI, WACS_NEQUAL, WACS_STERLING # endif }; @@ -923,7 +923,7 @@ void acsTest(WINDOW *win) static const wchar_t greek[] = {0x0395, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba, 0x03ac, 0}; - static const wchar_t georgian[] = {0x10e5, 0x10d0, 0x10e0, 0x10d7, + static const wchar_t georgian[] = {0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, L' ', 0x10d4, 0x10dc, 0x10d0, 0}; #endif @@ -993,13 +993,13 @@ void colorTest(WINDOW *win) { static const short colors[] = { - COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, + COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_CYAN, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE }; static const char *colornames[] = { - "COLOR_BLACK", "COLOR_RED", "COLOR_GREEN", "COLOR_BLUE", + "COLOR_BLACK", "COLOR_RED", "COLOR_GREEN", "COLOR_BLUE", "COLOR_CYAN", "COLOR_MAGENTA", "COLOR_YELLOW", "COLOR_WHITE" }; diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/tui.c b/payloads/libpayload/curses/PDCurses-3.4/demos/tui.c index e57a1b0968..62e0d53767 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/tui.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/tui.c @@ -65,7 +65,7 @@ static bool incurses = FALSE; #ifndef PDCURSES static char wordchar(void) { - return 0x17; /* ^W */ + return 0x17; /* ^W */ } #endif @@ -110,13 +110,13 @@ static void initcolor(void) /* foreground, background */ - init_pair(TITLECOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN); - init_pair(MAINMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); + init_pair(TITLECOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN); + init_pair(MAINMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); init_pair(MAINMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); - init_pair(SUBMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); - init_pair(SUBMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); - init_pair(BODYCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLUE); - init_pair(STATUSCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); + init_pair(SUBMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); + init_pair(SUBMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); + init_pair(BODYCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLUE); + init_pair(STATUSCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); init_pair(INPUTBOXCOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN); init_pair(EDITBOXCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); #endif @@ -152,7 +152,7 @@ static void colorbox(WINDOW *win, chtype color, int hasbox) #endif wbkgd(win, attr); - werase(win); + werase(win); #ifdef PDCURSES maxy = getmaxy(win); @@ -181,7 +181,7 @@ static void idle(void) tp->tm_hour, tp->tm_min, tp->tm_sec); mvwaddstr(wtitl, 0, bw - strlen(buf) - 2, buf); - wrefresh(wtitl); + wrefresh(wtitl); } static void menudim(menu *mp, int *lines, int *columns) @@ -264,7 +264,7 @@ static void mainmenu(menu *mp) { if (old != -1) { - mvwaddstr(wmain, 0, old * barlen, + mvwaddstr(wmain, 0, old * barlen, prepad(padstr(mp[old].name, barlen - 1), 1)); statusmsg(mp[cur].desc); @@ -274,7 +274,7 @@ static void mainmenu(menu *mp) setcolor(wmain, MAINMENUREVCOLOR); - mvwaddstr(wmain, 0, cur * barlen, + mvwaddstr(wmain, 0, cur * barlen, prepad(padstr(mp[cur].name, barlen - 1), 1)); setcolor(wmain, MAINMENUCOLOR); @@ -472,7 +472,7 @@ void domenu(menu *mp) if (cur != old) { if (old != -1) - mvwaddstr(wmenu, old + 1, 1, + mvwaddstr(wmenu, old + 1, 1, prepad(padstr(mp[old].name, barlen - 1), 1)); setcolor(wmenu, SUBMENUREVCOLOR); @@ -596,7 +596,7 @@ static void repainteditbox(WINDOW *win, int x, char *buf) werase(win); mvwprintw(win, 0, 0, "%s", padstr(buf, maxx)); wmove(win, 0, x); - wrefresh(win); + wrefresh(win); } /* @@ -605,15 +605,15 @@ static void repainteditbox(WINDOW *win, int x, char *buf) Description: The initial value of 'str' with a maximum length of 'field' - 1, - which is supplied by the calling routine, is editted. The user's - erase (^H), kill (^U) and delete word (^W) chars are interpreted. + which is supplied by the calling routine, is editted. The user's + erase (^H), kill (^U) and delete word (^W) chars are interpreted. The PC insert or Tab keys toggle between insert and edit mode. Escape aborts the edit session, leaving 'str' unchanged. Enter, Up or Down Arrow are used to accept the changes to 'str'. NOTE: editstr(), mveditstr(), and mvweditstr() are macros. Return Value: - Returns the input terminating character on success (Escape, + Returns the input terminating character on success (Escape, Enter, Up or Down Arrow) and ERR on error. Errors: @@ -707,9 +707,9 @@ int weditstr(WINDOW *win, char *buf, int field) { tp = bp; - while ((bp > buf) && (*(bp - 1) == ' ')) + while ((bp > buf) && (*(bp - 1) == ' ')) bp--; - while ((bp > buf) && (*(bp - 1) != ' ')) + while ((bp > buf) && (*(bp - 1) != ' ')) bp--; memmove((void *)bp, (const void *)tp, strlen(tp) + 1); @@ -739,7 +739,7 @@ int weditstr(WINDOW *win, char *buf, int field) if (!*bp) bp[1] = '\0'; - + *bp++ = c; } } @@ -784,7 +784,7 @@ int getstrings(char *desc[], char *buf[], int field) getyx(wbody, oldy, oldx); getmaxyx(wbody, maxy, maxx); - winput = mvwinputbox(wbody, (maxy - nlines) / 2, (maxx - ncols) / 2, + winput = mvwinputbox(wbody, (maxy - nlines) / 2, (maxx - ncols) / 2, nlines, ncols); for (i = 0; i < n; i++) diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/tui.h b/payloads/libpayload/curses/PDCurses-3.4/demos/tui.h index b99ca6b222..7be91237cb 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/tui.h +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/tui.h @@ -23,7 +23,7 @@ typedef void (*FUNC)(void); -typedef struct +typedef struct { char *name; /* item label */ FUNC func; /* (pointer to) function */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/tuidemo.c b/payloads/libpayload/curses/PDCurses-3.4/demos/tuidemo.c index a22d2a4181..6f4d9f21df 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/demos/tuidemo.c +++ b/payloads/libpayload/curses/PDCurses-3.4/demos/tuidemo.c @@ -31,7 +31,7 @@ void address(void) { - char *fieldname[6] = + char *fieldname[6] = { "Name", "Street", "City", "State", "Country", (char *)0 }; diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcclip.c index 74607aa0bc..c5fa29108a 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcclip.c @@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/13 16:08:17 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -32,7 +32,7 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/13 16:08:17 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support @@ -98,10 +98,10 @@ int PDC_freeclipboard(char *contents) if (contents) { - /* NOTE: We free the memory, but we can not set caller's pointer - to NULL, so if caller calls again then will try to access - free'd memory. We 1st overwrite memory with a string so if - caller tries to use free memory they won't get what they + /* NOTE: We free the memory, but we can not set caller's pointer + to NULL, so if caller calls again then will try to access + free'd memory. We 1st overwrite memory with a string so if + caller tries to use free memory they won't get what they expect & hopefully notice. */ /* memset(contents, 0xFD, strlen(contents)); */ @@ -119,7 +119,7 @@ int PDC_clearclipboard(void) { PDC_LOG(("PDC_clearclipboard() - called\n")); - if (pdc_DOS_clipboard) + if (pdc_DOS_clipboard) { free(pdc_DOS_clipboard); pdc_DOS_clipboard = NULL; diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdisp.c index aae9bfb56d..d170cb175c 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdisp.c @@ -13,10 +13,10 @@ RCSID("$Id: pdcdisp.c,v 1.65 2008/07/13 16:08:17 wmcbrine Exp $") chtype acs_map[128] = { - A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), - A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), - A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), - A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', + A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), + A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), + A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), + A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', A(0x1a), A(0x1b), A(0x18), A(0x19), @@ -25,17 +25,17 @@ chtype acs_map[128] = 0xdb, - '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', - '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', + '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', + 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', A(0x04), 0xb1, 'b', 'c', 'd', 'e', - 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, - 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, + 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, + 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, 0xd8, 0x9c, 0xf9, A(127) @@ -72,7 +72,7 @@ void PDC_gotoyx(int row, int col) PDCINT(0x10, regs); } -/* update the given physical line to look like the corresponding line in +/* update the given physical line to look like the corresponding line in curscr */ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) @@ -93,7 +93,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) struct {unsigned char text, attr;} temp_line[256]; - /* replace the attribute part of the chtype with the actual + /* replace the attribute part of the chtype with the actual color value for each chtype in the line */ for (j = 0; j < len; j++) diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdos.h b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdos.h index 436699de2f..99b0368ce6 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdos.h +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcdos.h @@ -117,7 +117,7 @@ typedef union struct { unsigned short di, di_hi, si, si_hi, bp, bp_hi, res, res_hi, - bx, bx_hi, dx, dx_hi, cx, cx_hi, ax, ax_hi, + bx, bx_hi, dx, dx_hi, cx, cx_hi, ax, ax_hi, flags, es, ds, fs, gs, ip, cs, sp, ss; } w; diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/dos/pdckbd.c index 652cb0cba7..c44393fc0f 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdckbd.c @@ -1,5 +1,5 @@ /* Public Domain Curses */ - + /* MS C doesn't return flags from int86() */ #ifdef MSC # define USE_KBHIT @@ -21,7 +21,7 @@ RCSID("$Id: pdckbd.c,v 1.87 2008/07/13 16:08:17 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -277,7 +277,7 @@ static int _process_mouse_events(void) { if (button[i].pressed) { - /* Check for a click -- a PRESS followed + /* Check for a click -- a PRESS followed immediately by a release */ if (!button[i].released) @@ -451,14 +451,14 @@ int PDC_get_key(void) return key; } -/* discard any pending keyboard or mouse input -- this is the core +/* discard any pending keyboard or mouse input -- this is the core routine for flushinp() */ void PDC_flushinp(void) { PDC_LOG(("PDC_flushinp() - called\n")); - /* Force the BIOS keyboard buffer head and tail pointers to be + /* Force the BIOS keyboard buffer head and tail pointers to be the same... Real nasty trick... */ setdosmemword(0x41a, getdosmemword(0x41c)); diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcscrn.c b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcscrn.c index ddfb095677..fc3bbfc6cb 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcscrn.c +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcscrn.c @@ -84,10 +84,10 @@ static int _get_font(void) return retval; } -/* _set_font() - Sets the current font size, if the adapter allows such a - change. It is an error to attempt to change the font size on a - "bogus" adapter. The reason for this is that we have a known video - adapter identity problem. e.g. Two adapters report the same identifying +/* _set_font() - Sets the current font size, if the adapter allows such a + change. It is an error to attempt to change the font size on a + "bogus" adapter. The reason for this is that we have a known video + adapter identity problem. e.g. Two adapters report the same identifying characteristics. */ static void _set_font(int size) @@ -154,7 +154,7 @@ static void _set_font(int size) pdc_font = _get_font(); } -/* _set_80x25() - force a known screen state: 80x25 text mode. Forces the +/* _set_80x25() - force a known screen state: 80x25 text mode. Forces the appropriate 80x25 alpha mode given the display adapter. */ static void _set_80x25(void) @@ -193,7 +193,7 @@ static int _get_scrn_mode(void) return (int)regs.h.al; } -/* _set_scrn_mode() - Sets the BIOS Video Mode Number only if it is +/* _set_scrn_mode() - Sets the BIOS Video Mode Number only if it is different from the current video mode. */ static void _set_scrn_mode(int new_mode) @@ -213,7 +213,7 @@ static void _set_scrn_mode(int new_mode) COLS = PDC_get_columns(); } -/* _sanity_check() - A video adapter identification sanity check. This +/* _sanity_check() - A video adapter identification sanity check. This routine will force sane values for various control flags. */ static int _sanity_check(int adapter) @@ -230,7 +230,7 @@ static int _sanity_check(int adapter) switch (rows) { case 25: - case 43: + case 43: break; default: pdc_bogus_adapter = TRUE; @@ -445,7 +445,7 @@ static int _query_adapter_type(void) return _sanity_check(retval); } -/* close the physical screen -- may restore the screen to its state +/* close the physical screen -- may restore the screen to its state before PDC_scr_open(); miscellaneous cleanup */ void PDC_scr_close(void) @@ -503,7 +503,7 @@ void PDC_scr_free(void) pdc_atrtab = (unsigned char *)NULL; } -/* open the physical screen -- allocate SP, miscellaneous intialization, +/* open the physical screen -- allocate SP, miscellaneous intialization, and may save the existing screen for later restoration */ int PDC_scr_open(int argc, char **argv) @@ -543,7 +543,7 @@ int PDC_scr_open(int argc, char **argv) SP->mouse_wait = PDC_CLICK_PERIOD; SP->audible = TRUE; - /* If the environment variable PDCURSES_BIOS is set, the DOS int10() + /* If the environment variable PDCURSES_BIOS is set, the DOS int10() BIOS calls are used in place of direct video memory access. */ if (getenv("PDCURSES_BIOS")) @@ -596,7 +596,7 @@ int PDC_resize_screen(int nlines, int ncols) PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n", nlines, ncols)); - /* Trash the stored value of orig_cursor -- it's only good if the + /* Trash the stored value of orig_cursor -- it's only good if the video mode doesn't change */ SP->orig_cursor = 0x0607; diff --git a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcsetsc.c index 2180ef486c..4b2314edf2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/dos/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/dos/pdcsetsc.c @@ -16,9 +16,9 @@ RCSID("$Id: pdcsetsc.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses @@ -59,7 +59,7 @@ int PDC_curs_set(int visibility) /* if scrnmode is not set, some BIOSes hang */ regs.h.ah = 0x01; - regs.h.al = (unsigned char)pdc_scrnmode; + regs.h.al = (unsigned char)pdc_scrnmode; regs.h.ch = (unsigned char)start; regs.h.cl = (unsigned char)end; PDCINT(0x10, regs); diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c index ddc61d9029..1922bb83f0 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcclip.c @@ -15,14 +15,14 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/14 04:24:51 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -30,7 +30,7 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/14 04:24:51 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcdisp.c index 3c1b86e7a2..4f886daf20 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcdisp.c @@ -4,7 +4,7 @@ RCSID("$Id: pdcdisp.c,v 1.49 2008/07/14 04:24:51 wmcbrine Exp $") -/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these +/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these match code page 437 and compatible pages (CP850, CP852, etc.) */ #ifdef CHTYPE_LONG @@ -70,7 +70,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno)); - /* replace the attribute part of the chtype with the + /* replace the attribute part of the chtype with the actual color value for each chtype in the line */ for (j = 0; j < len; j++) diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdckbd.c index 42c24ccd05..df79882ac7 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/os2/pdckbd.c @@ -18,7 +18,7 @@ RCSID("$Id: pdckbd.c,v 1.89 2008/07/14 04:24:51 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -147,12 +147,12 @@ bool PDC_check_key(void) #ifdef EMXVIDEO if (tahead == -1) /* Nothing typed yet */ - { + { tahead = _read_kbd(0, 0, 0); /* Read additional */ - if (tahead == 0) + if (tahead == 0) tahead = _read_kbd(0, 1, 0) << 8; } @@ -189,7 +189,7 @@ bool PDC_check_key(void) return kbhit(); # endif #endif -} +} #ifndef EMXVIDEO @@ -212,8 +212,8 @@ static int _process_mouse_events(void) ((event.fs & move_mask[i]) ? BUTTON_MOVED : 0) | ((event.fs & press_mask[i]) ? BUTTON_PRESSED : 0); - /* PRESS events are sometimes mistakenly reported as MOVE - events. A MOVE should always follow a PRESS, so treat a MOVE + /* PRESS events are sometimes mistakenly reported as MOVE + events. A MOVE should always follow a PRESS, so treat a MOVE immediately after a RELEASE as a PRESS. */ if ((pdc_mouse_status.button[i] == BUTTON_MOVED) && @@ -224,7 +224,7 @@ static int _process_mouse_events(void) if (pdc_mouse_status.button[i] == BUTTON_PRESSED && SP->mouse_wait) { - /* Check for a click -- a PRESS followed immediately by a + /* Check for a click -- a PRESS followed immediately by a release */ if (!mouse_events) @@ -499,10 +499,10 @@ int PDC_mouse_set(void) USHORT mask = ((mbe & (BUTTON1_PRESSED | BUTTON1_CLICKED | BUTTON1_MOVED)) ? 6 : 0) | - ((mbe & (BUTTON3_PRESSED | BUTTON3_CLICKED | + ((mbe & (BUTTON3_PRESSED | BUTTON3_CLICKED | BUTTON3_MOVED)) ? 24 : 0) | - ((mbe & (BUTTON2_PRESSED | BUTTON2_CLICKED | + ((mbe & (BUTTON2_PRESSED | BUTTON2_CLICKED | BUTTON2_MOVED)) ? 96 : 0); MouSetEventMask(&mask, mouse_handle); diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcscrn.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcscrn.c index e2d68faa03..daecb50a44 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcscrn.c +++ b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcscrn.c @@ -260,9 +260,9 @@ static bool _screen_mode_equals(VIOMODEINFO *oldmode) return ((current.cb == oldmode->cb) && (current.fbType == oldmode->fbType) && - (current.color == oldmode->color) && + (current.color == oldmode->color) && (current.col == oldmode->col) && - (current.row == oldmode->row) && + (current.row == oldmode->row) && (current.hres == oldmode->vres) && (current.vres == oldmode->vres)); } diff --git a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcsetsc.c index 2a770bd237..bc28b03aca 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/os2/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/os2/pdcsetsc.c @@ -16,9 +16,9 @@ RCSID("$Id: pdcsetsc.c,v 1.44 2008/07/14 04:24:51 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses 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 diff --git a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcclip.c index 203c975d24..30cb06c980 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcclip.c @@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -32,7 +32,7 @@ RCSID("$Id: pdcclip.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support @@ -118,7 +118,7 @@ int PDC_clearclipboard(void) { PDC_LOG(("PDC_clearclipboard() - called\n")); - if (pdc_SDL_clipboard) + if (pdc_SDL_clipboard) { free(pdc_SDL_clipboard); pdc_SDL_clipboard = NULL; diff --git a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcdisp.c index 3712e6622e..fe463352d6 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcdisp.c @@ -62,7 +62,7 @@ void PDC_update_rects(void) { if (rectcount) { - /* if the maximum number of rects has been reached, we're + /* if the maximum number of rects has been reached, we're probably better off doing a full screen update */ if (rectcount == MAXRECT) @@ -102,7 +102,7 @@ static void _set_attr(chtype ch) if (newfg != foregr) { - SDL_SetPalette(pdc_font, SDL_LOGPAL, + SDL_SetPalette(pdc_font, SDL_LOGPAL, pdc_color + newfg, pdc_flastc, 1); foregr = newfg; } @@ -151,8 +151,8 @@ void PDC_gotoyx(int row, int col) if (!SP->visibility) return; - /* draw a new cursor by overprinting the existing character in - reverse, either the full cell (when visibility == 2) or the + /* draw a new cursor by overprinting the existing character in + reverse, either the full cell (when visibility == 2) or the lowest quarter of it (when visibility == 1) */ ch = curscr->_y[row][col] ^ A_REVERSE; @@ -270,7 +270,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) else if (lastrect.y != dest.y) uprect[rectcount++] = dest; - } + } else uprect[rectcount++] = dest; diff --git a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdckbd.c index 56bf1e470d..f82acd95a0 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdckbd.c @@ -12,7 +12,7 @@ RCSID("$Id: pdckbd.c,v 1.20 2008/07/14 04:24:52 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -111,7 +111,7 @@ bool PDC_check_key(void) Uint32 current = SDL_GetTicks(); int haveevent = SDL_PollEvent(&event); - /* if we have an event, or 30 ms have passed without a screen + /* if we have an event, or 30 ms have passed without a screen update, or the timer has wrapped, update now */ if (haveevent || diff --git a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcsetsc.c index 0df97ab744..6794354fd3 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/sdl1/pdcsetsc.c @@ -16,9 +16,9 @@ RCSID("$Id: pdcsetsc.c,v 1.7 2008/07/14 04:24:52 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses diff --git a/payloads/libpayload/curses/PDCurses-3.4/sdl1/sdltest.c b/payloads/libpayload/curses/PDCurses-3.4/sdl1/sdltest.c index d39533b303..840d15a4eb 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/sdl1/sdltest.c +++ b/payloads/libpayload/curses/PDCurses-3.4/sdl1/sdltest.c @@ -10,7 +10,7 @@ #include <stdlib.h> #include <time.h> -/* You could #include pdcsdl.h, or just add the relevant declarations +/* You could #include pdcsdl.h, or just add the relevant declarations here: */ PDCEX SDL_Surface *pdc_screen; @@ -54,7 +54,7 @@ int main(int argc, char **argv) dest.w = i; dest.h = j; - SDL_FillRect(pdc_screen, &dest, + SDL_FillRect(pdc_screen, &dest, SDL_MapRGB(pdc_screen->format, rand() % 256, rand() % 256, rand() % 256)); } diff --git a/payloads/libpayload/curses/PDCurses-3.4/term.h b/payloads/libpayload/curses/PDCurses-3.4/term.h index ce6bc4fae6..caacbdf7c4 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/term.h +++ b/payloads/libpayload/curses/PDCurses-3.4/term.h @@ -2,9 +2,9 @@ /* $Id: term.h,v 1.16 2008/07/13 16:08:16 wmcbrine Exp $ */ -/* PDCurses doesn't operate with terminfo, but we need these functions for - compatibility, to allow some things (notably, interface libraries for - other languages) to be compiled. Anyone who tries to actually _use_ +/* PDCurses doesn't operate with terminfo, but we need these functions for + compatibility, to allow some things (notably, interface libraries for + other languages) to be compiled. Anyone who tries to actually _use_ them will be disappointed, since they only return ERR. */ #ifndef __PDCURSES_TERM_H__ @@ -46,7 +46,7 @@ char *tgoto(const char *, int, int); int tigetflag(const char *); int tigetnum(const char *); char *tigetstr(const char *); -char *tparm(const char *, long, long, long, long, long, +char *tparm(const char *, long, long, long, long, long, long, long, long, long); int tputs(const char *, int, int (*)(int)); diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcclip.c index 35b6bba514..4feefaee0d 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcclip.c @@ -15,14 +15,14 @@ RCSID("$Id: pdcclip.c,v 1.30 2008/07/14 04:24:52 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -30,7 +30,7 @@ RCSID("$Id: pdcclip.c,v 1.30 2008/07/14 04:24:52 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support @@ -99,7 +99,7 @@ int PDC_setclipboard(const char *contents, long length) if (!OpenClipboard(NULL)) return PDC_CLIP_ACCESS_ERROR; - ptr1 = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, + ptr1 = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, (length + 1) * sizeof(TCHAR)); if (!ptr1) diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcdisp.c index c2ad8142c6..a9c37ebadf 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcdisp.c @@ -15,8 +15,8 @@ chtype acs_map[128] = { A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), - A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), - A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', + A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), + A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', # ifdef PDC_WIDE diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcgetsc.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcgetsc.c index 15f0dc5f80..7c7652362c 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcgetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcgetsc.c @@ -9,7 +9,7 @@ RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $") int PDC_get_cursor_mode(void) { CONSOLE_CURSOR_INFO ci; - + PDC_LOG(("PDC_get_cursor_mode() - called\n")); GetConsoleCursorInfo(pdc_con_out, &ci); diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdckbd.c index 1c5b05b0fe..a23ec956f5 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdckbd.c @@ -12,7 +12,7 @@ RCSID("$Id: pdckbd.c,v 1.115 2008/07/20 20:12:04 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -36,7 +36,7 @@ static int save_press = 0; #define MEV save_ip.Event.MouseEvent /************************************************************************ - * Table for key code translation of function keys in keypad mode * + * Table for key code translation of function keys in keypad mode * * These values are for strict IBM keyboard compatibles only * ************************************************************************/ @@ -181,8 +181,8 @@ static KPTAB kptab[] = {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, @@ -311,11 +311,11 @@ static int _get_key_count(void) } else { - /* Check for diacritics. These are dead keys. Some locales - have modified characters like umlaut-a, which is an "a" - with two dots on it. In some locales you have to press a - special key (the dead key) immediately followed by the - "a" to get a composed umlaut-a. The special key may have + /* Check for diacritics. These are dead keys. Some locales + have modified characters like umlaut-a, which is an "a" + with two dots on it. In some locales you have to press a + special key (the dead key) immediately followed by the + "a" to get a composed umlaut-a. The special key may have a normal meaning with different modifiers. */ if (KEV.uChar.UnicodeChar || !(MapVirtualKey(vk, 2) & 0x80000000)) @@ -637,9 +637,9 @@ void PDC_flushinp(void) int PDC_mouse_set(void) { - /* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear + /* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear all other flags, including the extended flags; - If turning off the mouse: Set QuickEdit Mode to the status it + If turning off the mouse: Set QuickEdit Mode to the status it had on startup, and clear all other flags */ SetConsoleMode(pdc_con_in, SP->_trap_mbe ? diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcscrn.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcscrn.c index b48ddaafd9..12c1ff312e 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcscrn.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcscrn.c @@ -29,8 +29,8 @@ static short curstoreal[16], realtocurs[16] = enum { PDC_RESTORE_NONE, PDC_RESTORE_BUFFER, PDC_RESTORE_WINDOW }; -/* Struct for storing console registry keys, and for use with the - undocumented WM_SETCONSOLEINFO message. Originally by James Brown, +/* Struct for storing console registry keys, and for use with the + undocumented WM_SETCONSOLEINFO message. Originally by James Brown, www.catch22.net. */ static struct @@ -51,13 +51,13 @@ static struct ULONG QuickEdit; ULONG AutoPosition; ULONG InsertMode; - + USHORT ScreenColors; USHORT PopupColors; ULONG HistoryNoDup; ULONG HistoryBufferSize; ULONG NumberOfHistoryBuffers; - + COLORREF ColorTable[16]; ULONG CodePage; @@ -96,8 +96,8 @@ static HWND _find_console_handle(void) #define WM_SETCONSOLEINFO (WM_USER + 201) -/* Wrapper around WM_SETCONSOLEINFO. We need to create the necessary - section (file-mapping) object in the context of the process which +/* Wrapper around WM_SETCONSOLEINFO. We need to create the necessary + section (file-mapping) object in the context of the process which owns the console, before posting the message. Originally by JB. */ static void _set_console_info(void) @@ -126,7 +126,7 @@ static void _set_console_info(void) /* Open the process which "owns" the console */ GetWindowThreadProcessId(console_info.Hwnd, &dwConsoleOwnerPid); - + hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwConsoleOwnerPid); /* Create a SECTION object backed by page-file, then map a view of @@ -178,7 +178,7 @@ static void _init_console_info(void) console_info.AutoPosition = 0x10000; console_info.ScreenColors = SP->orig_back << 4 | SP->orig_fore; console_info.PopupColors = 0xf5; - + console_info.HistoryNoDup = FALSE; console_info.HistoryBufferSize = 50; console_info.NumberOfHistoryBuffers = 4; @@ -247,7 +247,7 @@ void PDC_scr_close(void) origin.X = origin.Y = 0; - if (!WriteConsoleOutput(pdc_con_out, ci_save, orig_scr.dwSize, + if (!WriteConsoleOutput(pdc_con_out, ci_save, orig_scr.dwSize, origin, &rect)) return; } @@ -367,7 +367,7 @@ int PDC_scr_open(int argc, char **argv) if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize, origin, &rect)) { - /* We can't save the complete buffer, so try and save just + /* We can't save the complete buffer, so try and save just the displayed window */ free(ci_save); @@ -392,14 +392,14 @@ int PDC_scr_open(int argc, char **argv) rect.Bottom = orig_scr.srWindow.Bottom; rect.Right = orig_scr.srWindow.Right; - if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize, + if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize, origin, &rect)) { #ifdef PDCDEBUG CHAR LastError[256]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, + GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), LastError, 256, NULL); PDC_LOG(("PDC_scr_open() - %s\n", LastError)); @@ -425,8 +425,8 @@ int PDC_scr_open(int argc, char **argv) return OK; } - /* Calls SetConsoleWindowInfo with the given parameters, but fits them - if a scoll bar shrinks the maximum possible value. The rectangle + /* Calls SetConsoleWindowInfo with the given parameters, but fits them + if a scoll bar shrinks the maximum possible value. The rectangle must at least fit in a half-sized window. */ static BOOL _fit_console_window(HANDLE con_out, CONST SMALL_RECT *rect) diff --git a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcsetsc.c index cfb12315e4..237b356f6e 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/win32/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/win32/pdcsetsc.c @@ -16,9 +16,9 @@ RCSID("$Id: pdcsetsc.c,v 1.40 2008/07/14 04:24:52 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c index 48ea38fd6c..e77d2c78ce 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c @@ -34,19 +34,19 @@ * * ************************************************************************/ -static XtResource resources[] = +static XtResource resources[] = { { XtNhSpace, XtCHSpace, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.h_space), + XtOffset(ScrollBoxWidget, scrollBox.h_space), XtRImmediate, (XtPointer)4 }, { XtNvSpace, XtCVSpace, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.v_space), + XtOffset(ScrollBoxWidget, scrollBox.v_space), XtRImmediate, (XtPointer)4 }, { XtNheightInc, XtCHeightInc, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.increment_height), + XtOffset(ScrollBoxWidget, scrollBox.increment_height), XtRImmediate, (XtPointer)13 }, { XtNwidthInc, XtCWidthInc, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.increment_width), + XtOffset(ScrollBoxWidget, scrollBox.increment_width), XtRImmediate, (XtPointer)7 }, }; @@ -123,7 +123,7 @@ WidgetClass scrollBoxWidgetClass = (WidgetClass)&scrollBoxClassRec; * * ************************************************************************/ -/* Do a layout, either actually assigning positions, or just +/* Do a layout, either actually assigning positions, or just calculating size. */ static void DoLayout(Widget w, Boolean doit) @@ -141,16 +141,16 @@ static void DoLayout(Widget w, Boolean doit) XtAppError(XtWidgetToApplicationContext(w), "ScrollBox: must manage exactly three widgets."); - for (i = 0; i < sbw->composite.num_children; i++) + for (i = 0; i < sbw->composite.num_children; i++) { child = sbw->composite.children[i]; - if (!XtIsManaged(child)) + if (!XtIsManaged(child)) XtAppError(XtWidgetToApplicationContext(w), "ScrollBox: all three widgets must be managed."); } - /* Child one is the main window, two is the vertical scrollbar, + /* Child one is the main window, two is the vertical scrollbar, and three is the horizontal scrollbar. */ wmain = sbw->composite.children[0]; @@ -176,11 +176,11 @@ static void DoLayout(Widget w, Boolean doit) sbw->scrollBox.increment_height) + sbw->scrollBox.increment_height; - vx = wmain->core.x + mw + sbw->scrollBox.h_space + - wmain->core.border_width + vscroll->core.border_width; + vx = wmain->core.x + mw + sbw->scrollBox.h_space + + wmain->core.border_width + vscroll->core.border_width; - hy = wmain->core.y + mh + sbw->scrollBox.v_space + - wmain->core.border_width + hscroll->core.border_width; + hy = wmain->core.y + mh + sbw->scrollBox.v_space + + wmain->core.border_width + hscroll->core.border_width; vh = mh; /* scrollbars are always same length as main window */ hw = mw; @@ -230,12 +230,12 @@ static void RefigureLocations(Widget w) } /* Calculate preferred size. We can't just use the current sizes - of the children, because that calculation would always end up with - our current size. Could query each child, and use that size to - recalculate a size for us, then if it ends up being larger than width - and height passed in, accept bounding box. However, we know our - children and they don't have any particular preferred geometry, - except the bigger the better. Therefore, if the parent suggested a + of the children, because that calculation would always end up with + our current size. Could query each child, and use that size to + recalculate a size for us, then if it ends up being larger than width + and height passed in, accept bounding box. However, we know our + children and they don't have any particular preferred geometry, + except the bigger the better. Therefore, if the parent suggested a size, we'll take it. */ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, @@ -253,9 +253,9 @@ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, /* if proposed size is large enough, accept it. Otherwise, suggest our arbitrary initial size. */ - if (request->request_mode & CWHeight) + if (request->request_mode & CWHeight) { - if (request->height < INITIAL_HEIGHT) + if (request->height < INITIAL_HEIGHT) { result = XtGeometryAlmost; reply_return->height = INITIAL_HEIGHT; @@ -265,9 +265,9 @@ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, result = XtGeometryYes; } - if (request->request_mode & CWWidth) + if (request->request_mode & CWWidth) { - if (request->width < INITIAL_WIDTH) + if (request->width < INITIAL_WIDTH) { result = XtGeometryAlmost; reply_return->width = INITIAL_WIDTH; @@ -305,7 +305,7 @@ static void Initialize(Widget request, Widget new, } -static Boolean SetValues(Widget current, Widget request, Widget new, +static Boolean SetValues(Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args) { ScrollBoxWidget sbwcurrent = (ScrollBoxWidget)current; diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h index 069666da2f..44551386bc 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h @@ -15,9 +15,9 @@ $Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $ */ -/* +/* * scrollBoxP.h - Private definitions for scrollBox widget - * + * */ #ifndef _XORAscrollBoxP_h diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h b/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h index 12b85fa133..e8f7d4079c 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h @@ -2,7 +2,7 @@ /* $Id: compose.h,v 1.3 2008/07/14 04:24:52 wmcbrine Exp $ */ -/* Tables and variables for the built-in compose key system. This file +/* Tables and variables for the built-in compose key system. This file is not included when PDCurses is built with XIM support. */ #define MAX_COMPOSE_CHARS 14 diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h b/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h index 42571180b2..e4b74e3ab4 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h @@ -2,9 +2,9 @@ * * This file is only used with the ncurses test programs. * - * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build - * it), or edit ncurses_testdir appropriately in the Makefile. Configure - * and build PDCurses for X11. (Sorry, other ports won't work yet.) + * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build + * it), or edit ncurses_testdir appropriately in the Makefile. Configure + * and build PDCurses for X11. (Sorry, other ports won't work yet.) * Change to this directory, and: * * "make ncurses_tests" to start. @@ -40,7 +40,7 @@ # define USE_WIDEC_SUPPORT 1 #endif -/* Fool ncurses.c so it gives us all the tests, and doesn't redefine +/* Fool ncurses.c so it gives us all the tests, and doesn't redefine ACS_ chars */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c index 1a3ce92a2d..bba080f3a2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c @@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -32,7 +32,7 @@ RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c index 3700edb558..a22e944e81 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c @@ -51,8 +51,8 @@ chtype acs_map[128] = 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, # else - A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), - A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25), + A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), + A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), A(29), A(30), 0xb7, # endif diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c index 30c37a87c1..2f85ba062d 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c @@ -12,7 +12,7 @@ RCSID("$Id: pdckbd.c,v 1.62 2008/07/14 04:24:52 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -32,7 +32,7 @@ bool PDC_check_key(void) FD_ZERO(&xc_readfds); FD_SET(xc_key_sock, &xc_readfds); - if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, + if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, NULL, &socket_timeout)) < 0) XCursesExitCursesProcess(3, "child - exiting from " "PDC_check_key select failed"); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c index 07b1a042ce..b84b1c63c2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c @@ -71,7 +71,7 @@ int PDC_resize_screen(int nlines, int ncols) XCursesCOLS = SP->cols; PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d SP->lines %d " - "SP->cols %d\n", XCLOGMSG, shmid_Xcurscr, + "SP->cols %d\n", XCLOGMSG, shmid_Xcurscr, shmkey_Xcurscr, SP->lines, SP->cols)); Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c index 395060e867..bdcc856c00 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c @@ -18,9 +18,9 @@ RCSID("$Id: pdcsetsc.c,v 1.33 2008/07/14 04:24:52 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c index 1e8d0d163c..370cedb0a7 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c @@ -99,7 +99,7 @@ int XC_read_socket(int sock_num, void *buf, int len) SP->resized = FALSE; memcpy(buf, &rc, sizeof(int)); - + return 0; } @@ -178,7 +178,7 @@ static int _setup_curses(void) if (wait_value != CURSES_CHILD) return ERR; - /* Set LINES and COLS now so that the size of the shared memory + /* Set LINES and COLS now so that the size of the shared memory segment can be allocated */ if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700)) < 0) @@ -226,13 +226,13 @@ int XCursesInitscr(int argc, char *argv[]) XC_LOG(("XCursesInitscr() - called\n")); shmkeySP = getpid(); - + if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_display_sockets) < 0) { fprintf(stderr, "ERROR: cannot create display socketpair\n"); return ERR; } - + if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_key_sockets) < 0) { fprintf(stderr, "ERROR: cannot create key socketpair\n"); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h index 0b66c8809e..dc7b9aea34 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h @@ -178,10 +178,10 @@ void XC_say(const char *msg); enum { - CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION, - CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR, - CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, - CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR, + CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION, + CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR, + CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, + CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR, CURSES_EXIT }; diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c b/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c index 97d44985e5..69c3199b54 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c @@ -377,8 +377,8 @@ static XrmOptionDescRec options[] = CCOLOR(Black), CCOLOR(Red), CCOLOR(Green), CCOLOR(Yellow), CCOLOR(Blue), CCOLOR(Magenta), CCOLOR(Cyan), CCOLOR(White), - CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen), - CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta), + CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen), + CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta), CCOLOR(BoldCyan), CCOLOR(BoldWhite) }; @@ -533,7 +533,7 @@ RETSIGTYPE XCursesSigwinchHandler(int signo) PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n", XCLOGMSG, signo)); - /* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de + /* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de 02-Feb-1999 */ SP->resized += 1; @@ -545,13 +545,13 @@ RETSIGTYPE XCursesSigwinchHandler(int signo) #endif } -/* Convert character positions x and y to pixel positions, stored in +/* Convert character positions x and y to pixel positions, stored in xpos and ypos */ static void _make_xy(int x, int y, int *xpos, int *ypos) { *xpos = (x * font_width) + xc_app_data.borderWidth; - *ypos = xc_app_data.normalFont->ascent + (y * font_height) + + *ypos = xc_app_data.normalFont->ascent + (y * font_height) + xc_app_data.borderWidth; } @@ -953,7 +953,7 @@ static void _refresh_screen(void) start_col = (int)*(Xcurscr + XCURSCR_START_OFF + row); _display_text((const chtype *)(Xcurscr + XCURSCR_Y_OFF(row) + - (start_col * sizeof(chtype))), row, start_col, + (start_col * sizeof(chtype))), row, start_col, num_cols, FALSE); *(Xcurscr + XCURSCR_LENGTH_OFF + row) = 0; @@ -992,8 +992,8 @@ static void _handle_nonmaskable(Widget w, XtPointer client_data, XEvent *event, { XC_LOG(("ClientMessage received\n")); - /* This code used to include handling of WM_SAVE_YOURSELF, but - it resulted in continual failure of THE on my Toshiba laptop. + /* This code used to include handling of WM_SAVE_YOURSELF, but + it resulted in continual failure of THE on my Toshiba laptop. Removed on 3-3-2001. Now only exits on WM_DELETE_WINDOW. */ if ((Atom)client_event->data.s[0] == wm_atom[0]) @@ -1028,12 +1028,12 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, if (event->type == KeyRelease) { - /* The keysym value was set by a previous call to this function + /* The keysym value was set by a previous call to this function with a KeyPress event (or reset by the mouse event handler) */ if (SP->return_key_modifiers && #ifndef PDC_XIM - keysym != compose_key && + keysym != compose_key && #endif IsModifierKey(keysym)) { @@ -1086,7 +1086,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, #ifndef PDC_XIM - /* Check if the key just pressed is the user-specified compose + /* Check if the key just pressed is the user-specified compose key; if it is, set the compose state and exit. */ if (keysym == compose_key) @@ -1105,16 +1105,16 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, SP->visibility = save_visibility; _make_xy(SP->curscol, SP->cursrow, &xpos, &ypos); - ch = (chtype *)(Xcurscr + XCURSCR_Y_OFF(SP->cursrow) + + ch = (chtype *)(Xcurscr + XCURSCR_Y_OFF(SP->cursrow) + (SP->curscol * sizeof(chtype))); _set_cursor_color(ch, &fore, &back); XSetForeground(XCURSESDISPLAY, rect_cursor_gc, colors[back]); - XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, - xpos + 1, ypos - font_height + - xc_app_data.normalFont->descent + 1, + XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, + xpos + 1, ypos - font_height + + xc_app_data.normalFont->descent + 1, font_width - 2, font_height - 2); compose_state = STATE_COMPOSE; @@ -1138,7 +1138,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, key = buffer[0]; compose_index = -1; - + for (i = 0; i < (int)strlen(compose_chars); i++) if (compose_chars[i] == key) { @@ -1193,7 +1193,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, compose_state = STATE_NORMAL; compose_index = 0; - + _redraw_cursor(); return; @@ -1294,7 +1294,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, } } - /* After all that, send the key back to the application if is + /* After all that, send the key back to the application if is NOT zero. */ if (key) @@ -1316,7 +1316,7 @@ static void XCursesHandleString(Widget w, XEvent *event, String *params, ptr = (unsigned char *)*params; if (ptr[0] == '0' && ptr[1] == 'x' && ptr[2] != '\0') - { + { unsigned char c; unsigned long total = 0; @@ -1376,7 +1376,7 @@ static void _paste_utf8(Widget w, XtPointer event, Atom *selection, Atom *type, if (!*type || !*length) { - XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string, + XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string, event, ((XButtonEvent *)event)->time); return; } @@ -1421,14 +1421,14 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target, if (*target == XA_TARGETS(XtDisplay(topLevel))) { - XSelectionRequestEvent *req = XtGetSelectionRequest(w, + XSelectionRequestEvent *req = XtGetSelectionRequest(w, *selection, (XtRequestId)NULL); Atom *targetP; XPointer std_targets; unsigned long std_length; - XmuConvertStandardSelection(topLevel, req->time, selection, + XmuConvertStandardSelection(topLevel, req->time, selection, target, type_return, &std_targets, &std_length, format_return); @@ -1475,7 +1475,7 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target, return True; } else - return XmuConvertStandardSelection(topLevel, CurrentTime, + return XmuConvertStandardSelection(topLevel, CurrentTime, selection, target, type_return, (XPointer*)value_return, length_return, format_return); } @@ -1544,7 +1544,7 @@ static void _selection_off(void) _display_screen(); - selection_start_x = selection_start_y = selection_end_x = + selection_start_x = selection_start_y = selection_end_x = selection_end_y = 0; mouse_selection = FALSE; @@ -1560,8 +1560,8 @@ static void _selection_on(int x, int y) static void _selection_extend(int x, int y) { - int temp, current_start, current_end, current_start_x, - current_end_x, current_start_y, current_end_y, new_start, + int temp, current_start, current_end, current_start_x, + current_end_x, current_start_y, current_end_y, new_start, new_end, new_start_x, new_end_x, new_start_y, new_end_y; XC_LOG(("_selection_extend() - called\n")); @@ -1591,7 +1591,7 @@ static void _selection_extend(int x, int y) current_start_y = selection_start_y; } - /* Now we have the current selection as a linear expression. + /* Now we have the current selection as a linear expression. Convert the new position to a linear expression. */ selection_end_x = x; @@ -1621,25 +1621,25 @@ static void _selection_extend(int x, int y) } if (new_end > current_end) - _show_selection(current_end_x, current_end_y, new_end_x, + _show_selection(current_end_x, current_end_y, new_end_x, new_end_y, TRUE); else if (new_end < current_end) - _show_selection(new_end_x, new_end_y, current_end_x, + _show_selection(new_end_x, new_end_y, current_end_x, current_end_y, FALSE); else if (new_start < current_start) - _show_selection(new_start_x, new_start_y, current_start_x, + _show_selection(new_start_x, new_start_y, current_start_x, current_start_y, TRUE); else if (new_start > current_start) - _show_selection(current_start_x, current_start_y, + _show_selection(current_start_x, current_start_y, new_start_x, new_start_y, FALSE); else - _show_selection(current_start_x, current_start_y, + _show_selection(current_start_x, current_start_y, new_start_x, new_start_y, TRUE); } static void _selection_set(void) { - int i, j, start, end, start_x, end_x, start_y, end_y, num_cols, + int i, j, start, end, start_x, end_x, start_y, end_y, num_cols, start_col, row, num_chars, ch, last_nonblank, length, newlen; chtype *ptr = NULL; @@ -1766,7 +1766,7 @@ static void _display_cursor(int old_row, int old_x, int new_row, int new_x) PDC_LOG(("%s:_display_cursor() - draw char at row: %d col %d\n", XCLOGMSG, old_row, old_x)); - /* if the cursor position is outside the boundary of the screen, + /* if the cursor position is outside the boundary of the screen, ignore the request */ if (old_row >= XCursesLINES || old_x >= COLS || @@ -1799,7 +1799,7 @@ static void _display_cursor(int old_row, int old_x, int new_row, int new_x) for (i = 1; i <= SP->visibility; i++) XDrawLine(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, xpos + i, ypos - xc_app_data.normalFont->ascent, - xpos + i, ypos - xc_app_data.normalFont->ascent + + xpos + i, ypos - xc_app_data.normalFont->ascent + font_height - 1); } else @@ -1869,7 +1869,7 @@ static void _handle_enter_leave(Widget w, XtPointer client_data, window_entered = FALSE; - /* Display the cursor so it stays on while the window is + /* Display the cursor so it stays on while the window is not current */ _redraw_cursor(); @@ -1972,7 +1972,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, memset(&Mouse_status, 0, sizeof(Mouse_status)); - Mouse_status.changes = (button_no == 5) ? + Mouse_status.changes = (button_no == 5) ? PDC_MOUSE_WHEEL_DOWN : PDC_MOUSE_WHEEL_UP; MOUSE_X_POS = MOUSE_Y_POS = -1; @@ -2022,7 +2022,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, case MotionNotify: MOUSE_LOG(("\nMotionNotify: y: %d x: %d Width: %d " - "Height: %d\n", event->xbutton.y, event->xbutton.x, + "Height: %d\n", event->xbutton.y, event->xbutton.x, font_width, font_height)); MOUSE_X_POS = (event->xbutton.x - xc_app_data.borderWidth) / @@ -2039,12 +2039,12 @@ static void XCursesButton(Widget w, XEvent *event, String *params, else _selection_off(); - /* Throw away mouse movements if they are in the same character - position as the last mouse event, or if we are currently in + /* Throw away mouse movements if they are in the same character + position as the last mouse event, or if we are currently in the middle of a double click event. */ if ((MOUSE_X_POS == save_mouse_status.x && - MOUSE_Y_POS == save_mouse_status.y) || + MOUSE_Y_POS == save_mouse_status.y) || save_mouse_status.button[button_no - 1] == BUTTON_DOUBLE_CLICKED) { send_key = FALSE; @@ -2070,7 +2070,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, if (!handle_real_release) { if ((event->xbutton.time - last_button_press_time) < - SP->mouse_wait && + SP->mouse_wait && (event->xbutton.time != last_button_press_time)) { /* The "real" release was shorter than usleep() time; @@ -2086,7 +2086,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, { send_key = FALSE; - if (XtOwnSelection(topLevel, XA_PRIMARY, + if (XtOwnSelection(topLevel, XA_PRIMARY, event->xbutton.time, _convert_proc, _lose_ownership, NULL) == False) _selection_off(); @@ -2102,8 +2102,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params, } else { - /* Button release longer than usleep() time; - therefore generate a press and wait for the real + /* Button release longer than usleep() time; + therefore generate a press and wait for the real release to occur later. */ MOUSE_LOG(("Generated Release at: %ld - " @@ -2138,8 +2138,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params, { send_key = FALSE; - if (XtOwnSelection(topLevel, XA_PRIMARY, - event->xbutton.time, _convert_proc, + if (XtOwnSelection(topLevel, XA_PRIMARY, + event->xbutton.time, _convert_proc, _lose_ownership, NULL) == False) _selection_off(); @@ -2174,7 +2174,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, BUTTON_STATUS(button_no), Mouse_status.changes)); MOUSE_LOG(("Send: %d Button1: %x Button2: %x Button3: %x %d %d\n", - send_key, BUTTON_STATUS(1), BUTTON_STATUS(2), + send_key, BUTTON_STATUS(1), BUTTON_STATUS(2), BUTTON_STATUS(3), XCursesLINES, XCursesCOLS)); if (!send_key || MOUSE_X_POS < 0 || MOUSE_X_POS >= XCursesCOLS || @@ -2252,7 +2252,7 @@ static void _thumb_up_down(Widget w, XtPointer client_data, double viewport_y = (double)SP->sb_viewport_y; int cur_y = SP->sb_cur_y; - /* If the size of the viewport is > overall area simply return, + /* If the size of the viewport is > overall area simply return, as no scrolling is permitted. */ if (SP->sb_viewport_y >= SP->sb_total_y) @@ -2285,7 +2285,7 @@ static void _thumb_left_right(Widget w, XtPointer client_data, XawScrollbarSetThumb(w, (double)(cur_x / total_x), (double)(viewport_x / total_x)); - + _send_key_to_curses(KEY_SR, NULL, TRUE); } @@ -2340,7 +2340,7 @@ static void _exit_process(int rc, int sig, char *msg) static void _resize(void) { - short save_atrtab[PDC_COLOR_PAIRS * 2]; + short save_atrtab[PDC_COLOR_PAIRS * 2]; after_first_curses_request = FALSE; @@ -2369,11 +2369,11 @@ static void _resize(void) if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) - { + { perror("Cannot allocate shared memory for curscr"); _exit_process(4, SIGKILL, "exiting from _process_curses_requests"); - } + } Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); memset(Xcurscr, 0, SP->XcurscrSize); @@ -2385,7 +2385,7 @@ static void _resize(void) static void _set_title(void) { - char title[1024]; /* big enough for window title */ + char title[1024]; /* big enough for window title */ int pos; if ((XC_read_socket(xc_display_sock, &pos, sizeof(int)) < 0) || @@ -2452,7 +2452,7 @@ static void _get_selection(Widget w, XtPointer data, Atom *selection, } else { - /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then + /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then contents */ if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) < 0) @@ -2515,12 +2515,12 @@ static void _get_selection_utf8(Widget w, XtPointer data, Atom *selection, wcontents[i] = 0; len = i; - /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then + /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then contents */ if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) >= 0) if (XC_write_display_socket_int(len) >= 0) - if (XC_write_socket(xc_display_sock, + if (XC_write_socket(xc_display_sock, wcontents, len * sizeof(wchar_t)) >= 0) { free(wcontents); @@ -2598,40 +2598,40 @@ static void _resume_curses(void) /* The curses process sent us a message */ static void _process_curses_requests(XtPointer client_data, int *fid, - XtInputId *id) -{ + XtInputId *id) +{ struct timeval socket_timeout = {0}; int s; int old_row, new_row; int old_x, new_x; int pos, num_cols; - char buf[12]; /* big enough for 2 integers */ + char buf[12]; /* big enough for 2 integers */ XC_LOG(("_process_curses_requests() - called\n")); - if (!received_map_notify) - return; + if (!received_map_notify) + return; - FD_ZERO(&xc_readfds); - FD_SET(xc_display_sock, &xc_readfds); + FD_ZERO(&xc_readfds); + FD_SET(xc_display_sock, &xc_readfds); - if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, + if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, NULL, &socket_timeout)) < 0) _exit_process(2, SIGKILL, "exiting from _process_curses_requests" " - select failed"); - if (!s) /* no requests pending - should never happen! */ - return; + if (!s) /* no requests pending - should never happen! */ + return; - if (FD_ISSET(xc_display_sock, &xc_readfds)) - { + if (FD_ISSET(xc_display_sock, &xc_readfds)) + { /* read first integer to determine total message has been received */ XC_LOG(("_process_curses_requests() - before XC_read_socket()\n")); - if (XC_read_socket(xc_display_sock, &num_cols, sizeof(int)) < 0) + if (XC_read_socket(xc_display_sock, &num_cols, sizeof(int)) < 0) _exit_process(3, SIGKILL, "exiting from _process_curses_requests" " - first read"); @@ -2639,8 +2639,8 @@ static void _process_curses_requests(XtPointer client_data, int *fid, after_first_curses_request = TRUE; - switch(num_cols) - { + switch(num_cols) + { case CURSES_EXIT: /* request from curses to stop */ XC_LOG(("CURSES_EXIT received from child\n")); _exit_process(0, 0, "XCursesProcess requested to exit by child"); @@ -2651,11 +2651,11 @@ static void _process_curses_requests(XtPointer client_data, int *fid, XBell(XCURSESDISPLAY, 50); break; - /* request from curses to confirm completion of display */ + /* request from curses to confirm completion of display */ case CURSES_REFRESH: XC_LOG(("CURSES_REFRESH received from child\n")); - _refresh_screen(); + _refresh_screen(); _resume_curses(); break; @@ -2670,7 +2670,7 @@ static void _process_curses_requests(XtPointer client_data, int *fid, _exit_process(5, SIGKILL, "exiting from CURSES_CURSOR " "_process_curses_requests"); - memcpy(&pos, buf, sizeof(int)); + memcpy(&pos, buf, sizeof(int)); old_row = pos & 0xFF; old_x = pos >> 8; @@ -2690,9 +2690,9 @@ static void _process_curses_requests(XtPointer client_data, int *fid, cursor will stay solid. */ if (window_entered) - { - if (visible_cursor) - { + { + if (visible_cursor) + { /* Cursor currently ON, turn it off */ int save_visibility = SP->visibility; @@ -2701,16 +2701,16 @@ static void _process_curses_requests(XtPointer client_data, int *fid, SP->visibility = save_visibility; visible_cursor = FALSE; } - else - { - /* Cursor currently OFF, turn it on */ + else + { + /* Cursor currently OFF, turn it on */ _redraw_cursor(); visible_cursor = TRUE; - } - } + } + } - break; + break; case CURSES_TITLE: XC_LOG(("CURSES_TITLE received from child\n")); @@ -2720,8 +2720,8 @@ static void _process_curses_requests(XtPointer client_data, int *fid, case CURSES_RESIZE: XC_LOG(("CURSES_RESIZE received from child\n")); _resize(); - _resume_curses(); - break; + _resume_curses(); + break; case CURSES_GET_SELECTION: XC_LOG(("CURSES_GET_SELECTION received from child\n")); @@ -2762,13 +2762,13 @@ static void _process_curses_requests(XtPointer client_data, int *fid, _resume_curses(); break; - default: + default: PDC_LOG(("%s:Unknown request %d\n", XCLOGMSG, num_cols)); - } - } -} + } + } +} -static void _handle_structure_notify(Widget w, XtPointer client_data, +static void _handle_structure_notify(Widget w, XtPointer client_data, XEvent *event, Boolean *unused) { XC_LOG(("_handle_structure_notify() - called\n")); @@ -2922,10 +2922,10 @@ int XCursesSetupX(int argc, char *argv[]) /* Check application resource values here */ - font_width = xc_app_data.normalFont->max_bounds.rbearing - + font_width = xc_app_data.normalFont->max_bounds.rbearing - xc_app_data.normalFont->min_bounds.lbearing; - font_height = xc_app_data.normalFont->max_bounds.ascent + + font_height = xc_app_data.normalFont->max_bounds.ascent + xc_app_data.normalFont->max_bounds.descent; font_ascent = xc_app_data.normalFont->max_bounds.ascent; @@ -2938,7 +2938,7 @@ int XCursesSetupX(int argc, char *argv[]) xc_app_data.italicFont->max_bounds.rbearing - xc_app_data.italicFont->min_bounds.lbearing || font_height != - xc_app_data.italicFont->max_bounds.ascent + + xc_app_data.italicFont->max_bounds.ascent + xc_app_data.italicFont->max_bounds.descent; /* Calculate size of display window */ @@ -2978,28 +2978,28 @@ int XCursesSetupX(int argc, char *argv[]) if (xc_app_data.scrollbarWidth && sb_started) { - scrollBox = XtVaCreateManagedWidget(program_name, - scrollBoxWidgetClass, topLevel, XtNwidth, - window_width + xc_app_data.scrollbarWidth, + scrollBox = XtVaCreateManagedWidget(program_name, + scrollBoxWidgetClass, topLevel, XtNwidth, + window_width + xc_app_data.scrollbarWidth, XtNheight, window_height + xc_app_data.scrollbarWidth, XtNwidthInc, font_width, XtNheightInc, font_height, NULL); - drawing = XtVaCreateManagedWidget(program_name, - boxWidgetClass, scrollBox, XtNwidth, - window_width, XtNheight, window_height, XtNwidthInc, + drawing = XtVaCreateManagedWidget(program_name, + boxWidgetClass, scrollBox, XtNwidth, + window_width, XtNheight, window_height, XtNwidthInc, font_width, XtNheightInc, font_height, NULL); - scrollVert = XtVaCreateManagedWidget("scrollVert", - scrollbarWidgetClass, scrollBox, XtNorientation, - XtorientVertical, XtNheight, window_height, XtNwidth, + scrollVert = XtVaCreateManagedWidget("scrollVert", + scrollbarWidgetClass, scrollBox, XtNorientation, + XtorientVertical, XtNheight, window_height, XtNwidth, xc_app_data.scrollbarWidth, NULL); XtAddCallback(scrollVert, XtNscrollProc, _scroll_up_down, drawing); XtAddCallback(scrollVert, XtNjumpProc, _thumb_up_down, drawing); - scrollHoriz = XtVaCreateManagedWidget("scrollHoriz", - scrollbarWidgetClass, scrollBox, XtNorientation, - XtorientHorizontal, XtNwidth, window_width, XtNheight, + scrollHoriz = XtVaCreateManagedWidget("scrollHoriz", + scrollbarWidgetClass, scrollBox, XtNorientation, + XtorientHorizontal, XtNwidth, window_width, XtNheight, xc_app_data.scrollbarWidth, NULL); XtAddCallback(scrollHoriz, XtNscrollProc, _scroll_left_right, drawing); @@ -3036,7 +3036,7 @@ int XCursesSetupX(int argc, char *argv[]) LINES = XCursesLINES; COLS = XCursesCOLS; - if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, + if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) { perror("Cannot allocate shared memory for SCREEN"); @@ -3055,7 +3055,7 @@ int XCursesSetupX(int argc, char *argv[]) PDC_LOG(("%s:SHM size for curscr %d\n", XCLOGMSG, SP->XcurscrSize)); - if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + + if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) { perror("Cannot allocate shared memory for curscr"); @@ -3066,7 +3066,7 @@ int XCursesSetupX(int argc, char *argv[]) } Xcurscr = (unsigned char *)shmat(shmid_Xcurscr, 0, 0); - memset(Xcurscr, 0, SP->XcurscrSize); + memset(Xcurscr, 0, SP->XcurscrSize); xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF); PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d LINES %d COLS %d\n", @@ -3075,16 +3075,16 @@ int XCursesSetupX(int argc, char *argv[]) /* Add Event handlers to the drawing widget */ XtAddEventHandler(drawing, ExposureMask, False, _handle_expose, NULL); - XtAddEventHandler(drawing, StructureNotifyMask, False, + XtAddEventHandler(drawing, StructureNotifyMask, False, _handle_structure_notify, NULL); XtAddEventHandler(drawing, EnterWindowMask | LeaveWindowMask, False, _handle_enter_leave, NULL); XtAddEventHandler(topLevel, 0, True, _handle_nonmaskable, NULL); - /* Add input handler from xc_display_sock (requests from curses + /* Add input handler from xc_display_sock (requests from curses program) */ - XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask, + XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask, _process_curses_requests, NULL); /* If there is a cursorBlink resource, start the Timeout event */ @@ -3093,8 +3093,8 @@ int XCursesSetupX(int argc, char *argv[]) XtAppAddTimeOut(app_context, xc_app_data.cursorBlinkRate, _blink_cursor, NULL); - /* Leave telling the curses process that it can start to here so - that when the curses process makes a request, the Xcurses + /* Leave telling the curses process that it can start to here so + that when the curses process makes a request, the Xcurses process can service the request. */ XC_write_display_socket_int(CURSES_CHILD); @@ -3114,7 +3114,7 @@ int XCursesSetupX(int argc, char *argv[]) _get_gc(&normal_gc, xc_app_data.normalFont, COLOR_WHITE, COLOR_BLACK); - _get_gc(&italic_gc, italic_font_valid ? xc_app_data.italicFont : + _get_gc(&italic_gc, italic_font_valid ? xc_app_data.italicFont : xc_app_data.normalFont, COLOR_WHITE, COLOR_BLACK); _get_gc(&block_cursor_gc, xc_app_data.normalFont, diff --git a/payloads/libpayload/curses/form/fld_ftchoice.c b/payloads/libpayload/curses/form/fld_ftchoice.c index 3aac5be2b1..e628171bef 100644 --- a/payloads/libpayload/curses/form/fld_ftchoice.c +++ b/payloads/libpayload/curses/form/fld_ftchoice.c @@ -35,7 +35,7 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.12 2010/01/23 21:14:35 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_fieldtype_choice( | FIELDTYPE *typ, | bool (* const next_choice)(FIELD *,const void *), diff --git a/payloads/libpayload/curses/form/fld_ftlink.c b/payloads/libpayload/curses/form/fld_ftlink.c index c2cd251f42..aa5862f949 100644 --- a/payloads/libpayload/curses/form/fld_ftlink.c +++ b/payloads/libpayload/curses/form/fld_ftlink.c @@ -35,14 +35,14 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.14 2010/01/23 21:14:35 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : FIELDTYPE *link_fieldtype( | FIELDTYPE *type1, | FIELDTYPE *type2) -| +| | Description : Create a new fieldtype built from the two given types. | They are connected by an logical 'OR'. -| If an error occurs, errno is set to +| If an error occurs, errno is set to | E_BAD_ARGUMENT - invalid arguments | E_SYSTEM_ERROR - system error (no memory) | diff --git a/payloads/libpayload/curses/form/fld_info.c b/payloads/libpayload/curses/form/fld_info.c index 13fe8e72a0..da95e652fa 100644 --- a/payloads/libpayload/curses/form/fld_info.c +++ b/payloads/libpayload/curses/form/fld_info.c @@ -35,12 +35,12 @@ MODULE_ID("$Id: fld_info.c,v 1.11 2010/01/23 21:14:35 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_info(const FIELD *field, | int *rows, int *cols, | int *frow, int *fcol, | int *nrow, int *nbuf) -| +| | Description : Retrieve infos about the fields creation parameters. | | Return Values : E_OK - success @@ -77,11 +77,11 @@ field_info(const FIELD *field, } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int dynamic_field_info(const FIELD *field, | int *drows, int *dcols, | int *maxgrow) -| +| | Description : Retrieve informations about a dynamic fields current | dynamic parameters. | diff --git a/payloads/libpayload/curses/form/fld_just.c b/payloads/libpayload/curses/form/fld_just.c index 58a1750cc0..a87ea70b18 100644 --- a/payloads/libpayload/curses/form/fld_just.c +++ b/payloads/libpayload/curses/form/fld_just.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_just(FIELD *field, int just) -| +| | Description : Set the fields type of justification. | | Return Values : E_OK - success @@ -69,9 +69,9 @@ set_field_just(FIELD *field, int just) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_just( const FIELD *field ) -| +| | Description : Retrieve the fields type of justification | | Return Values : The justification type. diff --git a/payloads/libpayload/curses/form/fld_link.c b/payloads/libpayload/curses/form/fld_link.c index 18103bee19..31b9da0caa 100644 --- a/payloads/libpayload/curses/form/fld_link.c +++ b/payloads/libpayload/curses/form/fld_link.c @@ -35,14 +35,14 @@ MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform -| Function : FIELD *link_field(FIELD *field, int frow, int fcol) -| +| Facility : libnform +| Function : FIELD *link_field(FIELD *field, int frow, int fcol) +| | Description : Duplicates the field at the specified position. The | new field shares its buffers with the original one, | the attributes are independent. | If an error occurs, errno is set to -| +| | E_BAD_ARGUMENT - invalid argument | E_SYSTEM_ERROR - system error | diff --git a/payloads/libpayload/curses/form/fld_max.c b/payloads/libpayload/curses/form/fld_max.c index 5ce918e4e0..91d9819552 100644 --- a/payloads/libpayload/curses/form/fld_max.c +++ b/payloads/libpayload/curses/form/fld_max.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_max_field(FIELD *field, int maxgrow) -| +| | Description : Set the maximum growth for a dynamic field. If maxgrow=0 | the field may grow to any possible size. | diff --git a/payloads/libpayload/curses/form/fld_move.c b/payloads/libpayload/curses/form/fld_move.c index dfba22d72a..24652eaa0c 100644 --- a/payloads/libpayload/curses/form/fld_move.c +++ b/payloads/libpayload/curses/form/fld_move.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int move_field(FIELD *field,int frow, int fcol) -| +| | Description : Moves the disconnected field to the new location in | the forms subwindow. | diff --git a/payloads/libpayload/curses/form/fld_opts.c b/payloads/libpayload/curses/form/fld_opts.c index a52f1e2ad8..4e92bd9686 100644 --- a/payloads/libpayload/curses/form/fld_opts.c +++ b/payloads/libpayload/curses/form/fld_opts.c @@ -39,9 +39,9 @@ MODULE_ID("$Id: fld_opts.c,v 1.12 2010/01/23 21:14:36 tom Exp $") --------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_opts(FIELD *field, Field_Options opts) -| +| | Description : Turns on the named options for this field and turns | off all the remaining options. | @@ -64,9 +64,9 @@ set_field_opts(FIELD *field, Field_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : Field_Options field_opts(const FIELD *field) -| +| | Description : Retrieve the fields options. | | Return Values : The options. @@ -80,10 +80,10 @@ field_opts(const FIELD *field) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_opts_on(FIELD *field, Field_Options opts) -| -| Description : Turns on the named options for this field and all the +| +| Description : Turns on the named options for this field and all the | remaining options are unchanged. | | Return Values : E_OK - success @@ -108,10 +108,10 @@ field_opts_on(FIELD *field, Field_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_opts_off(FIELD *field, Field_Options opts) -| -| Description : Turns off the named options for this field and all the +| +| Description : Turns off the named options for this field and all the | remaining options are unchanged. | | Return Values : E_OK - success diff --git a/payloads/libpayload/curses/form/fld_pad.c b/payloads/libpayload/curses/form/fld_pad.c index 4f8ff1f54f..37df703148 100644 --- a/payloads/libpayload/curses/form/fld_pad.c +++ b/payloads/libpayload/curses/form/fld_pad.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_pad.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_pad(FIELD *field, int ch) -| +| | Description : Set the pad character used to fill the field. This must | be a printable character. | @@ -67,9 +67,9 @@ set_field_pad(FIELD *field, int ch) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_pad(const FIELD *field) -| +| | Description : Retrieve the fields pad character. | | Return Values : The pad character. diff --git a/payloads/libpayload/curses/form/fld_page.c b/payloads/libpayload/curses/form/fld_page.c index e4d18c556b..67f48a1151 100644 --- a/payloads/libpayload/curses/form/fld_page.c +++ b/payloads/libpayload/curses/form/fld_page.c @@ -35,10 +35,10 @@ MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_new_page(FIELD *field, bool new_page_flag) -| -| Description : Marks the field as the beginning of a new page of +| +| Description : Marks the field as the beginning of a new page of | the form. | | Return Values : E_OK - success @@ -62,9 +62,9 @@ set_new_page(FIELD *field, bool new_page_flag) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool new_page(const FIELD *field) -| +| | Description : Retrieve the info whether or not the field starts a | new page on the form. | diff --git a/payloads/libpayload/curses/form/fld_stat.c b/payloads/libpayload/curses/form/fld_stat.c index 46f89e6748..bc5ba5069b 100644 --- a/payloads/libpayload/curses/form/fld_stat.c +++ b/payloads/libpayload/curses/form/fld_stat.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_status(FIELD *field, bool status) -| +| | Description : Set or clear the 'changed' indication flag for that | fields primary buffer. | @@ -59,11 +59,11 @@ set_field_status(FIELD *field, bool status) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool field_status(const FIELD *field) -| +| | Description : Retrieve the value of the 'changed' indication flag -| for that fields primary buffer. +| for that fields primary buffer. | | Return Values : TRUE - buffer has been changed | FALSE - buffer has not been changed diff --git a/payloads/libpayload/curses/form/fld_type.c b/payloads/libpayload/curses/form/fld_type.c index 0b35b7eb9e..1117a562a0 100644 --- a/payloads/libpayload/curses/form/fld_type.c +++ b/payloads/libpayload/curses/form/fld_type.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_type.c,v 1.16 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_type(FIELD *field, FIELDTYPE *type,...) -| +| | Description : Associate the specified fieldtype with the field. | Certain field types take additional arguments. Look | at the spec of the field types ! @@ -80,9 +80,9 @@ set_field_type(FIELD *field, FIELDTYPE *type,...) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : FIELDTYPE *field_type(const FIELD *field) -| +| | Description : Retrieve the associated fieldtype for this field. | | Return Values : Pointer to fieldtype of NULL if none is defined. diff --git a/payloads/libpayload/curses/form/fld_user.c b/payloads/libpayload/curses/form/fld_user.c index 30bcf7a415..075580be50 100644 --- a/payloads/libpayload/curses/form/fld_user.c +++ b/payloads/libpayload/curses/form/fld_user.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: fld_user.c,v 1.16 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_userptr(FIELD *field, void *usrptr) -| +| | Description : Set the pointer that is reserved in any field to store | application relevant informations | @@ -53,9 +53,9 @@ set_field_userptr(FIELD *field, void *usrptr) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : void *field_userptr(const FIELD *field) -| +| | Description : Return the pointer that is reserved in any field to | store application relevant informations. | diff --git a/payloads/libpayload/curses/form/form.priv.h b/payloads/libpayload/curses/form/form.priv.h index 91dc7a8285..bb8b0f727c 100644 --- a/payloads/libpayload/curses/form/form.priv.h +++ b/payloads/libpayload/curses/form/form.priv.h @@ -190,12 +190,12 @@ extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); extern NCURSES_EXPORT(FIELDTYPE *) -_nc_generic_fieldtype(bool (*const field_check) (FORM*, - FIELD *, +_nc_generic_fieldtype(bool (*const field_check) (FORM*, + FIELD *, const void *), - bool (*const char_check) (int, - FORM*, - FIELD*, + bool (*const char_check) (int, + FORM*, + FIELD*, const void *), bool (*const next)(FORM*,FIELD*,const void*), bool (*const prev)(FORM*,FIELD*,const void*), diff --git a/payloads/libpayload/curses/form/frm_cursor.c b/payloads/libpayload/curses/form/frm_cursor.c index 7a4cd16116..091b0fd5d4 100644 --- a/payloads/libpayload/curses/form/frm_cursor.c +++ b/payloads/libpayload/curses/form/frm_cursor.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_cursor.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int pos_form_cursor(FORM * form) -| +| | Description : Moves the form window cursor to the location required | by the form driver to resume form processing. This may | be needed after the application calls a curses library diff --git a/payloads/libpayload/curses/form/frm_data.c b/payloads/libpayload/curses/form/frm_data.c index 93917d5bbe..85914ebfa8 100644 --- a/payloads/libpayload/curses/form/frm_data.c +++ b/payloads/libpayload/curses/form/frm_data.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_data.c,v 1.15 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool data_behind(const FORM *form) -| +| | Description : Check for off-screen data behind. This is nearly trivial | because the beginning of a field is fixed. | @@ -69,12 +69,12 @@ data_behind(const FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static char * Only_Padding( | WINDOW *w, | int len, | int pad) -| +| | Description : Test if 'length' cells starting at the current position | contain a padding character. | @@ -122,11 +122,11 @@ Only_Padding(WINDOW *w, int len, int pad) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool data_ahead(const FORM *form) -| +| | Description : Check for off-screen data ahead. This is more difficult -| because a dynamic field has a variable end. +| because a dynamic field has a variable end. | | Return Values : TRUE - there are off-screen data ahead | FALSE - there are no off-screen data ahead diff --git a/payloads/libpayload/curses/form/frm_def.c b/payloads/libpayload/curses/form/frm_def.c index 86500f2398..54f743b01f 100644 --- a/payloads/libpayload/curses/form/frm_def.c +++ b/payloads/libpayload/curses/form/frm_def.c @@ -64,11 +64,11 @@ static FORM default_form = NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static FIELD *Insert_Field_By_Position( -| FIELD *new_field, +| FIELD *new_field, | FIELD *head ) -| +| | Description : Insert new_field into sorted fieldlist with head "head" | and return new head of sorted fieldlist. Sorting | criteria is (row,column). This is a circular list. @@ -112,9 +112,9 @@ Insert_Field_By_Position(FIELD *newfield, FIELD *head) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void Disconnect_Fields(FORM *form) -| +| | Description : Break association between form and array of fields. | | Return Values : - @@ -142,9 +142,9 @@ Disconnect_Fields(FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static int Connect_Fields(FORM *form, FIELD **fields) -| +| | Description : Set association between form and array of fields. | | Return Values : E_OK - no error @@ -249,10 +249,10 @@ Connect_Fields(FORM *form, FIELD **fields) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static int Associate_Fields(FORM *form, FIELD **fields) -| -| Description : Set association between form and array of fields. +| +| Description : Set association between form and array of fields. | If there are fields, position to first active field. | | Return Values : E_OK - success @@ -282,9 +282,9 @@ Associate_Fields(FORM *form, FIELD **fields) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : FORM *new_form_sp(SCREEN* sp, FIELD** fields ) -| +| | Description : Create new form with given array of fields. | | Return Values : Pointer to form. NULL if error occurred. @@ -330,9 +330,9 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : FORM* new_form(FIELD** fields ) -| +| | Description : Create new form with given array of fields. | | Return Values : Pointer to form. NULL if error occurred. @@ -351,9 +351,9 @@ new_form(FIELD **fields) #endif /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int free_form( FORM *form ) -| +| | Description : Release internal memory associated with form. | | Return Values : E_OK - no error @@ -380,9 +380,9 @@ free_form(FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_fields( FORM *form, FIELD **fields ) -| +| | Description : Set a new association of an array of fields to a form | | Return Values : E_OK - no error @@ -415,9 +415,9 @@ set_form_fields(FORM *form, FIELD **fields) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : FIELD **form_fields( const FORM *form ) -| +| | Description : Retrieve array of fields | | Return Values : Pointer to field array @@ -430,9 +430,9 @@ form_fields(const FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_count( const FORM *form ) -| +| | Description : Retrieve number of fields | | Return Values : Number of fields, -1 if none are defined diff --git a/payloads/libpayload/curses/form/frm_opts.c b/payloads/libpayload/curses/form/frm_opts.c index 3557fcd7ff..d51f345e5c 100644 --- a/payloads/libpayload/curses/form/frm_opts.c +++ b/payloads/libpayload/curses/form/frm_opts.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_opts(FORM *form, Form_Options opts) -| +| | Description : Turns on the named options and turns off all the | remaining options for that form. | @@ -60,9 +60,9 @@ set_form_opts(FORM *form, Form_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : Form_Options form_opts(const FORM *) -| +| | Description : Retrieves the current form options. | | Return Values : The option flags. @@ -75,13 +75,13 @@ form_opts(const FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int form_opts_on(FORM *form, Form_Options opts) -| -| Description : Turns on the named options; no other options are +| +| Description : Turns on the named options; no other options are | changed. | -| Return Values : E_OK - success +| Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ NCURSES_EXPORT(int) @@ -100,13 +100,13 @@ form_opts_on(FORM *form, Form_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int form_opts_off(FORM *form, Form_Options opts) -| -| Description : Turns off the named options; no other options are +| +| Description : Turns off the named options; no other options are | changed. | -| Return Values : E_OK - success +| Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ NCURSES_EXPORT(int) diff --git a/payloads/libpayload/curses/form/frm_page.c b/payloads/libpayload/curses/form/frm_page.c index 5a76ca9957..fdbc94caa1 100644 --- a/payloads/libpayload/curses/form/frm_page.c +++ b/payloads/libpayload/curses/form/frm_page.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_page.c,v 1.11 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_page(FORM * form,int page) -| +| | Description : Set the page number of the form. | | Return Values : E_OK - success @@ -87,9 +87,9 @@ set_form_page(FORM *form, int page) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int form_page(const FORM * form) -| +| | Description : Return the current page of the form. | | Return Values : >= 0 : current page number diff --git a/payloads/libpayload/curses/form/frm_post.c b/payloads/libpayload/curses/form/frm_post.c index 8e29aff5f6..5e9501eba0 100644 --- a/payloads/libpayload/curses/form/frm_post.c +++ b/payloads/libpayload/curses/form/frm_post.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_post.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int post_form(FORM * form) -| +| | Description : Writes the form into its associated subwindow. | | Return Values : E_OK - success @@ -87,9 +87,9 @@ post_form(FORM *form) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int unpost_form(FORM * form) -| +| | Description : Erase form from its associated subwindow. | | Return Values : E_OK - success diff --git a/payloads/libpayload/curses/form/frm_req_name.c b/payloads/libpayload/curses/form/frm_req_name.c index 99abd7e3c1..dbef6d7826 100644 --- a/payloads/libpayload/curses/form/frm_req_name.c +++ b/payloads/libpayload/curses/form/frm_req_name.c @@ -107,9 +107,9 @@ static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = #define A_SIZE (sizeof(request_names)/sizeof(request_names[0])) /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : const char * form_request_name (int request); -| +| | Description : Get the external name of a form request. | | Return Values : Pointer to name - on success @@ -130,9 +130,9 @@ form_request_name(int request) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int form_request_by_name (const char *str); -| +| | Description : Search for a request with this name. | | Return Values : Request Id - on success diff --git a/payloads/libpayload/curses/form/frm_scale.c b/payloads/libpayload/curses/form/frm_scale.c index 27e154e243..18a565e2f5 100644 --- a/payloads/libpayload/curses/form/frm_scale.c +++ b/payloads/libpayload/curses/form/frm_scale.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_scale.c,v 1.10 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int scale_form( const FORM *form, int *rows, int *cols ) -| +| | Description : Retrieve size of form | | Return Values : E_OK - no error diff --git a/payloads/libpayload/curses/form/frm_sub.c b/payloads/libpayload/curses/form/frm_sub.c index 1ab131a593..cf5b82f765 100644 --- a/payloads/libpayload/curses/form/frm_sub.c +++ b/payloads/libpayload/curses/form/frm_sub.c @@ -35,10 +35,10 @@ MODULE_ID("$Id: frm_sub.c,v 1.12 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_sub(FORM *form, WINDOW *win) -| -| Description : Set the subwindow of the form to win. +| +| Description : Set the subwindow of the form to win. | | Return Values : E_OK - success | E_POSTED - form is posted @@ -65,9 +65,9 @@ set_form_sub(FORM *form, WINDOW *win) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : WINDOW *form_sub(const FORM *) -| +| | Description : Retrieve the window of the form. | | Return Values : The pointer to the Subwindow. diff --git a/payloads/libpayload/curses/form/frm_user.c b/payloads/libpayload/curses/form/frm_user.c index 1375b5e90a..5cab224caf 100644 --- a/payloads/libpayload/curses/form/frm_user.c +++ b/payloads/libpayload/curses/form/frm_user.c @@ -35,9 +35,9 @@ MODULE_ID("$Id: frm_user.c,v 1.15 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_userptr(FORM *form, void *usrptr) -| +| | Description : Set the pointer that is reserved in any form to store | application relevant informations | @@ -53,9 +53,9 @@ set_form_userptr(FORM *form, void *usrptr) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : void *form_userptr(const FORM *form) -| +| | Description : Return the pointer that is reserved in any form to | store application relevant informations. | diff --git a/payloads/libpayload/curses/form/frm_win.c b/payloads/libpayload/curses/form/frm_win.c index a65cc59f84..82cf2d3c94 100644 --- a/payloads/libpayload/curses/form/frm_win.c +++ b/payloads/libpayload/curses/form/frm_win.c @@ -35,10 +35,10 @@ MODULE_ID("$Id: frm_win.c,v 1.16 2010/01/23 21:14:36 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_form_win(FORM *form,WINDOW *win) -| -| Description : Set the window of the form to win. +| +| Description : Set the window of the form to win. | | Return Values : E_OK - success | E_POSTED - form is posted @@ -65,9 +65,9 @@ set_form_win(FORM *form, WINDOW *win) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : WINDOW *form_win(const FORM *) -| +| | Description : Retrieve the window of the form. | | Return Values : The pointer to the Window or stdscr if there is none. diff --git a/payloads/libpayload/curses/form/fty_enum.c b/payloads/libpayload/curses/form/fty_enum.c index d3351644ef..2fd96f0699 100644 --- a/payloads/libpayload/curses/form/fty_enum.c +++ b/payloads/libpayload/curses/form/fty_enum.c @@ -54,9 +54,9 @@ typedef struct enumParams; /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Generic_Enum_Type(void * arg) -| +| | Description : Allocate structure for enumeration type argument. | | Return Values : Pointer to argument structure or NULL on error @@ -117,9 +117,9 @@ Generic_Enum_Type(void *arg) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Make_Enum_Type( va_list * ap ) -| +| | Description : Allocate structure for enumeration type argument. | | Return Values : Pointer to argument structure or NULL on error @@ -137,10 +137,10 @@ Make_Enum_Type(va_list *ap) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Copy_Enum_Type( const void * argp ) -| -| Description : Copy structure for enumeration type argument. +| +| Description : Copy structure for enumeration type argument. | | Return Values : Pointer to argument structure or NULL on error. +--------------------------------------------------------------------------*/ @@ -181,9 +181,9 @@ Copy_Enum_Type(const void *argp) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void Free_Enum_Type( void * argp ) -| +| | Description : Free structure for enumeration type argument. | | Return Values : - @@ -218,11 +218,11 @@ Free_Enum_Type(void *argp) #define EXACT 2 /*--------------------------------------------------------------------------- -| Facility : libnform -| Function : static int Compare(const unsigned char * s, +| Facility : libnform +| Function : static int Compare(const unsigned char * s, | const unsigned char * buf, | bool ccase ) -| +| | Description : Check whether or not the text in 'buf' matches the | text in 's', at least partial. | @@ -273,11 +273,11 @@ Compare(const unsigned char *s, const unsigned char *buf, } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Check_Enum_Field( | FIELD * field, | const void * argp) -| +| | Description : Validate buffer content to be a valid enumeration value | | Return Values : TRUE - field is valid @@ -330,10 +330,10 @@ static const char *dummy[] = {(char *)0}; /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Next_Enum(FIELD * field, | const void * argp) -| +| | Description : Check for the next enumeration value | | Return Values : TRUE - next value found and loaded @@ -367,11 +367,11 @@ Next_Enum(FIELD *field, const void *argp) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Previous_Enum( | FIELD * field, | const void * argp) -| +| | Description : Check for the previous enumeration value | | Return Values : TRUE - previous value found and loaded diff --git a/payloads/libpayload/curses/form/fty_generic.c b/payloads/libpayload/curses/form/fty_generic.c index 3e7a575a26..439afcc2ac 100644 --- a/payloads/libpayload/curses/form/fty_generic.c +++ b/payloads/libpayload/curses/form/fty_generic.c @@ -55,15 +55,15 @@ MODULE_ID("$Id: fty_generic.c,v 1.5 2010/01/23 21:14:36 tom Exp $") * fieldtype they register with the forms library using this call. * * For that purpose we have extended the fieldtype struc by a new element - * that gets the arguments from a single struct passed by the caller. - * + * that gets the arguments from a single struct passed by the caller. + * */ #if NCURSES_INTEROP_FUNCS /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Generic_This_Type( void * arg ) -| +| | Description : We interpret the passed arg just as a handle the | calling language uses to keep track of its allocated | argument structures. We can simply copy it back. @@ -89,7 +89,7 @@ Generic_This_Type(void *arg) | write a field_check and a char_check function and give | them as input to this call. A callback to allow the | release of the allocated memory must also be provided. -| For generic field types, we provide some more +| For generic field types, we provide some more | information about the field as parameters. | | If an error occurs, errno is set to @@ -139,12 +139,12 @@ _nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *), } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static TypeArgument *GenericArgument( | const FIELDTYPE* typ, | int (*argiterator)(void**), | int* err) -| +| | Description : The iterator callback must browse through all fieldtype | parameters that have an argument associated with the | type. The iterator returns 1 if the operation to get @@ -200,14 +200,14 @@ GenericArgument(const FIELDTYPE *typ, } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int _nc_set_generic_fieldtype( | FIELD* field, | FIELDTYPE* ftyp, | int (*argiterator)(void**)) -| +| | Description : Assign the fieldtype to the field and use the iterator -| mechanism to get the arguments when a check is +| mechanism to get the arguments when a check is | performed. | | Return Values : E_OK if all went well @@ -258,11 +258,11 @@ _nc_set_generic_fieldtype(FIELD *field, } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : WINDOW* _nc_form_cursor( | FORM* form, | int *pRow, int *pCol) -| +| | Description : Get the current position of the form cursor position | We also return the field window | diff --git a/payloads/libpayload/curses/form/fty_int.c b/payloads/libpayload/curses/form/fty_int.c index e643ad975f..0eddedf7b4 100644 --- a/payloads/libpayload/curses/form/fty_int.c +++ b/payloads/libpayload/curses/form/fty_int.c @@ -61,9 +61,9 @@ typedef struct integerPARM; /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Generic_This_Type( void * arg ) -| +| | Description : Allocate structure for integer type argument. | | Return Values : Pointer to argument structure or NULL on error @@ -88,9 +88,9 @@ Generic_This_Type(void *arg) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Make_This_Type( va_list * ap ) -| +| | Description : Allocate structure for integer type argument. | | Return Values : Pointer to argument structure or NULL on error @@ -108,10 +108,10 @@ Make_This_Type(va_list *ap) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void *Copy_This_Type(const void * argp) -| -| Description : Copy structure for integer type argument. +| +| Description : Copy structure for integer type argument. | | Return Values : Pointer to argument structure or NULL on error. +--------------------------------------------------------------------------*/ @@ -134,9 +134,9 @@ Copy_This_Type(const void *argp) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static void Free_This_Type(void * argp) -| +| | Description : Free structure for integer type argument. | | Return Values : - @@ -149,11 +149,11 @@ Free_This_Type(void *argp) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Check_This_Field( | FIELD * field, | const void * argp) -| +| | Description : Validate buffer content to be a valid integer value | | Return Values : TRUE - field is valid @@ -242,11 +242,11 @@ Check_This_Field(FIELD *field, const void *argp) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Check_This_Character( | int c, | const void * argp) -| +| | Description : Check a character for the integer type. | | Return Values : TRUE - character is valid diff --git a/payloads/libpayload/curses/form/fty_ipv4.c b/payloads/libpayload/curses/form/fty_ipv4.c index 8dc04f8c53..3def25967c 100644 --- a/payloads/libpayload/curses/form/fty_ipv4.c +++ b/payloads/libpayload/curses/form/fty_ipv4.c @@ -37,11 +37,11 @@ MODULE_ID("$Id: fty_ipv4.c,v 1.10 2009/11/07 20:17:58 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Check_IPV4_Field( | FIELD * field, | const void * argp) -| +| | Description : Validate buffer content to be a valid IP number (Ver. 4) | | Return Values : TRUE - field is valid @@ -69,11 +69,11 @@ Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : static bool Check_IPV4_Character( -| int c, +| int c, | const void *argp ) -| +| | Description : Check a character for unsigned type or period. | | Return Values : TRUE - character is valid diff --git a/payloads/libpayload/curses/menu/m_attribs.c b/payloads/libpayload/curses/menu/m_attribs.c index c41d558ec9..1ea5c7a904 100644 --- a/payloads/libpayload/curses/menu/m_attribs.c +++ b/payloads/libpayload/curses/menu/m_attribs.c @@ -72,69 +72,69 @@ NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\ } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_fore(MENU *menu, chtype attr) -| +| | Description : Set the attribute for selectable items. In single- | valued menus this is used to highlight the current | item ((i.e. where the cursor is), in multi-valued | menus this is used to highlight the selected items. | | Return Values : E_OK - success -| E_BAD_ARGUMENT - an invalid value has been passed +| E_BAD_ARGUMENT - an invalid value has been passed +--------------------------------------------------------------------------*/ GEN_MENU_ATTR_SET_FCT(fore) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : chtype menu_fore(const MENU* menu) -| +| | Description : Return the attribute used for selectable items that | are current (single-valued menu) or selected (multi- -| valued menu). +| valued menu). | | Return Values : Attribute value +--------------------------------------------------------------------------*/ GEN_MENU_ATTR_GET_FCT(fore) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_back(MENU *menu, chtype attr) -| +| | Description : Set the attribute for selectable but not yet selected | items. | -| Return Values : E_OK - success +| Return Values : E_OK - success | E_BAD_ARGUMENT - an invalid value has been passed +--------------------------------------------------------------------------*/ GEN_MENU_ATTR_SET_FCT(back) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : chtype menu_back(const MENU *menu) -| +| | Description : Return the attribute used for selectable but not yet -| selected items. +| selected items. | | Return Values : Attribute value +--------------------------------------------------------------------------*/ GEN_MENU_ATTR_GET_FCT(back) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_grey(MENU *menu, chtype attr) -| +| | Description : Set the attribute for unselectable items. | | Return Values : E_OK - success -| E_BAD_ARGUMENT - an invalid value has been passed +| E_BAD_ARGUMENT - an invalid value has been passed +--------------------------------------------------------------------------*/ GEN_MENU_ATTR_SET_FCT(grey) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : chtype menu_grey(const MENU *menu) -| +| | Description : Return the attribute used for non-selectable items | | Return Values : Attribute value diff --git a/payloads/libpayload/curses/menu/m_global.c b/payloads/libpayload/curses/menu/m_global.c index 90f6f25925..73227f3382 100644 --- a/payloads/libpayload/curses/menu/m_global.c +++ b/payloads/libpayload/curses/menu/m_global.c @@ -53,7 +53,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { 0, /* length of widest description */ 1, /* length of mark */ 1, /* length of one item */ - 1, /* Spacing for descriptor */ + 1, /* Spacing for descriptor */ 1, /* Spacing for columns */ 1, /* Spacing for rows */ (char *)0, /* buffer used to store match chars */ @@ -68,7 +68,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { 0, /* Top row of menu */ (chtype)A_REVERSE, /* Attribute for selection */ (chtype)A_NORMAL, /* Attribute for nonselection */ - (chtype)A_UNDERLINE, /* Attribute for inactive */ + (chtype)A_UNDERLINE, /* Attribute for inactive */ ' ', /* Pad character */ (Menu_Hook)0, /* Menu init */ (Menu_Hook)0, /* Menu term */ @@ -77,7 +77,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { (void *)0, /* userptr */ mark, /* mark */ ALL_MENU_OPTS, /* options */ - 0 /* status */ + 0 /* status */ }; NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { @@ -98,9 +98,9 @@ NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { /* *INDENT-ON* */ /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : static void ComputeMaximum_NameDesc_Lenths(MENU *menu) -| +| | Description : Calculates the maximum name and description lengths | of the items connected to the menu | @@ -132,9 +132,9 @@ ComputeMaximum_NameDesc_Lengths(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : static void ResetConnectionInfo(MENU *, ITEM **) -| +| | Description : Reset all informations in the menu and the items in | the item array that indicates a connection | @@ -160,7 +160,7 @@ ResetConnectionInfo(MENU * menu, ITEM ** items) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool _nc_Connect_Items(MENU *menu, ITEM **items) | | Description : Connect the items in the item array to the menu. @@ -218,16 +218,16 @@ _nc_Connect_Items(MENU * menu, ITEM ** items) } } - /* If we fall through to this point, we have to reset all items connection + /* If we fall through to this point, we have to reset all items connection and inform about a reject connection */ ResetConnectionInfo(menu, items); return (FALSE); } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Disconnect_Items(MENU *menu) -| +| | Description : Disconnect the menus item array from the menu | | Return Values : - @@ -240,9 +240,9 @@ _nc_Disconnect_Items(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int _nc_Calculate_Text_Width(const TEXT * item) -| +| | Description : Calculate the number of columns for a TEXT. | | Return Values : the width @@ -328,9 +328,9 @@ calculate_actual_width(MENU * menu, bool name) #endif /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Calculate_Item_Length_and_Width(MENU *menu) -| +| | Description : Calculate the length of an item and the width of the | whole menu. | @@ -366,9 +366,9 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Link_Item(MENU *menu) -| +| | Description : Statically calculate for every item its four neighbors. | This depends on the orientation of the menu. This | static approach simplifies navigation in the menu a lot. @@ -495,9 +495,9 @@ _nc_Link_Items(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Show_Menu(const MENU* menu) -| +| | Description : Update the window that is associated with the menu | | Return Values : - @@ -530,12 +530,12 @@ _nc_Show_Menu(const MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_New_TopRow_and_CurrentItem( -| MENU *menu, -| int new_toprow, +| MENU *menu, +| int new_toprow, | ITEM *new_current_item) -| +| | Description : Redisplay the menu so that the given row becomes the | top row and the given item becomes the new current | item. diff --git a/payloads/libpayload/curses/menu/m_hook.c b/payloads/libpayload/curses/menu/m_hook.c index 6125d052e7..df78d0af1e 100644 --- a/payloads/libpayload/curses/menu/m_hook.c +++ b/payloads/libpayload/curses/menu/m_hook.c @@ -57,9 +57,9 @@ NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\ } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_init(MENU *menu, void (*f)(MENU *)) -| +| | Description : Set user-exit which is called when menu is posted | or just after the top row changes. | @@ -68,11 +68,11 @@ NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\ GEN_HOOK_SET_FUNCTION(menu, init) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void (*)(MENU *) menu_init(const MENU *menu) -| +| | Description : Return address of user-exit function which is called -| when a menu is posted or just after the top row +| when a menu is posted or just after the top row | changes. | | Return Values : Menu init function address or NULL @@ -80,9 +80,9 @@ GEN_HOOK_SET_FUNCTION(menu, init) GEN_HOOK_GET_FUNCTION(menu, init) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_term (MENU *menu, void (*f)(MENU *)) -| +| | Description : Set user-exit which is called when menu is unposted | or just before the top row changes. | @@ -91,11 +91,11 @@ GEN_HOOK_GET_FUNCTION(menu, init) GEN_HOOK_SET_FUNCTION(menu, term) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void (*)(MENU *) menu_term(const MENU *menu) -| +| | Description : Return address of user-exit function which is called -| when a menu is unposted or just before the top row +| when a menu is unposted or just before the top row | changes. | | Return Values : Menu finalization function address or NULL @@ -103,9 +103,9 @@ GEN_HOOK_SET_FUNCTION(menu, term) GEN_HOOK_GET_FUNCTION(menu, term) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_item_init (MENU *menu, void (*f)(MENU *)) -| +| | Description : Set user-exit which is called when menu is posted | or just after the current item changes. | @@ -114,11 +114,11 @@ GEN_HOOK_GET_FUNCTION(menu, term) GEN_HOOK_SET_FUNCTION(item, init) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void (*)(MENU *) item_init (const MENU *menu) -| +| | Description : Return address of user-exit function which is called -| when a menu is posted or just after the current item +| when a menu is posted or just after the current item | changes. | | Return Values : Item init function address or NULL @@ -126,9 +126,9 @@ GEN_HOOK_SET_FUNCTION(item, init) GEN_HOOK_GET_FUNCTION(item, init) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_item_term (MENU *menu, void (*f)(MENU *)) -| +| | Description : Set user-exit which is called when menu is unposted | or just before the current item changes. | @@ -137,11 +137,11 @@ GEN_HOOK_GET_FUNCTION(item, init) GEN_HOOK_SET_FUNCTION(item, term) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void (*)(MENU *) item_init (const MENU *menu) -| +| | Description : Return address of user-exit function which is called -| when a menu is unposted or just before the current item +| when a menu is unposted or just before the current item | changes. | | Return Values : Item finalization function address or NULL diff --git a/payloads/libpayload/curses/menu/m_item_cur.c b/payloads/libpayload/curses/menu/m_item_cur.c index 18b1a2726a..189e61bd32 100644 --- a/payloads/libpayload/curses/menu/m_item_cur.c +++ b/payloads/libpayload/curses/menu/m_item_cur.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_item_cur.c,v 1.18 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_current_item(MENU *menu, const ITEM *item) -| +| | Description : Make the item the current item | | Return Values : E_OK - success @@ -81,9 +81,9 @@ set_current_item(MENU * menu, ITEM * item) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : ITEM *current_item(const MENU *menu) -| +| | Description : Return the menus current item | | Return Values : Item pointer or NULL if failure @@ -96,9 +96,9 @@ current_item(const MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int item_index(const ITEM *) -| +| | Description : Return the logical index of this item. | | Return Values : The index or ERR if this is an invalid item pointer diff --git a/payloads/libpayload/curses/menu/m_item_nam.c b/payloads/libpayload/curses/menu/m_item_nam.c index 3ed1d37668..eb6f58aa8c 100644 --- a/payloads/libpayload/curses/menu/m_item_nam.c +++ b/payloads/libpayload/curses/menu/m_item_nam.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_item_nam.c,v 1.15 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *item_name(const ITEM *item) -| +| | Description : Return name of menu item | | Return Values : See above; returns NULL if item is invalid @@ -55,9 +55,9 @@ item_name(const ITEM * item) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *item_description(const ITEM *item) -| +| | Description : Returns description of item | | Return Values : See above; Returns NULL if item is invalid diff --git a/payloads/libpayload/curses/menu/m_item_new.c b/payloads/libpayload/curses/menu/m_item_new.c index 1debc2b344..a10ec4b5b6 100644 --- a/payloads/libpayload/curses/menu/m_item_new.c +++ b/payloads/libpayload/curses/menu/m_item_new.c @@ -47,9 +47,9 @@ MODULE_ID("$Id: m_item_new.c,v 1.30 2010/01/23 21:20:11 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool Is_Printable_String(const char *s) -| +| | Description : Checks whether or not the string contains only printable | characters. | @@ -97,9 +97,9 @@ Is_Printable_String(const char *s) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : ITEM *new_item(char *name, char *description) -| +| | Description : Create a new item with name and description. Return | a pointer to this new item. | N.B.: an item must(!) have a name. @@ -149,15 +149,15 @@ new_item(const char *name, const char *description) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int free_item(ITEM *item) -| -| Description : Free the allocated storage for this item. +| +| Description : Free the allocated storage for this item. | N.B.: a connected item can't be freed. | | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid value has been passed -| E_CONNECTED - item is still connected to a menu +| E_CONNECTED - item is still connected to a menu +--------------------------------------------------------------------------*/ NCURSES_EXPORT(int) free_item(ITEM * item) @@ -176,16 +176,16 @@ free_item(ITEM * item) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_mark( MENU *menu, const char *mark ) -| +| | Description : Set the mark string used to indicate the current | item (single-valued menu) or the selected items | (multi-valued menu). -| The mark argument may be NULL, in which case no +| The mark argument may be NULL, in which case no | marker is used. -| This might be a little bit tricky, because this may -| affect the geometry of the menu, which we don't allow +| This might be a little bit tricky, because this may +| affect the geometry of the menu, which we don't allow | if it is already posted. | | Return Values : E_OK - success @@ -258,9 +258,9 @@ set_menu_mark(MENU * menu, const char *mark) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *menu_mark(const MENU *menu) -| +| | Description : Return a pointer to the marker string | | Return Values : The marker string pointer or NULL if no marker defined diff --git a/payloads/libpayload/curses/menu/m_item_opt.c b/payloads/libpayload/curses/menu/m_item_opt.c index 91385da121..de5eb8d63f 100644 --- a/payloads/libpayload/curses/menu/m_item_opt.c +++ b/payloads/libpayload/curses/menu/m_item_opt.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_item_opt.c,v 1.18 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : int set_item_opts(ITEM *item, Item_Options opts) -| +| Facility : libnmenu +| Function : int set_item_opts(ITEM *item, Item_Options opts) +| | Description : Set the options of the item. If there are relevant | changes, the item is connected and the menu is posted, | the menu will be redisplayed. @@ -85,9 +85,9 @@ set_item_opts(ITEM * item, Item_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : int item_opts_off(ITEM *item, Item_Options opts) -| +| Facility : libnmenu +| Function : int item_opts_off(ITEM *item, Item_Options opts) +| | Description : Switch of the options for this item. | | Return Values : E_OK - success @@ -113,9 +113,9 @@ item_opts_off(ITEM * item, Item_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : int item_opts_on(ITEM *item, Item_Options opts) -| +| Facility : libnmenu +| Function : int item_opts_on(ITEM *item, Item_Options opts) +| | Description : Switch on the options for this item. | | Return Values : E_OK - success @@ -142,9 +142,9 @@ item_opts_on(ITEM * item, Item_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : Item_Options item_opts(const ITEM *item) -| +| Facility : libnmenu +| Function : Item_Options item_opts(const ITEM *item) +| | Description : Switch of the options for this item. | | Return Values : Items options diff --git a/payloads/libpayload/curses/menu/m_item_top.c b/payloads/libpayload/curses/menu/m_item_top.c index 752e20d9ed..89f831609d 100644 --- a/payloads/libpayload/curses/menu/m_item_top.c +++ b/payloads/libpayload/curses/menu/m_item_top.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_item_top.c,v 1.11 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_top_row(MENU *menu, int row) -| +| | Description : Makes the specified row the top row in the menu | | Return Values : E_OK - success @@ -84,9 +84,9 @@ set_top_row(MENU * menu, int row) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int top_row(const MENU *) -| +| | Description : Return the top row of the menu | | Return Values : The row number or ERR if there is no row diff --git a/payloads/libpayload/curses/menu/m_item_use.c b/payloads/libpayload/curses/menu/m_item_use.c index 8cf294bc29..4a25a85d6e 100644 --- a/payloads/libpayload/curses/menu/m_item_use.c +++ b/payloads/libpayload/curses/menu/m_item_use.c @@ -40,11 +40,11 @@ MODULE_ID("$Id: m_item_use.c,v 1.17 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_item_userptr(ITEM *item, void *userptr) -| +| | Description : Set the pointer that is reserved in any item to store -| application relevant informations. +| application relevant informations. | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ @@ -57,9 +57,9 @@ set_item_userptr(ITEM * item, void *userptr) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void *item_userptr(const ITEM *item) -| +| | Description : Return the pointer that is reserved in any item to store | application relevant informations. | diff --git a/payloads/libpayload/curses/menu/m_item_val.c b/payloads/libpayload/curses/menu/m_item_val.c index 337dbfcc68..c628338b2b 100644 --- a/payloads/libpayload/curses/menu/m_item_val.c +++ b/payloads/libpayload/curses/menu/m_item_val.c @@ -40,14 +40,14 @@ MODULE_ID("$Id: m_item_val.c,v 1.15 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_item_value(ITEM *item, int value) -| +| | Description : Programmatically set the item's selection value. This is | only allowed if the item is selectable at all and if | it is not connected to a single-valued menu. | If the item is connected to a posted menu, the menu -| will be redisplayed. +| will be redisplayed. | | Return Values : E_OK - success | E_REQUEST_DENIED - not selectable or single valued menu @@ -86,9 +86,9 @@ set_item_value(ITEM * item, bool value) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool item_value(const ITEM *item) -| +| | Description : Return the selection value of the item | | Return Values : TRUE - if item is selected diff --git a/payloads/libpayload/curses/menu/m_item_vis.c b/payloads/libpayload/curses/menu/m_item_vis.c index ff84740543..312f0a0ba4 100644 --- a/payloads/libpayload/curses/menu/m_item_vis.c +++ b/payloads/libpayload/curses/menu/m_item_vis.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_item_vis.c,v 1.16 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool item_visible(const ITEM *item) -| +| | Description : A item is visible if it currently appears in the | subwindow of a posted menu. | diff --git a/payloads/libpayload/curses/menu/m_items.c b/payloads/libpayload/curses/menu/m_items.c index 539768551d..e1755f1f90 100644 --- a/payloads/libpayload/curses/menu/m_items.c +++ b/payloads/libpayload/curses/menu/m_items.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_items.c,v 1.17 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_items(MENU *menu, ITEM **items) -| +| | Description : Sets the item pointer array connected to menu. | | Return Values : E_OK - success @@ -77,9 +77,9 @@ set_menu_items(MENU * menu, ITEM ** items) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : ITEM **menu_items(const MENU *menu) -| +| | Description : Returns a pointer to the item pointer array of the menu | | Return Values : NULL on error @@ -92,11 +92,11 @@ menu_items(const MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int item_count(const MENU *menu) -| +| | Description : Get the number of items connected to the menu. If the -| menu pointer is NULL we return -1. +| menu pointer is NULL we return -1. | | Return Values : Number of items or -1 to indicate error. +--------------------------------------------------------------------------*/ diff --git a/payloads/libpayload/curses/menu/m_new.c b/payloads/libpayload/curses/menu/m_new.c index 79f9292a7b..2f9fe55052 100644 --- a/payloads/libpayload/curses/menu/m_new.c +++ b/payloads/libpayload/curses/menu/m_new.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_new.c,v 1.21 2010/01/23 21:20:11 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : MENU* _nc_new_menu(SCREEN*, ITEM **items) -| +| | Description : Creates a new menu connected to the item pointer | array items and returns a pointer to the new menu. | The new menu is initialized with the values from the @@ -90,9 +90,9 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : MENU *new_menu(ITEM **items) -| +| | Description : Creates a new menu connected to the item pointer | array items and returns a pointer to the new menu. | The new menu is initialized with the values from the @@ -109,10 +109,10 @@ new_menu(ITEM ** items) #endif /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : int free_menu(MENU *menu) -| -| Description : Disconnects menu from its associated item pointer +| Facility : libnmenu +| Function : int free_menu(MENU *menu) +| +| Description : Disconnects menu from its associated item pointer | array and frees the storage allocated for the menu. | | Return Values : E_OK - success diff --git a/payloads/libpayload/curses/menu/m_pad.c b/payloads/libpayload/curses/menu/m_pad.c index caa2f9e207..379ce7cfc1 100644 --- a/payloads/libpayload/curses/menu/m_pad.c +++ b/payloads/libpayload/curses/menu/m_pad.c @@ -48,11 +48,11 @@ MODULE_ID("$Id: m_pad.c,v 1.12 2010/01/23 21:20:10 tom Exp $") } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_pad(MENU* menu, int pad) -| +| | Description : Set the character to be used to separate the item name -| from its description. This must be a printable +| from its description. This must be a printable | character. | | Return Values : E_OK - success @@ -78,9 +78,9 @@ set_menu_pad(MENU * menu, int pad) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int menu_pad(const MENU *menu) -| +| | Description : Return the value of the padding character | | Return Values : The pad character diff --git a/payloads/libpayload/curses/menu/m_pattern.c b/payloads/libpayload/curses/menu/m_pattern.c index 1764d05fbc..ebede0a190 100644 --- a/payloads/libpayload/curses/menu/m_pattern.c +++ b/payloads/libpayload/curses/menu/m_pattern.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_pattern.c,v 1.16 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *menu_pattern(const MENU *menu) -| +| | Description : Return the value of the pattern buffer. | | Return Values : NULL - if there is no pattern buffer allocated @@ -60,9 +60,9 @@ menu_pattern(const MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_pattern(MENU *menu, const char *p) -| +| | Description : Set the match pattern for a menu and position to the | first item that matches. | diff --git a/payloads/libpayload/curses/menu/m_req_name.c b/payloads/libpayload/curses/menu/m_req_name.c index cad8758020..50c0c68c50 100644 --- a/payloads/libpayload/curses/menu/m_req_name.c +++ b/payloads/libpayload/curses/menu/m_req_name.c @@ -63,9 +63,9 @@ static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] = #define A_SIZE (sizeof(request_names)/sizeof(request_names[0])) /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : const char * menu_request_name (int request); -| +| | Description : Get the external name of a menu request. | | Return Values : Pointer to name - on success @@ -85,9 +85,9 @@ menu_request_name(int request) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int menu_request_by_name (const char *str); -| +| | Description : Search for a request with this name. | | Return Values : Request Id - on success diff --git a/payloads/libpayload/curses/menu/m_scale.c b/payloads/libpayload/curses/menu/m_scale.c index 068a1cc8c5..26a560e757 100644 --- a/payloads/libpayload/curses/menu/m_scale.c +++ b/payloads/libpayload/curses/menu/m_scale.c @@ -40,11 +40,11 @@ MODULE_ID("$Id: m_scale.c,v 1.10 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int scale_menu(const MENU *menu) -| +| | Description : Returns the minimum window size necessary for the -| subwindow of menu. +| subwindow of menu. | | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid menu pointer diff --git a/payloads/libpayload/curses/menu/m_sub.c b/payloads/libpayload/curses/menu/m_sub.c index 27123586bc..4bb373f3f2 100644 --- a/payloads/libpayload/curses/menu/m_sub.c +++ b/payloads/libpayload/curses/menu/m_sub.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_sub.c,v 1.12 2010/01/23 21:20:11 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_sub(MENU *menu, WINDOW *win) -| +| | Description : Sets the subwindow of the menu. | | Return Values : E_OK - success @@ -81,9 +81,9 @@ set_menu_sub(MENU * menu, WINDOW *win) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : WINDOW* menu_sub(const MENU *menu) -| +| | Description : Returns a pointer to the subwindow of the menu | | Return Values : NULL on error, otherwise a pointer to the window diff --git a/payloads/libpayload/curses/menu/m_userptr.c b/payloads/libpayload/curses/menu/m_userptr.c index a7359c99d0..67d6ecd425 100644 --- a/payloads/libpayload/curses/menu/m_userptr.c +++ b/payloads/libpayload/curses/menu/m_userptr.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_userptr.c,v 1.17 2010/01/23 21:20:10 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_userptr(MENU *menu, void *userptr) -| +| | Description : Set the pointer that is reserved in any menu to store | application relevant informations. | @@ -57,9 +57,9 @@ set_menu_userptr(MENU * menu, void *userptr) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void *menu_userptr(const MENU *menu) -| +| | Description : Return the pointer that is reserved in any menu to | store application relevant informations. | diff --git a/payloads/libpayload/curses/menu/m_win.c b/payloads/libpayload/curses/menu/m_win.c index 5ddb1af9d3..d025c1bc46 100644 --- a/payloads/libpayload/curses/menu/m_win.c +++ b/payloads/libpayload/curses/menu/m_win.c @@ -40,9 +40,9 @@ MODULE_ID("$Id: m_win.c,v 1.17 2010/01/23 21:20:11 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_win(MENU *menu, WINDOW *win) -| +| | Description : Sets the window of the menu. | | Return Values : E_OK - success @@ -81,9 +81,9 @@ set_menu_win(MENU * menu, WINDOW *win) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : WINDOW* menu_win(const MENU*) -| +| | Description : Returns pointer to the window of the menu | | Return Values : NULL on error, otherwise pointer to window diff --git a/payloads/libpayload/curses/menu/menu.h b/payloads/libpayload/curses/menu/menu.h index 67396f7637..1fdd9e795d 100644 --- a/payloads/libpayload/curses/menu/menu.h +++ b/payloads/libpayload/curses/menu/menu.h @@ -67,18 +67,18 @@ typedef struct unsigned short length; } TEXT; -typedef struct tagITEM +typedef struct tagITEM { TEXT name; /* name of menu item */ - TEXT description; /* description of item, optional in display */ + TEXT description; /* description of item, optional in display */ struct tagMENU *imenu; /* Pointer to parent menu */ - void *userptr; /* Pointer to user defined per item data */ - Item_Options opt; /* Item options */ + void *userptr; /* Pointer to user defined per item data */ + Item_Options opt; /* Item options */ short index; /* Item number if connected to a menu */ short y; /* y and x location of item in menu */ short x; bool value; /* Selection value */ - + struct tagITEM *left; /* neighbor items */ struct tagITEM *right; struct tagITEM *up; @@ -88,7 +88,7 @@ typedef struct tagITEM typedef void (*Menu_Hook)(struct tagMENU *); -typedef struct tagMENU +typedef struct tagMENU { short height; /* Nr. of chars high */ short width; /* Nr. of chars wide */ @@ -103,14 +103,14 @@ typedef struct tagMENU short itemlen; /* Length of one item */ short spc_desc; /* Spacing for descriptor */ short spc_cols; /* Spacing for columns */ - short spc_rows; /* Spacing for rows */ + short spc_rows; /* Spacing for rows */ char *pattern; /* Buffer to store match chars */ short pindex; /* Index into pattern buffer */ WINDOW *win; /* Window containing menu */ WINDOW *sub; /* Subwindow for menu display */ WINDOW *userwin; /* User's window */ WINDOW *usersub; /* User's subwindow */ - ITEM **items; /* array of items */ + ITEM **items; /* array of items */ short nitems; /* Nr. of items in menu */ ITEM *curitem; /* Current item */ short toprow; /* Top row of menu */ diff --git a/payloads/libpayload/curses/pdcurses-backend/pdcdisp.c b/payloads/libpayload/curses/pdcurses-backend/pdcdisp.c index 80073ac73a..ab73831aa6 100644 --- a/payloads/libpayload/curses/pdcurses-backend/pdcdisp.c +++ b/payloads/libpayload/curses/pdcurses-backend/pdcdisp.c @@ -13,10 +13,10 @@ chtype acs_map[128] = { - A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), - A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), - A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), - A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', + A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), + A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), + A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), + A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', A(0x1a), A(0x1b), A(0x18), A(0x19), @@ -25,17 +25,17 @@ chtype acs_map[128] = 0xdb, - '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', - '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', + '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', + 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', A(0x04), 0xb1, 'b', 'c', 'd', 'e', - 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, - 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, + 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, + 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, 0xd8, 0x9c, 0xf9, A(127) @@ -130,7 +130,7 @@ void PDC_gotoyx(int row, int col) #endif } -/* update the given physical line to look like the corresponding line in +/* update the given physical line to look like the corresponding line in curscr */ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) diff --git a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c index 4a039ffbc4..4558406ea3 100644 --- a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c +++ b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c @@ -1,5 +1,5 @@ /* Public Domain Curses */ - + #include "lppdc.h" #include <usb/usb.h> @@ -173,7 +173,7 @@ int PDC_get_key(void) return c; } -/* discard any pending keyboard input -- this is the core +/* discard any pending keyboard input -- this is the core routine for flushinp() */ void PDC_flushinp(void) diff --git a/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c b/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c index b8d9e4e3d6..d3f1849b89 100644 --- a/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c +++ b/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c @@ -22,7 +22,7 @@ short curstoreal[16], realtocurs[16] = COLOR_MAGENTA + 8, COLOR_YELLOW + 8, COLOR_WHITE + 8 }; -/* close the physical screen -- may restore the screen to its state +/* close the physical screen -- may restore the screen to its state before PDC_scr_open(); miscellaneous cleanup */ void PDC_scr_close(void) @@ -49,7 +49,7 @@ void PDC_scr_free(void) pdc_atrtab = (unsigned char *)NULL; } -/* open the physical screen -- allocate SP, miscellaneous intialization, +/* open the physical screen -- allocate SP, miscellaneous intialization, and may save the existing screen for later restoration */ int PDC_scr_open(int argc, char **argv) diff --git a/payloads/libpayload/include/lzma.h b/payloads/libpayload/include/lzma.h index 35f4c02c46..5be6f43935 100644 --- a/payloads/libpayload/include/lzma.h +++ b/payloads/libpayload/include/lzma.h @@ -32,7 +32,7 @@ /* decompresses the data stream at src to dst, determining its length from * the data stream itself. - * + * * returns the decompressed size, or 0 on error */ unsigned long ulzma(unsigned char *src, unsigned char *dst); diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h index 565bdb5d7d..1f13ceea5b 100644 --- a/payloads/libpayload/include/pci/pci.h +++ b/payloads/libpayload/include/pci/pci.h @@ -1,108 +1,108 @@ -/*
- * This file is part of the libpayload project.
- *
- * Copyright (C) 2010 coresystems GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _PCI_PCI_H
-#define _PCI_PCI_H
-
-/* we implement at least this version */
-#define PCI_LIB_VERSION 0x020200
-
-#include <pci.h>
-
-#define PCI_CLASS_DEVICE REG_CLASS_DEV
-#define PCI_SUBSYSTEM_VENDOR_ID REG_SUBSYS_VENDOR_ID
-#define PCI_SUBSYSTEM_ID REG_SUBSYS_ID
-
-#define PCI_COMMAND REG_COMMAND
-#define PCI_COMMAND_IO REG_COMMAND_IO
-#define PCI_COMMAND_MEMORY REG_COMMAND_MEM
-#define PCI_COMMAND_MASTER REG_COMMAND_BM
-
-#define PCI_HEADER_TYPE REG_HEADER_TYPE
-#define PCI_HEADER_TYPE_NORMAL HEADER_TYPE_NORMAL
-#define PCI_HEADER_TYPE_BRIDGE HEADER_TYPE_BRIDGE
-#define PCI_HEADER_TYPE_CARDBUS HEADER_TYPE_CARDBUS
-
-#define PCI_BASE_ADDRESS_0 0x10
-#define PCI_BASE_ADDRESS_1 0x14
-#define PCI_BASE_ADDRESS_2 0x18
-#define PCI_BASE_ADDRESS_3 0x1c
-#define PCI_BASE_ADDRESS_4 0x20
-#define PCI_BASE_ADDRESS_5 0x24
-#define PCI_BASE_ADDRESS_SPACE 1 // mask
-#define PCI_BASE_ADDRESS_SPACE_IO 1
-#define PCI_BASE_ADDRESS_SPACE_MEM 0
-#define PCI_BASE_ADDRESS_IO_MASK ~0xf
-#define PCI_BASE_ADDRESS_MEM_MASK ~0x3
-
-#define PCI_ROM_ADDRESS 0x30
-#define PCI_ROM_ADDRESS1 0x38 // on bridges
-#define PCI_ROM_ADDRESS_MASK ~0x7ff
-
-#define PCI_VENDOR_ID_INTEL 0x8086
-
-struct pci_dev {
- u16 domain;
- u8 bus, dev, func;
- u16 vendor_id, device_id;
- struct pci_dev *next;
-};
-
-/*
- * values to match devices against.
- * "-1" means "don't care", everything else requires an exact match
- */
-struct pci_filter {
- int domain, bus, dev, func;
- int vendor, device;
- struct pci_dev *devices;
-};
-
-struct pci_access {
- struct pci_dev *devices;
-};
-
-u8 pci_read_byte(struct pci_dev *dev, int pos);
-u16 pci_read_word(struct pci_dev *dev, int pos);
-u32 pci_read_long(struct pci_dev *dev, int pos);
-
-int pci_write_byte(struct pci_dev *dev, int pos, u8 data);
-int pci_write_word(struct pci_dev *dev, int pos, u16 data);
-int pci_write_long(struct pci_dev *dev, int pos, u32 data);
-
-struct pci_access *pci_alloc(void);
-void pci_init(struct pci_access*);
-void pci_cleanup(struct pci_access*);
-char *pci_filter_parse_slot(struct pci_filter*, const char*);
-int pci_filter_match(struct pci_filter*, struct pci_dev*);
-void pci_filter_init(struct pci_access*, struct pci_filter*);
-void pci_scan_bus(struct pci_access*);
-struct pci_dev *pci_get_dev(struct pci_access*, u16, u8, u8, u8);
-
-#endif
+/* + * This file is part of the libpayload project. + * + * Copyright (C) 2010 coresystems GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _PCI_PCI_H +#define _PCI_PCI_H + +/* we implement at least this version */ +#define PCI_LIB_VERSION 0x020200 + +#include <pci.h> + +#define PCI_CLASS_DEVICE REG_CLASS_DEV +#define PCI_SUBSYSTEM_VENDOR_ID REG_SUBSYS_VENDOR_ID +#define PCI_SUBSYSTEM_ID REG_SUBSYS_ID + +#define PCI_COMMAND REG_COMMAND +#define PCI_COMMAND_IO REG_COMMAND_IO +#define PCI_COMMAND_MEMORY REG_COMMAND_MEM +#define PCI_COMMAND_MASTER REG_COMMAND_BM + +#define PCI_HEADER_TYPE REG_HEADER_TYPE +#define PCI_HEADER_TYPE_NORMAL HEADER_TYPE_NORMAL +#define PCI_HEADER_TYPE_BRIDGE HEADER_TYPE_BRIDGE +#define PCI_HEADER_TYPE_CARDBUS HEADER_TYPE_CARDBUS + +#define PCI_BASE_ADDRESS_0 0x10 +#define PCI_BASE_ADDRESS_1 0x14 +#define PCI_BASE_ADDRESS_2 0x18 +#define PCI_BASE_ADDRESS_3 0x1c +#define PCI_BASE_ADDRESS_4 0x20 +#define PCI_BASE_ADDRESS_5 0x24 +#define PCI_BASE_ADDRESS_SPACE 1 // mask +#define PCI_BASE_ADDRESS_SPACE_IO 1 +#define PCI_BASE_ADDRESS_SPACE_MEM 0 +#define PCI_BASE_ADDRESS_IO_MASK ~0xf +#define PCI_BASE_ADDRESS_MEM_MASK ~0x3 + +#define PCI_ROM_ADDRESS 0x30 +#define PCI_ROM_ADDRESS1 0x38 // on bridges +#define PCI_ROM_ADDRESS_MASK ~0x7ff + +#define PCI_VENDOR_ID_INTEL 0x8086 + +struct pci_dev { + u16 domain; + u8 bus, dev, func; + u16 vendor_id, device_id; + struct pci_dev *next; +}; + +/* + * values to match devices against. + * "-1" means "don't care", everything else requires an exact match + */ +struct pci_filter { + int domain, bus, dev, func; + int vendor, device; + struct pci_dev *devices; +}; + +struct pci_access { + struct pci_dev *devices; +}; + +u8 pci_read_byte(struct pci_dev *dev, int pos); +u16 pci_read_word(struct pci_dev *dev, int pos); +u32 pci_read_long(struct pci_dev *dev, int pos); + +int pci_write_byte(struct pci_dev *dev, int pos, u8 data); +int pci_write_word(struct pci_dev *dev, int pos, u16 data); +int pci_write_long(struct pci_dev *dev, int pos, u32 data); + +struct pci_access *pci_alloc(void); +void pci_init(struct pci_access*); +void pci_cleanup(struct pci_access*); +char *pci_filter_parse_slot(struct pci_filter*, const char*); +int pci_filter_match(struct pci_filter*, struct pci_dev*); +void pci_filter_init(struct pci_access*, struct pci_filter*); +void pci_scan_bus(struct pci_access*); +struct pci_dev *pci_get_dev(struct pci_access*, u16, u8, u8, u8); + +#endif diff --git a/payloads/libpayload/include/term.h b/payloads/libpayload/include/term.h index ce6bc4fae6..caacbdf7c4 100644 --- a/payloads/libpayload/include/term.h +++ b/payloads/libpayload/include/term.h @@ -2,9 +2,9 @@ /* $Id: term.h,v 1.16 2008/07/13 16:08:16 wmcbrine Exp $ */ -/* PDCurses doesn't operate with terminfo, but we need these functions for - compatibility, to allow some things (notably, interface libraries for - other languages) to be compiled. Anyone who tries to actually _use_ +/* PDCurses doesn't operate with terminfo, but we need these functions for + compatibility, to allow some things (notably, interface libraries for + other languages) to be compiled. Anyone who tries to actually _use_ them will be disappointed, since they only return ERR. */ #ifndef __PDCURSES_TERM_H__ @@ -46,7 +46,7 @@ char *tgoto(const char *, int, int); int tigetflag(const char *); int tigetnum(const char *); char *tigetstr(const char *); -char *tparm(const char *, long, long, long, long, long, +char *tparm(const char *, long, long, long, long, long, long, long, long, long); int tputs(const char *, int, int (*)(int)); diff --git a/payloads/libpayload/libc/qsort.c b/payloads/libpayload/libc/qsort.c index f28449fb5b..c684333b03 100644 --- a/payloads/libpayload/libc/qsort.c +++ b/payloads/libpayload/libc/qsort.c @@ -56,7 +56,7 @@ static __inline void swapfunc(char *, char *, size_t, int); static __inline void swapfunc(char *a, char *b, size_t n, int swaptype) { - if (swaptype <= 1) + if (swaptype <= 1) swapcode(long, a, b, n) else swapcode(char, a, b, n) @@ -139,7 +139,7 @@ loop: SWAPINIT(a, es); } if (swap_cnt == 0) { /* Switch to insertion sort */ for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) - for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; pl -= es) swap(pl, pl - es); return; @@ -152,7 +152,7 @@ loop: SWAPINIT(a, es); vecswap(pb, pn - r, r); if ((r = pb - pa) > es) qsort(a, r / es, es, cmp); - if ((r = pd - pc) > es) { + if ((r = pd - pc) > es) { /* Iterate rather than recurse to save stack space */ a = pn - r; n = r / es; diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index 203e770e47..ecc2b25c91 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -181,7 +181,7 @@ static struct pci_dev *pci_scan_single_bus(struct pci_dev *dev, int bus) dev->vendor_id = val & 0xffff; dev->device_id = val >> 16; dev->next = 0; - + hdr = pci_read_config8(PCI_DEV(bus, slot, func), REG_HEADER_TYPE); hdr &= 0x7F; |