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>
This commit is contained in:
Stefan Reinauer
2011-10-31 12:54:00 -07:00
committed by Patrick Georgi
parent dd69063289
commit e11835e299
139 changed files with 1259 additions and 1259 deletions

View File

@ -180,8 +180,8 @@ typedef struct
#define BUTTON3_TRIPLE_CLICKED 0x00004000L #define BUTTON3_TRIPLE_CLICKED 0x00004000L
#define BUTTON3_MOVED 0x00004000L /* PDCurses */ #define BUTTON3_MOVED 0x00004000L /* PDCurses */
/* For the ncurses-compatible functions only, BUTTON4_PRESSED and /* For the ncurses-compatible functions only, BUTTON4_PRESSED and
BUTTON5_PRESSED are returned for mouse scroll wheel up and down; BUTTON5_PRESSED are returned for mouse scroll wheel up and down;
otherwise PDCurses doesn't support buttons 4 and 5 */ otherwise PDCurses doesn't support buttons 4 and 5 */
#define BUTTON4_RELEASED 0x00008000L #define BUTTON4_RELEASED 0x00008000L
@ -261,7 +261,7 @@ typedef struct _win /* definition of a window */
struct _win *_parent; /* subwin's pointer to parent win */ struct _win *_parent; /* subwin's pointer to parent win */
} WINDOW; } 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. */ functions if possible. This struct may eventually be made private. */
typedef struct typedef struct
@ -287,12 +287,12 @@ typedef struct
unsigned long _trap_mbe; /* trap these mouse button events */ unsigned long _trap_mbe; /* trap these mouse button events */
unsigned long _map_mbe_to_key; /* map mouse buttons to slk */ unsigned long _map_mbe_to_key; /* map mouse buttons to slk */
int mouse_wait; /* time to wait (in ms) for a 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 */ order to count it as a click */
int slklines; /* lines in use by slk_init() */ int slklines; /* lines in use by slk_init() */
WINDOW *slk_winptr; /* window for slk */ WINDOW *slk_winptr; /* window for slk */
int linesrippedoff; /* lines ripped off via ripoffline() */ int linesrippedoff; /* lines ripped off via ripoffline() */
int linesrippedoffontop; /* lines ripped off on int linesrippedoffontop; /* lines ripped off on
top via ripoffline() */ top via ripoffline() */
int delaytenths; /* 1/10ths second to wait block int delaytenths; /* 1/10ths second to wait block
getch() for */ getch() for */
@ -352,13 +352,13 @@ PDCEX char ttytype[]; /* terminal name/description */
PDCurses Text Attributes PDCurses Text Attributes
======================== ========================
Originally, PDCurses used a short (16 bits) for its chtype. To include 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 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 System V support. The main problem was fitting all character attributes
and color into an unsigned char (all 8 bits!). and color into an unsigned char (all 8 bits!).
Today, PDCurses by default uses a long (32 bits) for its chtype, as in 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 System V. The short chtype is still available, by undefining CHTYPE_LONG
and rebuilding the library. and rebuilding the library.
The following is the structure of a win->_attrs chtype: The following is the structure of a win->_attrs chtype:
@ -370,9 +370,9 @@ short form:
------------------------------------------------- -------------------------------------------------
color number | attrs | character eg 'a' color number | attrs | character eg 'a'
The available non-color attributes are bold, reverse and blink. Others 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 have no effect. The high order char is an index into an array of
physical colors (defined in color.c) -- 32 foreground/background color physical colors (defined in color.c) -- 32 foreground/background color
pairs (5 bits) plus 3 bits for other attributes. pairs (5 bits) plus 3 bits for other attributes.
long form: long form:
@ -382,8 +382,8 @@ long form:
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
color number | modifiers | character eg 'a' color number | modifiers | character eg 'a'
The available non-color attributes are bold, underline, invisible, The available non-color attributes are bold, underline, invisible,
right-line, left-line, protect, reverse and blink. 256 color pairs (8 right-line, left-line, protect, reverse and blink. 256 color pairs (8
bits), 8 bits for other attributes, and 16 bits for character data. bits), 8 bits for other attributes, and 16 bits for character data.
**man-end****************************************************************/ **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_MSK A_ATTRIBUTES /* Obsolete */
#define ATR_NRM A_NORMAL /* 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. */ this is a non-conforming implementation. */
#define WA_ALTCHARSET A_ALTCHARSET #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 ***/ /*** Alternate character set macros ***/
/* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET /* '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 */ available for A_ALTCHARSET */
#ifdef CHTYPE_LONG #ifdef CHTYPE_LONG
@ -888,7 +888,7 @@ void bkgdset(chtype);
int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype); int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
int box(WINDOW *, chtype, chtype); int box(WINDOW *, chtype, chtype);
bool can_change_color(void); bool can_change_color(void);
int cbreak(void); int cbreak(void);
int chgat(int, attr_t, short, const void *); int chgat(int, attr_t, short, const void *);
int clearok(WINDOW *, bool); int clearok(WINDOW *, bool);
int clear(void); int clear(void);
@ -903,7 +903,7 @@ int def_shell_mode(void);
int delay_output(int); int delay_output(int);
int delch(void); int delch(void);
int deleteln(void); int deleteln(void);
void delscreen(SCREEN *); void delscreen(SCREEN *);
int delwin(WINDOW *); int delwin(WINDOW *);
WINDOW *derwin(WINDOW *, int, int, int, int); WINDOW *derwin(WINDOW *, int, int, int, int);
int doupdate(void); int doupdate(void);
@ -1141,8 +1141,8 @@ int addwstr(const wchar_t *);
int add_wch(const cchar_t *); int add_wch(const cchar_t *);
int add_wchnstr(const cchar_t *, int); int add_wchnstr(const cchar_t *, int);
int add_wchstr(const cchar_t *); int add_wchstr(const cchar_t *);
int border_set(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 *, 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 box_set(WINDOW *, const cchar_t *, const cchar_t *);
int echo_wchar(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 *); int wbkgrnd(WINDOW *, const cchar_t *);
void wbkgrndset(WINDOW *, const cchar_t *); void wbkgrndset(WINDOW *, const cchar_t *);
int wborder_set(WINDOW *, const cchar_t *, 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 *); const cchar_t *, const cchar_t *, const cchar_t *);
int wecho_wchar(WINDOW *, const cchar_t *); int wecho_wchar(WINDOW *, const cchar_t *);
int wgetbkgrnd(WINDOW *, cchar_t *); int wgetbkgrnd(WINDOW *, cchar_t *);

View File

@ -41,7 +41,7 @@ int main(int argc, char **argv)
seed = time((time_t *)0); seed = time((time_t *)0);
srand(seed); srand(seed);
flag = 0; flag = 0;
while (getch() == ERR) /* loop until a key is hit */ while (getch() == ERR) /* loop until a key is hit */
{ {
do { do {

View File

@ -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. * illustrates the use of colors for text output.
* *
* Hacks by jbuhler@cs.washington.edu on 12/29/96 * Hacks by jbuhler@cs.washington.edu on 12/29/96
@ -238,7 +238,7 @@ int main(int argc, char **argv)
#endif #endif
noecho(); 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 */ overwrite the other windows that are being created */
refresh(); refresh();
@ -267,7 +267,7 @@ int main(int argc, char **argv)
wattrset(win, COLOR_PAIR(2)); wattrset(win, COLOR_PAIR(2));
box(win, ' ', ' '); box(win, ' ', ' ');
wrefresh(win); wrefresh(win);
wattrset(win, 0); wattrset(win, 0);
/* Do random output of a character */ /* Do random output of a character */

View File

@ -9,7 +9,7 @@ WINDOW *w4, *w5;
long nap_msec = 1; long nap_msec = 1;
char *mod[] = char *mod[] =
{ {
"test ", "TEST ", "(**) ", "*()* ", "<--> ", "LAST " "test ", "TEST ", "(**) ", "*()* ", "<--> ", "LAST "
}; };
@ -84,7 +84,7 @@ void fill_panel(PANEL *pan)
char num = *((char *)pan->user + 1); char num = *((char *)pan->user + 1);
int y, x, maxy, maxx; int y, x, maxy, maxx;
box(win, 0, 0); box(win, 0, 0);
mvwprintw(win, 1, 1, "-pan%c-", num); mvwprintw(win, 1, 1, "-pan%c-", num);
getmaxyx(win, maxy, maxx); getmaxyx(win, maxy, maxx);

View File

@ -343,7 +343,7 @@ void inputTest(WINDOW *win)
sw = w / 3; sw = w / 3;
sh = h / 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) == NULL)
return; return;
@ -424,11 +424,11 @@ void inputTest(WINDOW *win)
else if (BUTTON_CHANGED(3)) else if (BUTTON_CHANGED(3))
button = 3; button = 3;
if (button && (BUTTON_STATUS(button) & if (button && (BUTTON_STATUS(button) &
BUTTON_MODIFIER_MASK)) BUTTON_MODIFIER_MASK))
{ {
waddstr(win, " Modifier(s):"); waddstr(win, " Modifier(s):");
if (BUTTON_STATUS(button) & BUTTON_SHIFT) if (BUTTON_STATUS(button) & BUTTON_SHIFT)
waddstr(win, " SHIFT"); waddstr(win, " SHIFT");
@ -611,7 +611,7 @@ void outputTest(WINDOW *win)
wmove(win1, 8, 26); wmove(win1, 8, 26);
wrefresh(win1); wrefresh(win1);
wgetch(win1); wgetch(win1);
wclear(win1); wclear(win1);
wattron(win1, A_BLINK); wattron(win1, A_BLINK);
@ -892,7 +892,7 @@ void acsTest(WINDOW *win)
"ACS_LARROW", "ACS_RARROW", "ACS_UARROW", "ACS_DARROW", "ACS_LARROW", "ACS_RARROW", "ACS_UARROW", "ACS_DARROW",
"ACS_BOARD", "ACS_LANTERN", "ACS_BLOCK" "ACS_BOARD", "ACS_LANTERN", "ACS_BLOCK"
#ifdef ACS_S3 #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" "ACS_PI", "ACS_NEQUAL", "ACS_STERLING"
#endif #endif
}; };
@ -902,17 +902,17 @@ void acsTest(WINDOW *win)
#if HAVE_WIDE #if HAVE_WIDE
cchar_t *wacs_values[] = cchar_t *wacs_values[] =
{ {
WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER, WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER,
WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE, WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE,
WACS_VLINE, WACS_PLUS, 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_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 WACS_LANTERN, WACS_BLOCK
# ifdef WACS_S3 # 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 WACS_NEQUAL, WACS_STERLING
# endif # endif
}; };
@ -923,7 +923,7 @@ void acsTest(WINDOW *win)
static const wchar_t greek[] = {0x0395, 0x03bb, 0x03bb, 0x03b7, static const wchar_t greek[] = {0x0395, 0x03bb, 0x03bb, 0x03b7,
0x03bd, 0x03b9, 0x03ba, 0x03ac, 0}; 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}; 0x10e3, 0x10da, 0x10d8, L' ', 0x10d4, 0x10dc, 0x10d0, 0};
#endif #endif
@ -993,13 +993,13 @@ void colorTest(WINDOW *win)
{ {
static const short colors[] = 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 COLOR_CYAN, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE
}; };
static const char *colornames[] = 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" "COLOR_CYAN", "COLOR_MAGENTA", "COLOR_YELLOW", "COLOR_WHITE"
}; };

View File

@ -65,7 +65,7 @@ static bool incurses = FALSE;
#ifndef PDCURSES #ifndef PDCURSES
static char wordchar(void) static char wordchar(void)
{ {
return 0x17; /* ^W */ return 0x17; /* ^W */
} }
#endif #endif
@ -110,13 +110,13 @@ static void initcolor(void)
/* foreground, background */ /* foreground, background */
init_pair(TITLECOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN); init_pair(TITLECOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN);
init_pair(MAINMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); init_pair(MAINMENUCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN);
init_pair(MAINMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); init_pair(MAINMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK);
init_pair(SUBMENUCOLOR & ~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(SUBMENUREVCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK);
init_pair(BODYCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLUE); init_pair(BODYCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLUE);
init_pair(STATUSCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN); init_pair(STATUSCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_CYAN);
init_pair(INPUTBOXCOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN); init_pair(INPUTBOXCOLOR & ~A_ATTR, COLOR_BLACK, COLOR_CYAN);
init_pair(EDITBOXCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK); init_pair(EDITBOXCOLOR & ~A_ATTR, COLOR_WHITE, COLOR_BLACK);
#endif #endif
@ -152,7 +152,7 @@ static void colorbox(WINDOW *win, chtype color, int hasbox)
#endif #endif
wbkgd(win, attr); wbkgd(win, attr);
werase(win); werase(win);
#ifdef PDCURSES #ifdef PDCURSES
maxy = getmaxy(win); maxy = getmaxy(win);
@ -181,7 +181,7 @@ static void idle(void)
tp->tm_hour, tp->tm_min, tp->tm_sec); tp->tm_hour, tp->tm_min, tp->tm_sec);
mvwaddstr(wtitl, 0, bw - strlen(buf) - 2, buf); mvwaddstr(wtitl, 0, bw - strlen(buf) - 2, buf);
wrefresh(wtitl); wrefresh(wtitl);
} }
static void menudim(menu *mp, int *lines, int *columns) static void menudim(menu *mp, int *lines, int *columns)
@ -264,7 +264,7 @@ static void mainmenu(menu *mp)
{ {
if (old != -1) if (old != -1)
{ {
mvwaddstr(wmain, 0, old * barlen, mvwaddstr(wmain, 0, old * barlen,
prepad(padstr(mp[old].name, barlen - 1), 1)); prepad(padstr(mp[old].name, barlen - 1), 1));
statusmsg(mp[cur].desc); statusmsg(mp[cur].desc);
@ -274,7 +274,7 @@ static void mainmenu(menu *mp)
setcolor(wmain, MAINMENUREVCOLOR); setcolor(wmain, MAINMENUREVCOLOR);
mvwaddstr(wmain, 0, cur * barlen, mvwaddstr(wmain, 0, cur * barlen,
prepad(padstr(mp[cur].name, barlen - 1), 1)); prepad(padstr(mp[cur].name, barlen - 1), 1));
setcolor(wmain, MAINMENUCOLOR); setcolor(wmain, MAINMENUCOLOR);
@ -472,7 +472,7 @@ void domenu(menu *mp)
if (cur != old) if (cur != old)
{ {
if (old != -1) if (old != -1)
mvwaddstr(wmenu, old + 1, 1, mvwaddstr(wmenu, old + 1, 1,
prepad(padstr(mp[old].name, barlen - 1), 1)); prepad(padstr(mp[old].name, barlen - 1), 1));
setcolor(wmenu, SUBMENUREVCOLOR); setcolor(wmenu, SUBMENUREVCOLOR);
@ -596,7 +596,7 @@ static void repainteditbox(WINDOW *win, int x, char *buf)
werase(win); werase(win);
mvwprintw(win, 0, 0, "%s", padstr(buf, maxx)); mvwprintw(win, 0, 0, "%s", padstr(buf, maxx));
wmove(win, 0, x); wmove(win, 0, x);
wrefresh(win); wrefresh(win);
} }
/* /*
@ -605,15 +605,15 @@ static void repainteditbox(WINDOW *win, int x, char *buf)
Description: Description:
The initial value of 'str' with a maximum length of 'field' - 1, The initial value of 'str' with a maximum length of 'field' - 1,
which is supplied by the calling routine, is editted. The user's which is supplied by the calling routine, is editted. The user's
erase (^H), kill (^U) and delete word (^W) chars are interpreted. erase (^H), kill (^U) and delete word (^W) chars are interpreted.
The PC insert or Tab keys toggle between insert and edit mode. The PC insert or Tab keys toggle between insert and edit mode.
Escape aborts the edit session, leaving 'str' unchanged. Escape aborts the edit session, leaving 'str' unchanged.
Enter, Up or Down Arrow are used to accept the changes to 'str'. Enter, Up or Down Arrow are used to accept the changes to 'str'.
NOTE: editstr(), mveditstr(), and mvweditstr() are macros. NOTE: editstr(), mveditstr(), and mvweditstr() are macros.
Return Value: 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. Enter, Up or Down Arrow) and ERR on error.
Errors: Errors:
@ -707,9 +707,9 @@ int weditstr(WINDOW *win, char *buf, int field)
{ {
tp = bp; tp = bp;
while ((bp > buf) && (*(bp - 1) == ' ')) while ((bp > buf) && (*(bp - 1) == ' '))
bp--; bp--;
while ((bp > buf) && (*(bp - 1) != ' ')) while ((bp > buf) && (*(bp - 1) != ' '))
bp--; bp--;
memmove((void *)bp, (const void *)tp, strlen(tp) + 1); memmove((void *)bp, (const void *)tp, strlen(tp) + 1);
@ -739,7 +739,7 @@ int weditstr(WINDOW *win, char *buf, int field)
if (!*bp) if (!*bp)
bp[1] = '\0'; bp[1] = '\0';
*bp++ = c; *bp++ = c;
} }
} }
@ -784,7 +784,7 @@ int getstrings(char *desc[], char *buf[], int field)
getyx(wbody, oldy, oldx); getyx(wbody, oldy, oldx);
getmaxyx(wbody, maxy, maxx); getmaxyx(wbody, maxy, maxx);
winput = mvwinputbox(wbody, (maxy - nlines) / 2, (maxx - ncols) / 2, winput = mvwinputbox(wbody, (maxy - nlines) / 2, (maxx - ncols) / 2,
nlines, ncols); nlines, ncols);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)

View File

@ -23,7 +23,7 @@
typedef void (*FUNC)(void); typedef void (*FUNC)(void);
typedef struct typedef struct
{ {
char *name; /* item label */ char *name; /* item label */
FUNC func; /* (pointer to) function */ FUNC func; /* (pointer to) function */

View File

@ -31,7 +31,7 @@
void address(void) void address(void)
{ {
char *fieldname[6] = char *fieldname[6] =
{ {
"Name", "Street", "City", "State", "Country", (char *)0 "Name", "Street", "City", "State", "Country", (char *)0
}; };

View File

@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/13 16:08:17 wmcbrine Exp $")
int PDC_clearclipboard(void); int PDC_clearclipboard(void);
Description: Description:
PDC_getclipboard() gets the textual contents of the system's PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard(). 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. 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. clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard. 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: Return Values:
indicator of success/failure of call. indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful 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 the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support PDC_CLIP_ACCESS_ERROR no clipboard support
@ -98,10 +98,10 @@ int PDC_freeclipboard(char *contents)
if (contents) if (contents)
{ {
/* NOTE: We free the memory, but we can not set caller's pointer /* 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 to NULL, so if caller calls again then will try to access
free'd memory. We 1st overwrite memory with a string so if free'd memory. We 1st overwrite memory with a string so if
caller tries to use free memory they won't get what they caller tries to use free memory they won't get what they
expect & hopefully notice. */ expect & hopefully notice. */
/* memset(contents, 0xFD, strlen(contents)); */ /* memset(contents, 0xFD, strlen(contents)); */
@ -119,7 +119,7 @@ int PDC_clearclipboard(void)
{ {
PDC_LOG(("PDC_clearclipboard() - called\n")); PDC_LOG(("PDC_clearclipboard() - called\n"));
if (pdc_DOS_clipboard) if (pdc_DOS_clipboard)
{ {
free(pdc_DOS_clipboard); free(pdc_DOS_clipboard);
pdc_DOS_clipboard = NULL; pdc_DOS_clipboard = NULL;

View File

@ -13,10 +13,10 @@ RCSID("$Id: pdcdisp.c,v 1.65 2008/07/13 16:08:17 wmcbrine Exp $")
chtype acs_map[128] = 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(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(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(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
')', '*', ')', '*',
A(0x1a), A(0x1b), A(0x18), A(0x19), A(0x1a), A(0x1b), A(0x18), A(0x19),
@ -25,17 +25,17 @@ chtype acs_map[128] =
0xdb, 0xdb,
'1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
'>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
A(0x04), 0xb1, A(0x04), 0xb1,
'b', 'c', 'd', 'e', 'b', 'c', 'd', 'e',
0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d,
0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3,
0xd8, 0x9c, 0xf9, 0xd8, 0x9c, 0xf9,
A(127) A(127)
@ -72,7 +72,7 @@ void PDC_gotoyx(int row, int col)
PDCINT(0x10, regs); 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 */ curscr */
void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) 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]; 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 */ color value for each chtype in the line */
for (j = 0; j < len; j++) for (j = 0; j < len; j++)

View File

@ -117,7 +117,7 @@ typedef union
struct struct
{ {
unsigned short di, di_hi, si, si_hi, bp, bp_hi, res, res_hi, 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; flags, es, ds, fs, gs, ip, cs, sp, ss;
} w; } w;

View File

@ -1,5 +1,5 @@
/* Public Domain Curses */ /* Public Domain Curses */
/* MS C doesn't return flags from int86() */ /* MS C doesn't return flags from int86() */
#ifdef MSC #ifdef MSC
# define USE_KBHIT # 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); unsigned long PDC_get_input_fd(void);
Description: 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(). reads its input from. It can be used for select().
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -277,7 +277,7 @@ static int _process_mouse_events(void)
{ {
if (button[i].pressed) if (button[i].pressed)
{ {
/* Check for a click -- a PRESS followed /* Check for a click -- a PRESS followed
immediately by a release */ immediately by a release */
if (!button[i].released) if (!button[i].released)
@ -451,14 +451,14 @@ int PDC_get_key(void)
return key; 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() */ routine for flushinp() */
void PDC_flushinp(void) void PDC_flushinp(void)
{ {
PDC_LOG(("PDC_flushinp() - called\n")); 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... */ the same... Real nasty trick... */
setdosmemword(0x41a, getdosmemword(0x41c)); setdosmemword(0x41a, getdosmemword(0x41c));

View File

@ -84,10 +84,10 @@ static int _get_font(void)
return retval; return retval;
} }
/* _set_font() - Sets the current font size, if the adapter allows such a /* _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 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 "bogus" adapter. The reason for this is that we have a known video
adapter identity problem. e.g. Two adapters report the same identifying adapter identity problem. e.g. Two adapters report the same identifying
characteristics. */ characteristics. */
static void _set_font(int size) static void _set_font(int size)
@ -154,7 +154,7 @@ static void _set_font(int size)
pdc_font = _get_font(); 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. */ appropriate 80x25 alpha mode given the display adapter. */
static void _set_80x25(void) static void _set_80x25(void)
@ -193,7 +193,7 @@ static int _get_scrn_mode(void)
return (int)regs.h.al; 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. */ different from the current video mode. */
static void _set_scrn_mode(int new_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(); 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. */ routine will force sane values for various control flags. */
static int _sanity_check(int adapter) static int _sanity_check(int adapter)
@ -230,7 +230,7 @@ static int _sanity_check(int adapter)
switch (rows) switch (rows)
{ {
case 25: case 25:
case 43: case 43:
break; break;
default: default:
pdc_bogus_adapter = TRUE; pdc_bogus_adapter = TRUE;
@ -445,7 +445,7 @@ static int _query_adapter_type(void)
return _sanity_check(retval); 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 */ before PDC_scr_open(); miscellaneous cleanup */
void PDC_scr_close(void) void PDC_scr_close(void)
@ -503,7 +503,7 @@ void PDC_scr_free(void)
pdc_atrtab = (unsigned char *)NULL; 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 */ and may save the existing screen for later restoration */
int PDC_scr_open(int argc, char **argv) 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->mouse_wait = PDC_CLICK_PERIOD;
SP->audible = TRUE; 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. */ BIOS calls are used in place of direct video memory access. */
if (getenv("PDCURSES_BIOS")) 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", PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n",
nlines, ncols)); 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 */ video mode doesn't change */
SP->orig_cursor = 0x0607; SP->orig_cursor = 0x0607;

View File

@ -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 PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE. FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses 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 */ /* if scrnmode is not set, some BIOSes hang */
regs.h.ah = 0x01; 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.ch = (unsigned char)start;
regs.h.cl = (unsigned char)end; regs.h.cl = (unsigned char)end;
PDCINT(0x10, regs); PDCINT(0x10, regs);

View File

@ -15,14 +15,14 @@ RCSID("$Id: pdcclip.c,v 1.33 2008/07/14 04:24:51 wmcbrine Exp $")
int PDC_clearclipboard(void); int PDC_clearclipboard(void);
Description: Description:
PDC_getclipboard() gets the textual contents of the system's PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard(). 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. 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. clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard. 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: Return Values:
indicator of success/failure of call. indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful 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 the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support PDC_CLIP_ACCESS_ERROR no clipboard support

View File

@ -4,7 +4,7 @@
RCSID("$Id: pdcdisp.c,v 1.49 2008/07/14 04:24:51 wmcbrine Exp $") 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.) */ match code page 437 and compatible pages (CP850, CP852, etc.) */
#ifdef CHTYPE_LONG #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)); 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 */ actual color value for each chtype in the line */
for (j = 0; j < len; j++) for (j = 0; j < len; j++)

View File

@ -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); unsigned long PDC_get_input_fd(void);
Description: 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(). reads its input from. It can be used for select().
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -147,12 +147,12 @@ bool PDC_check_key(void)
#ifdef EMXVIDEO #ifdef EMXVIDEO
if (tahead == -1) /* Nothing typed yet */ if (tahead == -1) /* Nothing typed yet */
{ {
tahead = _read_kbd(0, 0, 0); tahead = _read_kbd(0, 0, 0);
/* Read additional */ /* Read additional */
if (tahead == 0) if (tahead == 0)
tahead = _read_kbd(0, 1, 0) << 8; tahead = _read_kbd(0, 1, 0) << 8;
} }
@ -189,7 +189,7 @@ bool PDC_check_key(void)
return kbhit(); return kbhit();
# endif # endif
#endif #endif
} }
#ifndef EMXVIDEO #ifndef EMXVIDEO
@ -212,8 +212,8 @@ static int _process_mouse_events(void)
((event.fs & move_mask[i]) ? BUTTON_MOVED : 0) | ((event.fs & move_mask[i]) ? BUTTON_MOVED : 0) |
((event.fs & press_mask[i]) ? BUTTON_PRESSED : 0); ((event.fs & press_mask[i]) ? BUTTON_PRESSED : 0);
/* PRESS events are sometimes mistakenly reported as MOVE /* PRESS events are sometimes mistakenly reported as MOVE
events. A MOVE should always follow a PRESS, so treat a MOVE events. A MOVE should always follow a PRESS, so treat a MOVE
immediately after a RELEASE as a PRESS. */ immediately after a RELEASE as a PRESS. */
if ((pdc_mouse_status.button[i] == BUTTON_MOVED) && 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) 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 */ release */
if (!mouse_events) if (!mouse_events)
@ -499,10 +499,10 @@ int PDC_mouse_set(void)
USHORT mask = ((mbe & (BUTTON1_PRESSED | BUTTON1_CLICKED | USHORT mask = ((mbe & (BUTTON1_PRESSED | BUTTON1_CLICKED |
BUTTON1_MOVED)) ? 6 : 0) | BUTTON1_MOVED)) ? 6 : 0) |
((mbe & (BUTTON3_PRESSED | BUTTON3_CLICKED | ((mbe & (BUTTON3_PRESSED | BUTTON3_CLICKED |
BUTTON3_MOVED)) ? 24 : 0) | BUTTON3_MOVED)) ? 24 : 0) |
((mbe & (BUTTON2_PRESSED | BUTTON2_CLICKED | ((mbe & (BUTTON2_PRESSED | BUTTON2_CLICKED |
BUTTON2_MOVED)) ? 96 : 0); BUTTON2_MOVED)) ? 96 : 0);
MouSetEventMask(&mask, mouse_handle); MouSetEventMask(&mask, mouse_handle);

View File

@ -260,9 +260,9 @@ static bool _screen_mode_equals(VIOMODEINFO *oldmode)
return ((current.cb == oldmode->cb) && return ((current.cb == oldmode->cb) &&
(current.fbType == oldmode->fbType) && (current.fbType == oldmode->fbType) &&
(current.color == oldmode->color) && (current.color == oldmode->color) &&
(current.col == oldmode->col) && (current.col == oldmode->col) &&
(current.row == oldmode->row) && (current.row == oldmode->row) &&
(current.hres == oldmode->vres) && (current.hres == oldmode->vres) &&
(current.vres == oldmode->vres)); (current.vres == oldmode->vres));
} }

View File

@ -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 PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE. FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses PDC_set_title() sets the title of the window in which the curses

View File

@ -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 mvaddch() moves the cursor to the specified (y, x) position, and
adds ch to stdscr. mvadd_wch() is the wide version. 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. 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. 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. wrefresh(). wecho_wchar() is the wide version.
addrawch(), waddrawch(), mvaddrawch() and mvwaddrawch() are 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. translation of control characters.
The following applies to all these functions: The following applies to all these functions:
If the cursor moves on to the right margin, an automatic newline If the cursor moves on to the right margin, an automatic newline
is performed. If scrollok is enabled, and a character is added is performed. If scrollok is enabled, and a character is added
to the bottom right corner of the window, the scrolling region 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 scrolled up one line. If scrolling is not allowed, ERR
will be returned. will be returned.
If ch is a tab, newline, or backspace, the cursor will be moved If ch is a tab, newline, or backspace, the cursor will be moved
appropriately within the window. If ch is a newline, the appropriately within the window. If ch is a newline, the
clrtoeol routine is called before the cursor is moved to the clrtoeol routine is called before the cursor is moved to the
beginning of the next line. If newline mapping is off, 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 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 be unchanged. If ch is a tab the cursor is moved to the next
tab position within the window. If ch is another control tab position within the window. If ch is another control
character, it will be drawn in the ^X notation. Calling the character, it will be drawn in the ^X notation. Calling the
inch() routine after adding a control character returns the inch() routine after adding a control character returns the
representation of the control character, not the control representation of the control character, not the control
character. character.
Video attributes can be combined with a character by ORing them Video attributes can be combined with a character by ORing them
into the parameter. Text, including attributes, can be copied into the parameter. Text, including attributes, can be copied
from one place to another by using inch() and addch(). from one place to another by using inch() and addch().
Note that in PDCurses, for now, a cchar_t and a chtype are the 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)) if (!(attr & A_COLOR))
attr |= win->_attrs; attr |= win->_attrs;
/* wrs (4/10/93): Apply the same sort of logic for the window /* wrs (4/10/93): Apply the same sort of logic for the window
background, in that it only takes precedence if other color background, in that it only takes precedence if other color
attributes are not there and that the background character attributes are not there and that the background character
will only print if the printing character is blank. */ will only print if the printing character is blank. */
if (!(attr & A_COLOR)) if (!(attr & A_COLOR))

View File

@ -29,15 +29,15 @@ RCSID("$Id: addchstr.c,v 1.43 2008/07/13 16:08:17 wmcbrine Exp $")
int n); int n);
Description: Description:
These routines write a chtype or cchar_t string directly into These routines write a chtype or cchar_t string directly into
the window structure, starting at the current or specified the window structure, starting at the current or specified
position. The four routines with n as the last argument copy at 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 = 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 -1 then the whole string is copied, up to the maximum number
that will fit on the line. that will fit on the line.
The cursor position is not advanced. These routines do not check The cursor position is not advanced. These routines do not check
for newline or other special characters, nor does any line for newline or other special characters, nor does any line
wrapping occur. wrapping occur.
Return Value: 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" PDC_LOG(("y %d x %d minx %d maxx %d *ptr %x *ch"
" %x firstch: %d lastch: %d\n", " %x firstch: %d lastch: %d\n",
y, x, minx, maxx, *ptr, *ch, y, x, minx, maxx, *ptr, *ch,
win->_firstch[y], win->_lastch[y])); win->_firstch[y], win->_lastch[y]));
*ptr = *ch; *ptr = *ch;

View File

@ -45,24 +45,24 @@ RCSID("$Id: attr.c,v 1.41 2008/07/13 16:08:17 wmcbrine Exp $")
chtype getattrs(WINDOW *win); chtype getattrs(WINDOW *win);
Description: Description:
These functions manipulate the current attributes and/or colors These functions manipulate the current attributes and/or colors
of the named window. These attributes can be any combination of the named window. These attributes can be any combination
of A_STANDOUT, A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE. of A_STANDOUT, A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
These constants are defined in <curses.h> and can be combined These constants are defined in <curses.h> and can be combined
with the bitwise-OR operator (|). with the bitwise-OR operator (|).
The current attributes of a window are applied to all chtypes The current attributes of a window are applied to all chtypes
that are written into the window with waddch(). Attributes are that are written into the window with waddch(). Attributes are
a property of the chtype, and move with the character through a property of the chtype, and move with the character through
any scrolling or insert/delete operations. any scrolling or insert/delete operations.
attrset() sets the current attributes of the given window to attrset() sets the current attributes of the given window to
attrs. attroff() turns off the named attributes without attrs. attroff() turns off the named attributes without
affecting any other attributes; attron() turns them on. affecting any other attributes; attron() turns them on.
color_set() sets the window color to the value of color_pair. 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. same as attrset(A_NORMAL); that is, it turns off all attributes.
Return Value: Return Value:
@ -125,7 +125,7 @@ int wattron(WINDOW *win, chtype attrs)
if (!win) if (!win)
return ERR; return ERR;
if ((win->_attrs & A_COLOR) && (attrs & A_COLOR)) if ((win->_attrs & A_COLOR) && (attrs & A_COLOR))
{ {
oldcolr = win->_attrs & A_COLOR; oldcolr = win->_attrs & A_COLOR;
oldattr = win->_attrs ^ oldcolr; oldattr = win->_attrs ^ oldcolr;

View File

@ -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). there is a conflict (e.g., different color pairs).
Return Value: 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. which case they return ERR.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -86,7 +86,7 @@ int wbkgd(WINDOW *win, chtype ch)
newch = win->_bkgd & A_CHARTEXT; 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 */ implementation of this routine */
for (y = 0; y < win->_maxy; y++) for (y = 0; y < win->_maxy; y++)
@ -97,26 +97,26 @@ int wbkgd(WINDOW *win, chtype ch)
ch = *winptr; ch = *winptr;
/* determine the colors and attributes of the character read /* determine the colors and attributes of the character read
from the window */ from the window */
colr = ch & A_COLOR; colr = ch & A_COLOR;
attr = ch & (A_ATTRIBUTES ^ 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 */ then make it the new background color, otherwise leave it */
if (colr == oldcolr) if (colr == oldcolr)
colr = newcolr; colr = newcolr;
/* remove any attributes (non color) from the character that /* remove any attributes (non color) from the character that
were part of the old background, then combine the were part of the old background, then combine the
remaining ones with the new background */ remaining ones with the new background */
attr ^= oldattr; attr ^= oldattr;
attr |= newattr; 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 */ background character */
ch &= A_CHARTEXT; ch &= A_CHARTEXT;

View File

@ -9,9 +9,9 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $")
Name: border Name: border
Synopsis: 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); 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); chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
int box(WINDOW *win, chtype verch, chtype horch); int box(WINDOW *win, chtype verch, chtype horch);
int hline(chtype ch, int n); 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); int mvwvline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n);
Description: Description:
border(), wborder(), and box() draw a border around the edge of border(), wborder(), and box() draw a border around the edge of
the window. If any argument is zero, an appropriate default is the window. If any argument is zero, an appropriate default is
used: used:
ls left side of border ACS_VLINE 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 bl bottom left corner of border ACS_LLCORNER
br bottom right corner of border ACS_LRCORNER br bottom right corner of border ACS_LRCORNER
hline() and whline() draw a horizontal line, using ch, starting hline() and whline() draw a horizontal line, using ch, starting
from the current cursor position. The cursor position does not from the current cursor position. The cursor position does not
change. The line is at most n characters long, or as many as change. The line is at most n characters long, or as many as
will fit in the window. will fit in the window.
vline() and wvline() draw a vertical line, using ch, starting vline() and wvline() draw a vertical line, using ch, starting
from the current cursor position. The cursor position does not from the current cursor position. The cursor position does not
change. The line is at most n characters long, or as many as change. The line is at most n characters long, or as many as
will fit in the window. will fit in the window.
Return Value: Return Value:
@ -94,28 +94,28 @@ RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $")
**man-end****************************************************************/ **man-end****************************************************************/
/* _attr_passthru() -- Takes a single chtype 'ch' and checks if the /* _attr_passthru() -- Takes a single chtype 'ch' and checks if the
current attribute of window 'win', as set by wattrset(), and/or 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 current background of win, as set by wbkgd(), should by combined with
it. Attributes set explicitly in ch take precedence. */ it. Attributes set explicitly in ch take precedence. */
static chtype _attr_passthru(WINDOW *win, chtype ch) static chtype _attr_passthru(WINDOW *win, chtype ch)
{ {
chtype attr; chtype attr;
/* If the incoming character doesn't have its own attribute, then /* If the incoming character doesn't have its own attribute, then
use the current attributes for the window. If the incoming use the current attributes for the window. If the incoming
character has attributes, but not a color component, OR the character has attributes, but not a color component, OR the
attributes to the current attributes for the window. If the attributes to the current attributes for the window. If the
incoming character has a color component, use only the attributes incoming character has a color component, use only the attributes
from the incoming character. */ from the incoming character. */
attr = ch & A_ATTRIBUTES; attr = ch & A_ATTRIBUTES;
if (!(attr & A_COLOR)) if (!(attr & A_COLOR))
attr |= win->_attrs; attr |= win->_attrs;
/* wrs (4/10/93) -- Apply the same sort of logic for the window /* wrs (4/10/93) -- Apply the same sort of logic for the window
background, in that it only takes precedence if other color background, in that it only takes precedence if other color
attributes are not there. */ attributes are not there. */
if (!(attr & A_COLOR)) if (!(attr & A_COLOR))
@ -128,7 +128,7 @@ static chtype _attr_passthru(WINDOW *win, chtype ch)
return 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) chtype tl, chtype tr, chtype bl, chtype br)
{ {
int i, ymax, xmax; int i, ymax, xmax;

View File

@ -19,14 +19,14 @@ RCSID("$Id: clear.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $")
int wclrtoeol(WINDOW *win); int wclrtoeol(WINDOW *win);
Description: 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. every cell of the window.
clear() and wclear() are similar to erase() and werase(), but 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(). 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. cursor position to the end of the window.
clrtoeol() and wclrtoeol() clear the window from the current clrtoeol() and wclrtoeol() clear the window from the current

View File

@ -24,10 +24,10 @@ RCSID("$Id: color.c,v 1.83 2008/07/13 16:08:18 wmcbrine Exp $")
Description: Description:
To use these routines, start_color() must be called, usually To use these routines, start_color() must be called, usually
immediately after initscr(). Colors are always used in pairs, immediately after initscr(). Colors are always used in pairs,
referred to as color-pairs. A color-pair consists of a referred to as color-pairs. A color-pair consists of a
foreground color and a background color. A color-pair is foreground color and a background color. A color-pair is
initialized via init_pair(). After initialization, COLOR_PAIR(n) initialized via init_pair(). After initialization, COLOR_PAIR(n)
can be used like any other video attribute. can be used like any other video attribute.
start_color() initializes eight basic colors (black, red, green, 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 maximum number of colors and color-pairs the terminal is capable
of displaying). of displaying).
init_pair() changes the definition of a color-pair. It takes init_pair() changes the definition of a color-pair. It takes
three arguments: the number of the color-pair to be redefined, three arguments: the number of the color-pair to be redefined,
and the new values of the foreground and background colors. The and the new values of the foreground and background colors. The
pair number must be between 0 and COLOR_PAIRS - 1, inclusive. pair number must be between 0 and COLOR_PAIRS - 1, inclusive.
The foreground and background must be between 0 and COLORS - 1, The foreground and background must be between 0 and COLORS - 1,
inclusive. If the color pair was previously initialized, the inclusive. If the color pair was previously initialized, the
screen is refreshed, and all occurrences of that color-pair are screen is refreshed, and all occurrences of that color-pair are
changed to the new definition. 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. maniplulate color. It returns TRUE or FALSE.
can_change_color() indicates if the terminal has the capability 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); _normalize(&fg, &bg);
/* To allow the PDC_PRESERVE_SCREEN option to work, we only reset /* 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 curscr if this call to init_pair() alters a color pair created by
the user. */ the user. */
if (pair_set[pair]) 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); return PDC_color_content(color, red, green, blue);
else else
{ {
/* Simulated values for platforms that don't support palette /* Simulated values for platforms that don't support palette
changing */ changing */
short maxval = (color & 8) ? 1000 : 680; short maxval = (color & 8) ? 1000 : 680;

View File

@ -14,12 +14,12 @@ RCSID("$Id: debug.c,v 1.7 2008/07/13 16:08:18 wmcbrine Exp $")
void PDC_debug(const char *, ...); void PDC_debug(const char *, ...);
Description: Description:
traceon() and traceoff() toggle the recording of debugging traceon() and traceoff() toggle the recording of debugging
information to the file "trace". Although not standard, similar information to the file "trace". Although not standard, similar
functions are in some other curses implementations. functions are in some other curses implementations.
PDC_debug() is the function that writes to the file, based on PDC_debug() is the function that writes to the file, based on
whether traceon() has been called. It's used from the PDC_LOG() whether traceon() has been called. It's used from the PDC_LOG()
macro. macro.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -43,7 +43,7 @@ void PDC_debug(const char *fmt, ...)
time_t now; time_t now;
if (!pdc_trace_on) if (!pdc_trace_on)
return; return;
/* open debug log file append */ /* open debug log file append */

View File

@ -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 current line are moved up one line. The bottom line of the
window is cleared. The cursor position does not change. 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. 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. allow moving the cursor and inserting/deleting in one call.
Return Value: Return Value:
@ -76,7 +76,7 @@ int wdeleteln(WINDOW *win)
for (ptr = temp; (ptr - temp < win->_maxx); ptr++) for (ptr = temp; (ptr - temp < win->_maxx); ptr++)
*ptr = blank; /* make a blank line */ *ptr = blank; /* make a blank line */
if (win->_cury <= win->_bmarg) if (win->_cury <= win->_bmarg)
{ {
win->_firstch[win->_bmarg] = 0; win->_firstch[win->_bmarg] = 0;
win->_lastch[win->_bmarg] = win->_maxx - 1; win->_lastch[win->_bmarg] = win->_maxx - 1;

View File

@ -4,8 +4,8 @@
RCSID("$Id: deprec.c,v 1.6 2008/07/13 16:08:18 wmcbrine Exp $") 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 /* Deprecated functions. These should not be used, and will eventually
be removed. They're here solely for the benefit of applications that be removed. They're here solely for the benefit of applications that
linked to them in older versions of PDCurses. */ linked to them in older versions of PDCurses. */
bool PDC_check_bios_key(void) bool PDC_check_bios_key(void)

View File

@ -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); int PDC_return_key_modifiers(bool flag);
Description: Description:
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions, With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
a character is read from the terminal associated with the window. a character is read from the terminal associated with the window.
In nodelay mode, if there is no input waiting, the value ERR is In nodelay mode, if there is no input waiting, the value ERR is
returned. In delay mode, the program will hang until the system returned. In delay mode, the program will hang until the system
passes text through to the program. Depending on the setting of passes text through to the program. Depending on the setting of
cbreak(), this will be after one character or after the first cbreak(), this will be after one character or after the first
newline. Unless noecho() has been set, the character will also newline. Unless noecho() has been set, the character will also
be echoed into the designated window. be echoed into the designated window.
If keypad() is TRUE, and a function key is pressed, the token for 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 If nodelay(win, TRUE) has been called on the window and no input
is waiting, the value ERR is returned. 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(). 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. user and has not yet been read by the program.
PDC_get_key_modifiers() returns the keyboard modifiers (shift, PDC_get_key_modifiers() returns the keyboard modifiers (shift,
control, alt, numlock) effective at the time of the last getch() control, alt, numlock) effective at the time of the last getch()
call, if PDC_save_key_modifiers(TRUE) has been called before the call, if PDC_save_key_modifiers(TRUE) has been called before the
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
modifier(s) were set. PDC_return_key_modifiers() tells getch() modifier(s) were set. PDC_return_key_modifiers() tells getch()
to return modifier keys pressed alone as keystrokes (KEY_ALT_L, to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
etc.). These may not work on all platforms. 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. conflict with many DOS compiler's runtime libraries.
Return Value: 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. character or function key token.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -173,7 +173,7 @@ int wgetch(WINDOW *win)
else else
if (win->_delayms) 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) */ 1/20ths of a second (50ms) */
waitcount = win->_delayms / 50; waitcount = win->_delayms / 50;
@ -181,7 +181,7 @@ int wgetch(WINDOW *win)
waitcount = 1; 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 */ to it and it is not a pad */
if (!(win->_flags & _PAD) && ((!win->_leaveit && if (!(win->_flags & _PAD) && ((!win->_leaveit &&
@ -240,7 +240,7 @@ int wgetch(WINDOW *win)
if (!win->_use_keypad) if (!win->_use_keypad)
key = -1; key = -1;
/* filter mouse events; translate mouse clicks in the slk /* filter mouse events; translate mouse clicks in the slk
area to function keys */ area to function keys */
else if (key == KEY_MOUSE) else if (key == KEY_MOUSE)

View File

@ -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); int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
Description: Description:
These routines call wgetch() repeatedly to build a string, These routines call wgetch() repeatedly to build a string,
interpreting erase and kill characters along the way, until a interpreting erase and kill characters along the way, until a
newline or carriage return is received. When PDCurses is built newline or carriage return is received. When PDCurses is built
with wide-character support enabled, the narrow-character with wide-character support enabled, the narrow-character
functions convert the wgetch()'d values into a multibyte string functions convert the wgetch()'d values into a multibyte string
in the current locale before returning it. The resulting 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 is placed in the area pointed to by *str. The routines with n as
the last argument read at most n characters. 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. wgetstr() is, so use wgetnstr() to avoid buffer overflows.
Return Value: 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. success.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -118,7 +118,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
{ {
if (chars < n) if (chars < n)
{ {
if (oldecho) if (oldecho)
waddch(win, ch); waddch(win, ch);
*p++ = ch; *p++ = ch;
++chars; ++chars;
@ -131,7 +131,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
case _ECHAR: /* CTRL-H -- Delete character */ case _ECHAR: /* CTRL-H -- Delete character */
if (p > str) if (p > str)
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = (unsigned char)(*--p); ch = (unsigned char)(*--p);
if ((ch < ' ') && (oldecho)) if ((ch < ' ') && (oldecho))
@ -143,7 +143,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
case _DLCHAR: /* CTRL-U -- Delete line */ case _DLCHAR: /* CTRL-U -- Delete line */
while (p > str) while (p > str)
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = (unsigned char)(*--p); ch = (unsigned char)(*--p);
if ((ch < ' ') && (oldecho)) if ((ch < ' ') && (oldecho))
@ -156,7 +156,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
while ((p > str) && (*(p - 1) == ' ')) while ((p > str) && (*(p - 1) == ' '))
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
--p; /* remove space */ --p; /* remove space */
@ -164,7 +164,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
} }
while ((p > str) && (*(p - 1) != ' ')) while ((p > str) && (*(p - 1) != ' '))
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = (unsigned char)(*--p); ch = (unsigned char)(*--p);
@ -177,7 +177,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
case '\n': case '\n':
case '\r': case '\r':
stop = TRUE; stop = TRUE;
if (oldecho) if (oldecho)
waddch(win, '\n'); waddch(win, '\n');
break; break;
@ -187,7 +187,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
if (!SP->key_code && ch < 0x100) if (!SP->key_code && ch < 0x100)
{ {
*p++ = ch; *p++ = ch;
if (oldecho) if (oldecho)
waddch(win, ch); waddch(win, ch);
chars++; chars++;
} }
@ -196,7 +196,7 @@ int wgetnstr(WINDOW *win, char *str, int n)
beep(); beep();
break; break;
} }
wrefresh(win); wrefresh(win);
@ -315,7 +315,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
{ {
if (chars < n) if (chars < n)
{ {
if (oldecho) if (oldecho)
waddch(win, ch); waddch(win, ch);
*p++ = ch; *p++ = ch;
++chars; ++chars;
@ -328,7 +328,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
case _ECHAR: /* CTRL-H -- Delete character */ case _ECHAR: /* CTRL-H -- Delete character */
if (p > wstr) if (p > wstr)
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = *--p; ch = *--p;
if ((ch < ' ') && (oldecho)) if ((ch < ' ') && (oldecho))
@ -340,7 +340,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
case _DLCHAR: /* CTRL-U -- Delete line */ case _DLCHAR: /* CTRL-U -- Delete line */
while (p > wstr) while (p > wstr)
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = *--p; ch = *--p;
if ((ch < ' ') && (oldecho)) if ((ch < ' ') && (oldecho))
@ -353,7 +353,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
while ((p > wstr) && (*(p - 1) == ' ')) while ((p > wstr) && (*(p - 1) == ' '))
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
--p; /* remove space */ --p; /* remove space */
@ -361,7 +361,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
} }
while ((p > wstr) && (*(p - 1) != ' ')) while ((p > wstr) && (*(p - 1) != ' '))
{ {
if (oldecho) if (oldecho)
waddstr(win, "\b \b"); waddstr(win, "\b \b");
ch = *--p; ch = *--p;
@ -374,7 +374,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
case '\n': case '\n':
case '\r': case '\r':
stop = TRUE; stop = TRUE;
if (oldecho) if (oldecho)
waddch(win, '\n'); waddch(win, '\n');
break; break;
@ -393,7 +393,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
beep(); beep();
break; break;
} }
wrefresh(win); wrefresh(win);

View File

@ -27,12 +27,12 @@ RCSID("$Id: getyx.c,v 1.29 2008/07/15 17:13:26 wmcbrine Exp $")
int getmaxx(WINDOW *win); int getmaxx(WINDOW *win);
Description: Description:
The getyx() macro (defined in curses.h -- the prototypes here The getyx() macro (defined in curses.h -- the prototypes here
are merely illustrative) puts the current cursor position of the are merely illustrative) puts the current cursor position of the
specified window into y and x. getbegyx() and getmaxyx() return specified window into y and x. getbegyx() and getmaxyx() return
the starting coordinates and size of the specified window, the starting coordinates and size of the specified window,
respectively. getparyx() returns the starting coordinates of the respectively. getparyx() returns the starting coordinates of the
parent's window, if the specified window is a subwindow; parent's window, if the specified window is a subwindow;
otherwise it sets y and x to -1. These are all macros. otherwise it sets y and x to -1. These are all macros.
getsyx() gets the coordinates of the virtual screen cursor, and getsyx() gets the coordinates of the virtual screen cursor, and

View File

@ -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); int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
Description: Description:
The inch() functions retrieve the character and attribute from The inch() functions retrieve the character and attribute from
the current or specified window position, in the form of a the current or specified window position, in the form of a
chtype. If a NULL window is specified, (chtype)ERR is returned. chtype. If a NULL window is specified, (chtype)ERR is returned.
The in_wch() functions are the wide-character versions; instead The in_wch() functions are the wide-character versions; instead
of returning a chtype, they store a cchar_t at the address of returning a chtype, they store a cchar_t at the address
specified by wcval, and return OK or ERR. (No value is stored specified by wcval, and return OK or ERR. (No value is stored
when ERR is returned.) Note that in PDCurses, chtype and cchar_t when ERR is returned.) Note that in PDCurses, chtype and cchar_t
are the same. are the same.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -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); int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wch, int n);
Description: Description:
These routines read a chtype or cchar_t string from the window, These routines read a chtype or cchar_t string from the window,
starting at the current or specified position, and ending at the starting at the current or specified position, and ending at the
right margin, or after n elements, whichever is less. right margin, or after n elements, whichever is less.
Return Value: 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. error.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -22,23 +22,23 @@ RCSID("$Id: initscr.c,v 1.114 2008/07/13 16:08:18 wmcbrine Exp $")
const char *curses_version(void); const char *curses_version(void);
Description: Description:
initscr() should be the first curses routine called. It will initscr() should be the first curses routine called. It will
initialize all curses data structures, and arrange that the initialize all curses data structures, and arrange that the
first call to refresh() will clear the screen. In case of first call to refresh() will clear the screen. In case of
error, initscr() will write a message to standard error and end error, initscr() will write a message to standard error and end
the program. the program.
endwin() should be called before exiting or escaping from curses endwin() should be called before exiting or escaping from curses
mode temporarily. It will restore tty modes, move the cursor to mode temporarily. It will restore tty modes, move the cursor to
the lower left corner of the screen and reset the terminal into the lower left corner of the screen and reset the terminal into
the proper non-visual mode. To resume curses after a temporary the proper non-visual mode. To resume curses after a temporary
escape, call refresh() or doupdate(). 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. subsequent refresh, unless SP is NULL.
In some implementations of curses, newterm() allows the use of In some implementations of curses, newterm() allows the use of
multiple terminals. Here, it's just an alternative interface for multiple terminals. Here, it's just an alternative interface for
initscr(). It always returns SP, or NULL. initscr(). It always returns SP, or NULL.
delscreen() frees the memory allocated by newterm() or 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 usually not needed. In PDCurses, the parameter must be the
value of SP, and delscreen() sets SP to NULL. 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. for compatibility with other curses implementations.
resize_term() is effectively two functions: When called with resize_term() is effectively two functions: When called with
nonzero values for nlines and ncols, it attempts to resize the nonzero values for nlines and ncols, it attempts to resize the
screen to the given size. When called with (0, 0), it merely screen to the given size. When called with (0, 0), it merely
adjusts the internal structures to match the current size after adjusts the internal structures to match the current size after
the screen is resized by the user. On the currently supported the screen is resized by the user. On the currently supported
platforms, this functionality is mutually exclusive: X11 allows platforms, this functionality is mutually exclusive: X11 allows
user resizing, while DOS, OS/2 and Win32 allow programmatic user resizing, while DOS, OS/2 and Win32 allow programmatic
resizing. If you want to support user resizing, you should check resizing. If you want to support user resizing, you should check
for getch() returning KEY_RESIZE, and/or call is_termresized() for getch() returning KEY_RESIZE, and/or call is_termresized()
at appropriate times; if either condition occurs, call at appropriate times; if either condition occurs, call
resize_term(0, 0). Then, with either user or programmatic resize_term(0, 0). Then, with either user or programmatic
resizing, you'll have to resize any windows you've created, as resizing, you'll have to resize any windows you've created, as
appropriate; resize_term() only handles stdscr and curscr. appropriate; resize_term() only handles stdscr and curscr.
is_termresized() returns TRUE if the curses screen has been is_termresized() returns TRUE if the curses screen has been
resized by the user, and a call to resize_term() is needed. resized by the user, and a call to resize_term() is needed.
Checking for KEY_RESIZE is generally preferable, unless you're Checking for KEY_RESIZE is generally preferable, unless you're
not handling the keyboard. not handling the keyboard.
curses_version() returns a string describing the version of curses_version() returns a string describing the version of
PDCurses. PDCurses.
Return Value: Return Value:
@ -169,7 +169,7 @@ WINDOW *Xinitscr(int argc, char *argv[])
PDC_slk_initialize(); PDC_slk_initialize();
LINES -= SP->slklines; 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 */ of stdscr by the number of lines ripped off */
for (i = 0; i < linesrippedoff; i++) for (i = 0; i < linesrippedoff; i++)
@ -247,7 +247,7 @@ int endwin(void)
bool isendwin(void) bool isendwin(void)
{ {
PDC_LOG(("isendwin() - called\n")); PDC_LOG(("isendwin() - called\n"));
return SP ? !(SP->alive) : FALSE; return SP ? !(SP->alive) : FALSE;
} }

View File

@ -33,57 +33,57 @@ RCSID("$Id: inopts.c,v 1.43 2008/07/13 16:08:18 wmcbrine Exp $")
int nocrmode(void); int nocrmode(void);
Description: Description:
cbreak() and nocbreak() toggle cbreak mode. In cbreak mode, cbreak() and nocbreak() toggle cbreak mode. In cbreak mode,
characters typed by the user are made available immediately, and characters typed by the user are made available immediately, and
erase/kill character processing is not performed. In nocbreak erase/kill character processing is not performed. In nocbreak
mode, typed characters are buffered until a newline or carriage mode, typed characters are buffered until a newline or carriage
return. Interrupt and flow control characters are unaffected by return. Interrupt and flow control characters are unaffected by
this mode. PDCurses always starts in cbreak mode. this mode. PDCurses always starts in cbreak mode.
echo() and noecho() control whether typed characters are echoed echo() and noecho() control whether typed characters are echoed
by the input routine. Initially, input characters are echoed. by the input routine. Initially, input characters are echoed.
Subsequent calls to echo() and noecho() do not flush type-ahead. Subsequent calls to echo() and noecho() do not flush type-ahead.
halfdelay() is similar to cbreak(), but allows for a time limit halfdelay() is similar to cbreak(), but allows for a time limit
to be specified, in tenths of a second. This causes getch() to to be specified, in tenths of a second. This causes getch() to
block for that period before returning ERR if no key has been block for that period before returning ERR if no key has been
received. tenths must be between 1 and 255. received. tenths must be between 1 and 255.
keypad() controls whether getch() returns function/special keys keypad() controls whether getch() returns function/special keys
as single key codes (e.g., the left arrow key as KEY_LEFT). Per 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 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, it on. With keypad mode off, if a special key is pressed,
getch() does nothing or returns ERR. getch() does nothing or returns ERR.
nodelay() controls whether wgetch() is a non-blocking call. If nodelay() controls whether wgetch() is a non-blocking call. If
the option is enabled, and no input is ready, wgetch() will the option is enabled, and no input is ready, wgetch() will
return ERR. If disabled, wgetch() will hang until input is return ERR. If disabled, wgetch() will hang until input is
ready. ready.
nl() enables the translation of a carriage return into a newline nl() enables the translation of a carriage return into a newline
on input. nonl() disables this. Initially, the translation does on input. nonl() disables this. Initially, the translation does
occur. occur.
raw() and noraw() toggle raw mode. Raw mode is similar to cbreak raw() and noraw() toggle raw mode. Raw mode is similar to cbreak
mode, in that characters typed are immediately passed through to mode, in that characters typed are immediately passed through to
the user program. The difference is that in raw mode, the INTR, the user program. The difference is that in raw mode, the INTR,
QUIT, SUSP, and STOP characters are passed through without being QUIT, SUSP, and STOP characters are passed through without being
interpreted, and without generating a signal. interpreted, and without generating a signal.
In PDCurses, the meta() function sets raw mode on or off. In PDCurses, the meta() function sets raw mode on or off.
timeout() and wtimeout() set blocking or non-blocking reads for timeout() and wtimeout() set blocking or non-blocking reads for
the specified window. The delay is measured in milliseconds. If the specified window. The delay is measured in milliseconds. If
it's negative, a blocking read is used; if zero, then non- it's negative, a blocking read is used; if zero, then non-
blocking reads are done -- if no input is waiting, ERR is blocking reads are done -- if no input is waiting, ERR is
returned immediately. If the delay is positive, the read blocks returned immediately. If the delay is positive, the read blocks
for the delay period; if the period expires, ERR is returned. for the delay period; if the period expires, ERR is returned.
intrflush(), notimeout(), noqiflush(), qiflush() and typeahead() 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. other curses implementations.
crmode() and nocrmode() are archaic equivalents to cbreak() and crmode() and nocrmode() are archaic equivalents to cbreak() and
nocbreak(), respectively. nocbreak(), respectively.
Return Value: Return Value:
@ -274,7 +274,7 @@ void wtimeout(WINDOW *win, int delay)
if (delay < 0) 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 */ mode */
win->_nodelay = FALSE; win->_nodelay = FALSE;
@ -282,7 +282,7 @@ void wtimeout(WINDOW *win, int delay)
} }
else if (!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 */ delay mode */
win->_nodelay = TRUE; win->_nodelay = TRUE;
@ -290,8 +290,8 @@ void wtimeout(WINDOW *win, int delay)
} }
else else
{ {
/* This causes the read on the window to delay for the number of /* This causes the read on the window to delay for the number of
milliseconds. Also forces the window into non-blocking read milliseconds. Also forces the window into non-blocking read
mode */ mode */
/*win->_nodelay = TRUE;*/ /*win->_nodelay = TRUE;*/

View File

@ -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); int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch);
Description: Description:
The insch() functions insert a chtype into the window at the The insch() functions insert a chtype into the window at the
current or specified cursor position. The cursor is NOT current or specified cursor position. The cursor is NOT
advanced. A newline is equivalent to clrtoeol(); tabs are advanced. A newline is equivalent to clrtoeol(); tabs are
expanded; other control characters are converted as with expanded; other control characters are converted as with
unctrl(). unctrl().
The ins_wch() functions are the wide-character The ins_wch() functions are the wide-character
equivalents, taking cchar_t pointers rather than chtypes. equivalents, taking cchar_t pointers rather than chtypes.
Video attributes can be combined with a character by ORing 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(). 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. that disable the translation of control characters.
Return Value: Return Value:

View File

@ -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(). at the current cursor position, by repeatedly calling winsch().
When PDCurses is built with wide-character support enabled, the When PDCurses is built with wide-character support enabled, the
narrow-character functions treat the string as a multibyte narrow-character functions treat the string as a multibyte
string in the current locale, and convert it first. All string in the current locale, and convert it first. All
characters to the right of the cursor are moved to the right, characters to the right of the cursor are moved to the right,
with the possibility of the rightmost characters on the line with the possibility of the rightmost characters on the line
being lost. The cursor position does not change (after moving being lost. The cursor position does not change (after moving
to y, x, if specified). The routines with n as the last to y, x, if specified). The routines with n as the last
argument insert at most n characters; if n is negative, then the argument insert at most n characters; if n is negative, then the
entire string is inserted. entire string is inserted.
Return Value: Return Value:

View File

@ -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); int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n);
Description: Description:
These functions take characters (or wide characters) from the These functions take characters (or wide characters) from the
current or specified position in the window, and return them as current or specified position in the window, and return them as
a string in str (or wstr). Attributes are ignored. The functions a string in str (or wstr). Attributes are ignored. The functions
with n as the last argument return a string at most n characters with n as the last argument return a string at most n characters
long. long.
Return Value: Return Value:
Upon successful completion, innstr(), mvinnstr(), mvwinnstr() Upon successful completion, innstr(), mvinnstr(), mvwinnstr()
and winnstr() return the number of characters actually read into 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. OK. Otherwise, all these functions return ERR.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -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 0 makes it disappear; 1 makes it appear "normal" (usually an
underline) and 2 makes it "highly visible" (usually a block). underline) and 2 makes it "highly visible" (usually a block).
ripoffline() reduces the size of stdscr by one line. If the ripoffline() reduces the size of stdscr by one line. If the
"line" parameter is positive, the line is removed from the top "line" parameter is positive, the line is removed from the top
of the screen; if negative, from the bottom. Up to 5 lines can of the screen; if negative, from the bottom. Up to 5 lines can
be ripped off stdscr by calling ripoffline() repeatedly. The be ripped off stdscr by calling ripoffline() repeatedly. The
function argument, init, is called from within initscr() or function argument, init, is called from within initscr() or
newterm(), so ripoffline() must be called before either of these newterm(), so ripoffline() must be called before either of these
functions. The init function receives a pointer to a one-line functions. The init function receives a pointer to a one-line
WINDOW, and the width of the window. Calling ripoffline() with a WINDOW, and the width of the window. Calling ripoffline() with a
NULL init function pointer is an error. 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. milliseconds. draino() is an archaic equivalent.
resetterm(), fixterm() and saveterm() are archaic equivalents resetterm(), fixterm() and saveterm() are archaic equivalents
@ -193,7 +193,7 @@ int curs_set(int visibility)
ret_vis = PDC_curs_set(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 */ its position */
if (visibility && !ret_vis) if (visibility && !ret_vis)

View File

@ -16,13 +16,13 @@ RCSID("$Id: keyname.c,v 1.8 2008/07/13 16:08:18 wmcbrine Exp $")
bool has_key(int key); bool has_key(int key);
Description: 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 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 *. 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. This function is an ncurses extension.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -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 reported) through 1000ms. In x11, the timeout can also be set
via the clickPeriod resource. The return value from via the clickPeriod resource. The return value from
mouseinterval() is the old timeout. To check the old value mouseinterval() is the old timeout. To check the old value
without setting a new one, call it with a parameter of -1. Note without setting a new one, call it with a parameter of -1. Note
that although there's no classic equivalent for this function that although there's no classic equivalent for this function
(apart from the clickPeriod resource), the value set applies in (apart from the clickPeriod resource), the value set applies in
both interfaces. both interfaces.
wenclose() reports whether the given screen-relative y, x 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 mousemask() is nearly equivalent to mouse_set(), but instead of
OK/ERR, it returns the value of the mask after setting it. (This 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 isn't necessarily the same value passed in, since the mask could
be altered on some platforms.) And if the second parameter is a be altered on some platforms.) And if the second parameter is a
non-null pointer, mousemask() stores the previous mask value non-null pointer, mousemask() stores the previous mask value
there. Also, since the ncurses interface doesn't work with there. Also, since the ncurses interface doesn't work with
PDCurses' BUTTON_MOVED events, mousemask() filters them out. PDCurses' BUTTON_MOVED events, mousemask() filters them out.
nc_getmouse() returns the current mouse status in an MEVENT nc_getmouse() returns the current mouse status in an MEVENT
struct. This is equivalent to ncurses' getmouse(), renamed to struct. This is equivalent to ncurses' getmouse(), renamed to
avoid conflict with PDCurses' getmouse(). But if you define avoid conflict with PDCurses' getmouse(). But if you define
NCURSES_MOUSE_VERSION (preferably as 2) before including NCURSES_MOUSE_VERSION (preferably as 2) before including
curses.h, it defines getmouse() to nc_getmouse(), along with a curses.h, it defines getmouse() to nc_getmouse(), along with a
few other redefintions needed for compatibility with ncurses few other redefintions needed for compatibility with ncurses
code. nc_getmouse() calls request_mouse_pos(), which (not code. nc_getmouse() calls request_mouse_pos(), which (not
getmouse()) is the classic equivalent. getmouse()) is the classic equivalent.
ungetmouse() is the mouse equivalent of ungetch(). However, ungetmouse() is the mouse equivalent of ungetch(). However,
PDCurses doesn't maintain a queue of mouse events; only one can PDCurses doesn't maintain a queue of mouse events; only one can
be pushed back, and it can overwrite or be overwritten by real be pushed back, and it can overwrite or be overwritten by real
mouse events. mouse events.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -305,7 +305,7 @@ mmask_t mousemask(mmask_t mask, mmask_t *oldmask)
if (oldmask) if (oldmask)
*oldmask = SP->_trap_mbe; *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 */ filter them here */
mask &= ~(BUTTON1_MOVED | BUTTON2_MOVED | BUTTON3_MOVED); mask &= ~(BUTTON1_MOVED | BUTTON2_MOVED | BUTTON3_MOVED);
@ -397,7 +397,7 @@ int ungetmouse(MEVENT *event)
int shf = i * 5; int shf = i * 5;
short button = 0; short button = 0;
if (bstate & ((BUTTON1_RELEASED | BUTTON1_PRESSED | if (bstate & ((BUTTON1_RELEASED | BUTTON1_PRESSED |
BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED) << shf)) BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED) << shf))
{ {
pdc_mouse_status.changes |= 1 << i; pdc_mouse_status.changes |= 1 << i;

View File

@ -21,12 +21,12 @@ RCSID("$Id: outopts.c,v 1.39 2008/07/14 12:22:13 wmcbrine Exp $")
int raw_output(bool bf); int raw_output(bool bf);
Description: Description:
With clearok(), if bf is TRUE, the next call to wrefresh() with With clearok(), if bf is TRUE, the next call to wrefresh() with
this window will clear the screen completely and redraw the this window will clear the screen completely and redraw the
entire screen. entire screen.
immedok(), called with a second argument of TRUE, causes an immedok(), called with a second argument of TRUE, causes an
automatic wrefresh() every time a change is made to the automatic wrefresh() every time a change is made to the
specified window. specified window.
Normally, the hardware cursor is left at the location of the 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 the need for cursor motions. If possible, the cursor is made
invisible when this option is enabled. invisible when this option is enabled.
wsetscrreg() sets a scrolling region in a window; "top" and wsetscrreg() sets a scrolling region in a window; "top" and
"bot" are the line numbers for the top and bottom margins. If "bot" are the line numbers for the top and bottom margins. If
this option and scrollok() are enabled, any attempt to move off this option and scrollok() are enabled, any attempt to move off
the bottom margin will cause all lines in the scrolling region the bottom margin will cause all lines in the scrolling region
to scroll up one line. setscrreg() is the stdscr version. 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. compatibility with other curses implementations.
raw_output() enables the output of raw characters using the raw_output() enables the output of raw characters using the
standard *add* and *ins* curses functions (that is, it disables standard *add* and *ins* curses functions (that is, it disables
translation of control characters). translation of control characters).
Return Value: Return Value:

View File

@ -43,7 +43,7 @@ RCSID("$Id: overlay.c,v 1.36 2008/07/14 12:35:23 wmcbrine Exp $")
**man-end****************************************************************/ **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. */ corrected overlay()/overwrite() behavior. */
static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr, 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) if (fc == _NO_CHANGE)
fc = col + dst_tc; fc = col + dst_tc;
lc = 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_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); 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 */ coordinates */
/* if no overlapping region, do nothing */ /* 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_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); 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 */ coordinates */
/* if no overlapping region, do nothing */ /* if no overlapping region, do nothing */

View File

@ -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 specify the part of the pad to be displayed, and the location
to use on the screen. 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, subpad() creates a new sub-pad within a pad, at position (begy,
begx), with dimensions of nlines lines and ncols columns. This begx), with dimensions of nlines lines and ncols columns. This
position is relative to the pad, and not to the screen as with 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 subwin. Changes to either the parent pad or sub-pad will affect
both. When using sub-pads, you may need to call touchwin() both. When using sub-pads, you may need to call touchwin()
before calling prefresh(). before calling prefresh().
pnoutrefresh() copies the specified pad to the virtual screen. 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(). These routines are analogous to wnoutrefresh() and wrefresh().
(py, px) specifies the upper left corner of the part of the pad (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. rectangle that will contain the selected part of the pad.
pechochar() is functionally equivalent to addch() followed by pechochar() is functionally equivalent to addch() followed by
@ -87,7 +87,7 @@ WINDOW *newpad(int nlines, int ncols)
win->_flags = _PAD; 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(). */ prefresh(). */
save_pminrow = 0; 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)) (begx + ncols) > (orig->_begx + orig->_maxx))
return (WINDOW *)NULL; return (WINDOW *)NULL;
if (!nlines) if (!nlines)
nlines = orig->_maxy - 1 - j; nlines = orig->_maxy - 1 - j;
if (!ncols) if (!ncols)
ncols = orig->_maxx - 1 - k; ncols = orig->_maxx - 1 - k;
if ( !(win = PDC_makenew(nlines, ncols, begy, begx)) ) 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, memcpy(curscr->_y[sline] + sx1, w->_y[pline] + px,
num_cols * sizeof(chtype)); num_cols * sizeof(chtype));
if ((curscr->_firstch[sline] == _NO_CHANGE) if ((curscr->_firstch[sline] == _NO_CHANGE)
|| (curscr->_firstch[sline] > sx1)) || (curscr->_firstch[sline] > sx1))
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; curscr->_clear = TRUE;
} }
/* position the cursor to the pad's current position if possible -- /* position the cursor to the pad's current position if possible --
is the pad current position going to end up displayed? if not, 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 */ then don't move the cursor; if so, move it to the correct place */
if (!w->_leaveit && w->_cury >= py && w->_curx >= px && if (!w->_leaveit && w->_cury >= py && w->_curx >= px &&
@ -241,7 +241,7 @@ int pechochar(WINDOW *pad, chtype ch)
if (waddch(pad, ch) == ERR) if (waddch(pad, ch) == ERR)
return 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); 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)) if (!wch || (waddch(pad, *wch) == ERR))
return 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); save_smincol, save_smaxrow, save_smaxcol);
} }
#endif #endif

View File

@ -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 panels, fetch and set their associated windows, shuffle panels
in the deck, and manipulate panels in other ways. 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. location and contents of the panel are unchanged.
del_panel() deletes pan, but not its associated winwow. 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. from view.
move_panel() moves the curses window associated with pan, so move_panel() moves the curses window associated with pan, so
that its upper lefthand corner is at the supplied coordinates. that its upper lefthand corner is at the supplied coordinates.
(Do not use mvwin() on the window.) (Do not use mvwin() on the window.)
new_panel() creates a new panel associated with win and returns new_panel() creates a new panel associated with win and returns
the panel pointer. The new panel is placed at the top of the the panel pointer. The new panel is placed at the top of the
deck. deck.
panel_above() returns a pointer to the panel in the deck above 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 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 is NULL, this function returns a pointer to the bottom panel in
the deck. the deck.
panel_below() returns a pointer to the panel in the deck below 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 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 passed is NULL, this function returns a pointer to the top panel
in the deck. in the deck.
panel_hidden() returns OK if pan is hidden and ERR if it is not. panel_hidden() returns OK if pan is hidden and ERR if it is not.
panel_userptr() - Each panel has a user pointer available for panel_userptr() - Each panel has a user pointer available for
maintaining relevant information. This function returns a maintaining relevant information. This function returns a
pointer to that information previously set up by pointer to that information previously set up by
set_panel_userptr(). 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. with the panel.
replace_panel() replaces the current window of pan with win. replace_panel() replaces the current window of pan with win.
set_panel_userptr() - Each panel has a user pointer available set_panel_userptr() - Each panel has a user pointer available
for maintaining relevant information. This function sets the for maintaining relevant information. This function sets the
value of that information. 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. 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. location and contents of the panel are unchanged.
update_panels() refreshes the virtual screen to reflect the update_panels() refreshes the virtual screen to reflect the
depth relationships between the panels in the deck. The user depth relationships between the panels in the deck. The user
must use doupdate() to refresh the physical screen. must use doupdate() to refresh the physical screen.
Return Value: Return Value:
Each routine that returns a pointer to an object returns NULL if Each routine that returns a pointer to an object returns NULL if
an error occurs. Each panel routine that returns an integer, an error occurs. Each panel routine that returns an integer,
returns OK if it executes successfully and ERR if it does not. returns OK if it executes successfully and ERR if it does not.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -617,7 +617,7 @@ void update_panels(void)
if (is_wintouched(stdscr)) if (is_wintouched(stdscr))
Wnoutrefresh(&_stdscr_pseudo_panel); Wnoutrefresh(&_stdscr_pseudo_panel);
pan = _bottom_panel; pan = _bottom_panel;
while (pan) while (pan)

View File

@ -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); int vw_printw(WINDOW *win, const char *fmt, va_list varglist);
Description: Description:
The printw() functions add a formatted string to the window at The printw() functions add a formatted string to the window at
the current or specified cursor position. The format strings are the current or specified cursor position. The format strings are
the same as used in the standard C library's printf(). (printw() the same as used in the standard C library's printf(). (printw()
can be used as a drop-in replacement for printf().) can be used as a drop-in replacement for printf().)
Return Value: Return Value:
All functions return the number of characters printed, or All functions return the number of characters printed, or
ERR on error. ERR on error.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -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); int wredrawln(WINDOW *win, int beg_line, int num_lines);
Description: Description:
wrefresh() copies the named window to the physical terminal wrefresh() copies the named window to the physical terminal
screen, taking into account what is already there in order to screen, taking into account what is already there in order to
optimize cursor movement. refresh() does the same, using stdscr. optimize cursor movement. refresh() does the same, using stdscr.
These routines must be called to get any output on the terminal, These routines must be called to get any output on the terminal,
as other routines only manipulate data structures. Unless as other routines only manipulate data structures. Unless
leaveok() has been enabled, the physical cursor of the terminal leaveok() has been enabled, the physical cursor of the terminal
is left at the location of the window's cursor. is left at the location of the window's cursor.
wnoutrefresh() and doupdate() allow multiple updates with more wnoutrefresh() and doupdate() allow multiple updates with more
efficiency than wrefresh() alone. wrefresh() works by first efficiency than wrefresh() alone. wrefresh() works by first
calling wnoutrefresh(), which copies the named window to the calling wnoutrefresh(), which copies the named window to the
virtual screen. It then calls doupdate(), which compares the virtual screen. It then calls doupdate(), which compares the
virtual screen to the physical screen and does the actual virtual screen to the physical screen and does the actual
update. A series of calls to wrefresh() will result in update. A series of calls to wrefresh() will result in
alternating calls to wnoutrefresh() and doupdate(), causing alternating calls to wnoutrefresh() and doupdate(), causing
several bursts of output to the screen. By first calling several bursts of output to the screen. By first calling
wnoutrefresh() for each window, it is then possible to call wnoutrefresh() for each window, it is then possible to call
doupdate() only once. doupdate() only once.
In PDCurses, redrawwin() is equivalent to touchwin(), and In PDCurses, redrawwin() is equivalent to touchwin(), and
wredrawln() is the same as touchline(). In some other curses wredrawln() is the same as touchline(). In some other curses
implementations, there's a subtle distinction, but it has no implementations, there's a subtle distinction, but it has no
meaning in PDCurses. meaning in PDCurses.
Return Value: Return Value:
@ -79,7 +79,7 @@ int wnoutrefresh(WINDOW *win)
int first = win->_firstch[i]; /* first changed */ int first = win->_firstch[i]; /* first changed */
int last = win->_lastch[i]; /* last 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 */ but really aren't */
while (first <= last && src[first] == dest[first]) while (first <= last && src[first] == dest[first])
@ -95,7 +95,7 @@ int wnoutrefresh(WINDOW *win)
memcpy(dest + first, src + first, memcpy(dest + first, src + first,
(last - first + 1) * sizeof(chtype)); (last - first + 1) * sizeof(chtype));
first += begx; first += begx;
last += begx; last += begx;
if (first < curscr->_firstch[j] || if (first < curscr->_firstch[j] ||

View File

@ -130,17 +130,17 @@ int vw_scanw(WINDOW *win, const char *fmt, va_list varglist)
#ifndef HAVE_VSSCANF #ifndef HAVE_VSSCANF
/* _pdc_vsscanf() - Internal routine to parse and format an input /* _pdc_vsscanf() - Internal routine to parse and format an input
buffer. It scans a series of input fields; each field is formatted buffer. It scans a series of input fields; each field is formatted
according to a supplied format string and the formatted input is according to a supplied format string and the formatted input is
stored in the variable number of addresses passed. Returns the number stored in the variable number of addresses passed. Returns the number
of input fields or EOF on error. 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. 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, 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 Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to
its inclusion in PDCurses. */ its inclusion in PDCurses. */
#define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n') #define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')

View File

@ -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); int scr_set(const char *filename);
Description: Description:
getwin() reads window-related data previously stored in a file getwin() reads window-related data previously stored in a file
by putwin(). It then creates and initialises a new window using by putwin(). It then creates and initialises a new window using
that data. that data.
putwin() writes all data associated with a window into a file, putwin() writes all data associated with a window into a file,
using an unspecified format. This information can be retrieved using an unspecified format. This information can be retrieved
later using getwin(). 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. the file named by filename in an unspecified format.
scr_restore() function sets the virtual screen to the contents scr_restore() function sets the virtual screen to the contents
of the file named by filename, which must have been written of the file named by filename, which must have been written
using scr_dump(). The next refresh operation restores the screen using scr_dump(). The next refresh operation restores the screen
to the way it looked in the dump file. to the way it looked in the dump file.
In PDCurses, scr_init() does nothing, and scr_set() is a synonym In PDCurses, scr_init() does nothing, and scr_set() is a synonym
for scr_restore(). Also, scr_dump() and scr_restore() save and for scr_restore(). Also, scr_dump() and scr_restore() save and
load from curscr. This differs from some other implementations, load from curscr. This differs from some other implementations,
where scr_init() works with curscr, and scr_restore() works with where scr_init() works with curscr, and scr_restore() works with
newscr; but the effect should be the same. (PDCurses has no newscr; but the effect should be the same. (PDCurses has no
newscr.) newscr.)
Return Value: Return Value:
On successful completion, getwin() returns a pointer to the On successful completion, getwin() returns a pointer to the
window it created. Otherwise, it returns a null pointer. Other window it created. Otherwise, it returns a null pointer. Other
functions return OK or ERR. functions return OK or ERR.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -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); int wscrl(WINDOW *win, int n);
Description: 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. moving the lines in the window data strcture.
With a positive n, scrl() and wscrl() scroll the window up n With a positive n, scrl() and wscrl() scroll the window up n
lines (line i + n becomes i); otherwise they scroll the window lines (line i + n becomes i); otherwise they scroll the window
down n lines. down n lines.
For these functions to work, scrolling must be enabled via For these functions to work, scrolling must be enabled via
scrollok(). Note also that scrolling is not allowed if the scrollok(). Note also that scrolling is not allowed if the
supplied window is a pad. supplied window is a pad.
Return Value: Return Value:
@ -60,7 +60,7 @@ int wscrl(WINDOW *win, int n)
dir = -1; dir = -1;
} }
for (l = 0; l < (n * dir); l++) for (l = 0; l < (n * dir); l++)
{ {
temp = win->_y[start]; temp = win->_y[start];

View File

@ -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) wchar_t *slk_wlabel(int labnum)
Description: Description:
These functions manipulate a window that contain Soft Label Keys These functions manipulate a window that contain Soft Label Keys
(SLK). To use the SLK functions, a call to slk_init() must be (SLK). To use the SLK functions, a call to slk_init() must be
made BEFORE initscr() or newterm(). slk_init() removes 1 or 2 made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
lines from the useable screen, depending on the format selected. 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. 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: format of the SLKs as follows:
0 3-2-3 format 0 3-2-3 format
1 4-4 format 1 4-4 format
2 4-4-4 format (ncurses extension) 2 4-4-4 format (ncurses extension)
@ -116,7 +116,7 @@ int slk_init(int fmt)
if (SP) if (SP)
return ERR; return ERR;
switch (fmt) switch (fmt)
{ {
case 0: /* 3 - 2 - 3 */ case 0: /* 3 - 2 - 3 */
labels = LABEL_NORMAL; labels = LABEL_NORMAL;
@ -218,7 +218,7 @@ int slk_set(int labnum, const char *label, int justify)
labnum--; labnum--;
if (!label || !(*label)) if (!label || !(*label))
{ {
/* Clear the label */ /* Clear the label */
@ -433,7 +433,7 @@ static void _slk_calc(void)
col += label_length; col += label_length;
if (i == 3) if (i == 3)
col = COLS - (label_length * 4) + 1; col = COLS - (label_length * 4) + 1;
} }
break; break;
@ -497,7 +497,7 @@ void PDC_slk_initialize(void)
if (!SP->slk_winptr) if (!SP->slk_winptr)
{ {
if ( !(SP->slk_winptr = newwin(SP->slklines, COLS, if ( !(SP->slk_winptr = newwin(SP->slklines, COLS,
LINES - SP->slklines, 0)) ) LINES - SP->slklines, 0)) )
return; 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)); 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. */ of the screen, we are not interested in it. */
if (!slk || !SP->slk_winptr || (y != SP->slk_winptr->_begy + label_line)) 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--; labnum--;
if (!label || !(*label)) if (!label || !(*label))
{ {
/* Clear the label */ /* Clear the label */

View File

@ -25,16 +25,16 @@ RCSID("$Id: termattr.c,v 1.54 2008/07/13 16:08:18 wmcbrine Exp $")
char wordchar(void); char wordchar(void);
Description: 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. 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. some other implementations of curses.
erasechar() and killchar() return ^H and ^U, respectively -- the erasechar() and killchar() return ^H and ^U, respectively -- the
ERASE and KILL characters. In other curses implementations, ERASE and KILL characters. In other curses implementations,
these may vary by terminal type. erasewchar() and killwchar() these may vary by terminal type. erasewchar() and killwchar()
are the wide-character versions; they take a pointer to a are the wide-character versions; they take a pointer to a
location in which to store the character, and return OK or ERR. location in which to store the character, and return OK or ERR.
longname() returns a pointer to a static area containing a 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 termattrs() returns a logical OR of all video attributes
supported by the terminal. supported by the terminal.
wordchar() is a PDCurses extension of the concept behind the wordchar() is a PDCurses extension of the concept behind the
functions erasechar() and killchar(), returning the "delete functions erasechar() and killchar(), returning the "delete
word" character, ^W. word" character, ^W.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -131,7 +131,7 @@ attr_t term_attrs(void)
{ {
PDC_LOG(("term_attrs() - called\n")); 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; WA_RIGHT | WA_UNDERLINE;
} }

View File

@ -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)); int tputs(const char *, int, int (*)(int));
Description: 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. 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. returning the appropriate errors and doing nothing else.
Portability X/Open BSD SYS V Portability X/Open BSD SYS V

View File

@ -17,26 +17,26 @@ RCSID("$Id: touch.c,v 1.29 2008/07/13 16:08:18 wmcbrine Exp $")
bool is_wintouched(WINDOW *win); bool is_wintouched(WINDOW *win);
Description: Description:
touchwin() and touchline() throw away all information about touchwin() and touchline() throw away all information about
which parts of the window have been touched, pretending that the which parts of the window have been touched, pretending that the
entire window has been drawn on. This is sometimes necessary entire window has been drawn on. This is sometimes necessary
when using overlapping windows, since a change to one window when using overlapping windows, since a change to one window
will affect the other window, but the records of which lines will affect the other window, but the records of which lines
have been changed in the other window will not reflect the have been changed in the other window will not reflect the
change. 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(). the last call to wrefresh().
wtouchln() makes n lines in the window, starting at line y, look wtouchln() makes n lines in the window, starting at line y, look
as if they have (changed == 1) or have not (changed == 0) been as if they have (changed == 1) or have not (changed == 0) been
changed since the last call to wrefresh(). changed since the last call to wrefresh().
is_linetouched() returns TRUE if the specified line in the is_linetouched() returns TRUE if the specified line in the
specified window has been changed since the last call to specified window has been changed since the last call to
wrefresh(). 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(). has been changed since the last call to wrefresh().
Return Value: Return Value:
@ -125,7 +125,7 @@ int wtouchln(WINDOW *win, int y, int n, int changed)
win->_firstch[i] = 0; win->_firstch[i] = 0;
win->_lastch[i] = win->_maxx - 1; win->_lastch[i] = win->_maxx - 1;
} }
else else
{ {
win->_firstch[i] = _NO_CHANGE; win->_firstch[i] = _NO_CHANGE;
win->_lastch[i] = _NO_CHANGE; win->_lastch[i] = _NO_CHANGE;

View File

@ -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); size_t PDC_wcstombs(char *dest, const wchar_t *src, size_t n);
Description: Description:
unctrl() expands the text portion of the chtype c into a unctrl() expands the text portion of the chtype c into a
printable string. Control characters are changed to the "^X" printable string. Control characters are changed to the "^X"
notation; others are passed through. wunctrl() is the wide- notation; others are passed through. wunctrl() is the wide-
character version of the function. character version of the function.
filter() and use_env() are no-ops in PDCurses. filter() and use_env() are no-ops in PDCurses.
delay_output() inserts an ms millisecond pause in output. delay_output() inserts an ms millisecond pause in output.
getcchar() works in two modes: When wch is not NULL, it reads getcchar() works in two modes: When wch is not NULL, it reads
the cchar_t pointed to by wcval and stores the attributes in the cchar_t pointed to by wcval and stores the attributes in
attrs, the color pair in color_pair, and the text in the attrs, the color pair in color_pair, and the text in the
wide-character string wch. When wch is NULL, getcchar() merely wide-character string wch. When wch is NULL, getcchar() merely
returns the number of wide characters in wcval. In either mode, returns the number of wide characters in wcval. In either mode,
the opts argument is unused. the opts argument is unused.
setcchar constructs a cchar_t at wcval from the wide-character setcchar constructs a cchar_t at wcval from the wide-character
text at wch, the attributes in attr and the color pair in text at wch, the attributes in attr and the color pair in
color_pair. The opts argument is unused. color_pair. The opts argument is unused.
Currently, the length returned by getcchar() is always 1 or 0. Currently, the length returned by getcchar() is always 1 or 0.
Similarly, setcchar() will only take the first wide character Similarly, setcchar() will only take the first wide character
from wch, and ignore any others that it "should" take (i.e., 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). character outside the basic multilingual plane (UCS-2).
Return Value: Return Value:
unctrl() and wunctrl() return NULL on failure. delay_output() unctrl() and wunctrl() return NULL on failure. delay_output()
always returns OK. always returns OK.
getcchar() returns the number of wide characters wcval points to getcchar() returns the number of wide characters wcval points to
when wch is NULL; when it's not, getcchar() returns OK or ERR. when wch is NULL; when it's not, getcchar() returns OK or ERR.
setcchar() returns OK or ERR. setcchar() returns OK or ERR.

View File

@ -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 LINES - begy; ncols to COLS - begx. Create a new full-screen
window by calling newwin(0, 0, 0, 0). window by calling newwin(0, 0, 0, 0).
delwin() deletes the named window, freeing all associated delwin() deletes the named window, freeing all associated
memory. In the case of overlapping windows, subwindows should be memory. In the case of overlapping windows, subwindows should be
deleted before the main window. deleted before the main window.
mvwin() moves the window so that the upper left-hand corner is 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 wsyncdown() causes a touchwin() of the current window if any of
its parent's windows have been touched. 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. returns the pointer to the new window, or NULL on failure.
wresize() is an ncurses-compatible wrapper for resize_window(). wresize() is an ncurses-compatible wrapper for resize_window().
Note that, unlike ncurses, it will NOT process any subwindows of 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. returns OK or ERR.
PDC_makenew() allocates all data for a new WINDOW * except the PDC_makenew() allocates all data for a new WINDOW * except the

View File

@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $")
int PDC_clearclipboard(void); int PDC_clearclipboard(void);
Description: Description:
PDC_getclipboard() gets the textual contents of the system's PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard(). 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. 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. clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard. 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: Return Values:
indicator of success/failure of call. indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful 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 the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support PDC_CLIP_ACCESS_ERROR no clipboard support
@ -118,7 +118,7 @@ int PDC_clearclipboard(void)
{ {
PDC_LOG(("PDC_clearclipboard() - called\n")); PDC_LOG(("PDC_clearclipboard() - called\n"));
if (pdc_SDL_clipboard) if (pdc_SDL_clipboard)
{ {
free(pdc_SDL_clipboard); free(pdc_SDL_clipboard);
pdc_SDL_clipboard = NULL; pdc_SDL_clipboard = NULL;

View File

@ -62,7 +62,7 @@ void PDC_update_rects(void)
{ {
if (rectcount) 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 */ probably better off doing a full screen update */
if (rectcount == MAXRECT) if (rectcount == MAXRECT)
@ -102,7 +102,7 @@ static void _set_attr(chtype ch)
if (newfg != foregr) if (newfg != foregr)
{ {
SDL_SetPalette(pdc_font, SDL_LOGPAL, SDL_SetPalette(pdc_font, SDL_LOGPAL,
pdc_color + newfg, pdc_flastc, 1); pdc_color + newfg, pdc_flastc, 1);
foregr = newfg; foregr = newfg;
} }
@ -151,8 +151,8 @@ void PDC_gotoyx(int row, int col)
if (!SP->visibility) if (!SP->visibility)
return; return;
/* draw a new cursor by overprinting the existing character in /* draw a new cursor by overprinting the existing character in
reverse, either the full cell (when visibility == 2) or the reverse, either the full cell (when visibility == 2) or the
lowest quarter of it (when visibility == 1) */ lowest quarter of it (when visibility == 1) */
ch = curscr->_y[row][col] ^ A_REVERSE; 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 else
if (lastrect.y != dest.y) if (lastrect.y != dest.y)
uprect[rectcount++] = dest; uprect[rectcount++] = dest;
} }
else else
uprect[rectcount++] = dest; uprect[rectcount++] = dest;

View File

@ -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); unsigned long PDC_get_input_fd(void);
Description: 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(). reads its input from. It can be used for select().
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -111,7 +111,7 @@ bool PDC_check_key(void)
Uint32 current = SDL_GetTicks(); Uint32 current = SDL_GetTicks();
int haveevent = SDL_PollEvent(&event); 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 */ update, or the timer has wrapped, update now */
if (haveevent || if (haveevent ||

View File

@ -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 PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE. FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses PDC_set_title() sets the title of the window in which the curses

View File

@ -10,7 +10,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.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: */ here: */
PDCEX SDL_Surface *pdc_screen; PDCEX SDL_Surface *pdc_screen;
@ -54,7 +54,7 @@ int main(int argc, char **argv)
dest.w = i; dest.w = i;
dest.h = j; dest.h = j;
SDL_FillRect(pdc_screen, &dest, SDL_FillRect(pdc_screen, &dest,
SDL_MapRGB(pdc_screen->format, rand() % 256, SDL_MapRGB(pdc_screen->format, rand() % 256,
rand() % 256, rand() % 256)); rand() % 256, rand() % 256));
} }

View File

@ -2,9 +2,9 @@
/* $Id: term.h,v 1.16 2008/07/13 16:08:16 wmcbrine Exp $ */ /* $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 /* PDCurses doesn't operate with terminfo, but we need these functions for
compatibility, to allow some things (notably, interface libraries for compatibility, to allow some things (notably, interface libraries for
other languages) to be compiled. Anyone who tries to actually _use_ other languages) to be compiled. Anyone who tries to actually _use_
them will be disappointed, since they only return ERR. */ them will be disappointed, since they only return ERR. */
#ifndef __PDCURSES_TERM_H__ #ifndef __PDCURSES_TERM_H__
@ -46,7 +46,7 @@ char *tgoto(const char *, int, int);
int tigetflag(const char *); int tigetflag(const char *);
int tigetnum(const char *); int tigetnum(const char *);
char *tigetstr(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); long, long, long, long);
int tputs(const char *, int, int (*)(int)); int tputs(const char *, int, int (*)(int));

View File

@ -15,14 +15,14 @@ RCSID("$Id: pdcclip.c,v 1.30 2008/07/14 04:24:52 wmcbrine Exp $")
int PDC_clearclipboard(void); int PDC_clearclipboard(void);
Description: Description:
PDC_getclipboard() gets the textual contents of the system's PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard(). 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. 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. clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard. 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: Return Values:
indicator of success/failure of call. indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful 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 the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support PDC_CLIP_ACCESS_ERROR no clipboard support
@ -99,7 +99,7 @@ int PDC_setclipboard(const char *contents, long length)
if (!OpenClipboard(NULL)) if (!OpenClipboard(NULL))
return PDC_CLIP_ACCESS_ERROR; return PDC_CLIP_ACCESS_ERROR;
ptr1 = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, ptr1 = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
(length + 1) * sizeof(TCHAR)); (length + 1) * sizeof(TCHAR));
if (!ptr1) if (!ptr1)

View File

@ -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(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(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(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
')', '*', ')', '*',
# ifdef PDC_WIDE # ifdef PDC_WIDE

View File

@ -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) int PDC_get_cursor_mode(void)
{ {
CONSOLE_CURSOR_INFO ci; CONSOLE_CURSOR_INFO ci;
PDC_LOG(("PDC_get_cursor_mode() - called\n")); PDC_LOG(("PDC_get_cursor_mode() - called\n"));
GetConsoleCursorInfo(pdc_con_out, &ci); GetConsoleCursorInfo(pdc_con_out, &ci);

View File

@ -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); unsigned long PDC_get_input_fd(void);
Description: 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(). reads its input from. It can be used for select().
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -36,7 +36,7 @@ static int save_press = 0;
#define MEV save_ip.Event.MouseEvent #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 * * 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},
{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 else
{ {
/* Check for diacritics. These are dead keys. Some locales /* Check for diacritics. These are dead keys. Some locales
have modified characters like umlaut-a, which is an "a" have modified characters like umlaut-a, which is an "a"
with two dots on it. In some locales you have to press a with two dots on it. In some locales you have to press a
special key (the dead key) immediately followed by the special key (the dead key) immediately followed by the
"a" to get a composed umlaut-a. The special key may have "a" to get a composed umlaut-a. The special key may have
a normal meaning with different modifiers. */ a normal meaning with different modifiers. */
if (KEV.uChar.UnicodeChar || !(MapVirtualKey(vk, 2) & 0x80000000)) if (KEV.uChar.UnicodeChar || !(MapVirtualKey(vk, 2) & 0x80000000))
@ -637,9 +637,9 @@ void PDC_flushinp(void)
int PDC_mouse_set(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; 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 */ had on startup, and clear all other flags */
SetConsoleMode(pdc_con_in, SP->_trap_mbe ? SetConsoleMode(pdc_con_in, SP->_trap_mbe ?

View File

@ -29,8 +29,8 @@ static short curstoreal[16], realtocurs[16] =
enum { PDC_RESTORE_NONE, PDC_RESTORE_BUFFER, PDC_RESTORE_WINDOW }; enum { PDC_RESTORE_NONE, PDC_RESTORE_BUFFER, PDC_RESTORE_WINDOW };
/* Struct for storing console registry keys, and for use with the /* Struct for storing console registry keys, and for use with the
undocumented WM_SETCONSOLEINFO message. Originally by James Brown, undocumented WM_SETCONSOLEINFO message. Originally by James Brown,
www.catch22.net. */ www.catch22.net. */
static struct static struct
@ -51,13 +51,13 @@ static struct
ULONG QuickEdit; ULONG QuickEdit;
ULONG AutoPosition; ULONG AutoPosition;
ULONG InsertMode; ULONG InsertMode;
USHORT ScreenColors; USHORT ScreenColors;
USHORT PopupColors; USHORT PopupColors;
ULONG HistoryNoDup; ULONG HistoryNoDup;
ULONG HistoryBufferSize; ULONG HistoryBufferSize;
ULONG NumberOfHistoryBuffers; ULONG NumberOfHistoryBuffers;
COLORREF ColorTable[16]; COLORREF ColorTable[16];
ULONG CodePage; ULONG CodePage;
@ -96,8 +96,8 @@ static HWND _find_console_handle(void)
#define WM_SETCONSOLEINFO (WM_USER + 201) #define WM_SETCONSOLEINFO (WM_USER + 201)
/* Wrapper around WM_SETCONSOLEINFO. We need to create the necessary /* Wrapper around WM_SETCONSOLEINFO. We need to create the necessary
section (file-mapping) object in the context of the process which section (file-mapping) object in the context of the process which
owns the console, before posting the message. Originally by JB. */ owns the console, before posting the message. Originally by JB. */
static void _set_console_info(void) static void _set_console_info(void)
@ -126,7 +126,7 @@ static void _set_console_info(void)
/* Open the process which "owns" the console */ /* Open the process which "owns" the console */
GetWindowThreadProcessId(console_info.Hwnd, &dwConsoleOwnerPid); GetWindowThreadProcessId(console_info.Hwnd, &dwConsoleOwnerPid);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwConsoleOwnerPid); hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwConsoleOwnerPid);
/* Create a SECTION object backed by page-file, then map a view of /* 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.AutoPosition = 0x10000;
console_info.ScreenColors = SP->orig_back << 4 | SP->orig_fore; console_info.ScreenColors = SP->orig_back << 4 | SP->orig_fore;
console_info.PopupColors = 0xf5; console_info.PopupColors = 0xf5;
console_info.HistoryNoDup = FALSE; console_info.HistoryNoDup = FALSE;
console_info.HistoryBufferSize = 50; console_info.HistoryBufferSize = 50;
console_info.NumberOfHistoryBuffers = 4; console_info.NumberOfHistoryBuffers = 4;
@ -247,7 +247,7 @@ void PDC_scr_close(void)
origin.X = origin.Y = 0; 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)) origin, &rect))
return; return;
} }
@ -367,7 +367,7 @@ int PDC_scr_open(int argc, char **argv)
if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize, origin, &rect)) 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 */ the displayed window */
free(ci_save); free(ci_save);
@ -392,14 +392,14 @@ int PDC_scr_open(int argc, char **argv)
rect.Bottom = orig_scr.srWindow.Bottom; rect.Bottom = orig_scr.srWindow.Bottom;
rect.Right = orig_scr.srWindow.Right; rect.Right = orig_scr.srWindow.Right;
if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize, if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize,
origin, &rect)) origin, &rect))
{ {
#ifdef PDCDEBUG #ifdef PDCDEBUG
CHAR LastError[256]; CHAR LastError[256];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL,
GetLastError(), MAKELANGID(LANG_NEUTRAL, GetLastError(), MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT), LastError, 256, NULL); SUBLANG_DEFAULT), LastError, 256, NULL);
PDC_LOG(("PDC_scr_open() - %s\n", LastError)); PDC_LOG(("PDC_scr_open() - %s\n", LastError));
@ -425,8 +425,8 @@ int PDC_scr_open(int argc, char **argv)
return OK; return OK;
} }
/* Calls SetConsoleWindowInfo with the given parameters, but fits them /* Calls SetConsoleWindowInfo with the given parameters, but fits them
if a scoll bar shrinks the maximum possible value. The rectangle if a scoll bar shrinks the maximum possible value. The rectangle
must at least fit in a half-sized window. */ must at least fit in a half-sized window. */
static BOOL _fit_console_window(HANDLE con_out, CONST SMALL_RECT *rect) static BOOL _fit_console_window(HANDLE con_out, CONST SMALL_RECT *rect)

View File

@ -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 PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE. FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses PDC_set_title() sets the title of the window in which the curses

View File

@ -34,19 +34,19 @@
* * * *
************************************************************************/ ************************************************************************/
static XtResource resources[] = static XtResource resources[] =
{ {
{ XtNhSpace, XtCHSpace, XtRDimension, sizeof(Dimension), { XtNhSpace, XtCHSpace, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.h_space), XtOffset(ScrollBoxWidget, scrollBox.h_space),
XtRImmediate, (XtPointer)4 }, XtRImmediate, (XtPointer)4 },
{ XtNvSpace, XtCVSpace, XtRDimension, sizeof(Dimension), { XtNvSpace, XtCVSpace, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.v_space), XtOffset(ScrollBoxWidget, scrollBox.v_space),
XtRImmediate, (XtPointer)4 }, XtRImmediate, (XtPointer)4 },
{ XtNheightInc, XtCHeightInc, XtRDimension, sizeof(Dimension), { XtNheightInc, XtCHeightInc, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.increment_height), XtOffset(ScrollBoxWidget, scrollBox.increment_height),
XtRImmediate, (XtPointer)13 }, XtRImmediate, (XtPointer)13 },
{ XtNwidthInc, XtCWidthInc, XtRDimension, sizeof(Dimension), { XtNwidthInc, XtCWidthInc, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.increment_width), XtOffset(ScrollBoxWidget, scrollBox.increment_width),
XtRImmediate, (XtPointer)7 }, 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. */ calculating size. */
static void DoLayout(Widget w, Boolean doit) static void DoLayout(Widget w, Boolean doit)
@ -141,16 +141,16 @@ static void DoLayout(Widget w, Boolean doit)
XtAppError(XtWidgetToApplicationContext(w), XtAppError(XtWidgetToApplicationContext(w),
"ScrollBox: must manage exactly three widgets."); "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]; child = sbw->composite.children[i];
if (!XtIsManaged(child)) if (!XtIsManaged(child))
XtAppError(XtWidgetToApplicationContext(w), XtAppError(XtWidgetToApplicationContext(w),
"ScrollBox: all three widgets must be managed."); "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. */ and three is the horizontal scrollbar. */
wmain = sbw->composite.children[0]; wmain = sbw->composite.children[0];
@ -176,11 +176,11 @@ static void DoLayout(Widget w, Boolean doit)
sbw->scrollBox.increment_height) + sbw->scrollBox.increment_height) +
sbw->scrollBox.increment_height; sbw->scrollBox.increment_height;
vx = wmain->core.x + mw + sbw->scrollBox.h_space + vx = wmain->core.x + mw + sbw->scrollBox.h_space +
wmain->core.border_width + vscroll->core.border_width; wmain->core.border_width + vscroll->core.border_width;
hy = wmain->core.y + mh + sbw->scrollBox.v_space + hy = wmain->core.y + mh + sbw->scrollBox.v_space +
wmain->core.border_width + hscroll->core.border_width; wmain->core.border_width + hscroll->core.border_width;
vh = mh; /* scrollbars are always same length as main window */ vh = mh; /* scrollbars are always same length as main window */
hw = mw; hw = mw;
@ -230,12 +230,12 @@ static void RefigureLocations(Widget w)
} }
/* Calculate preferred size. We can't just use the current sizes /* Calculate preferred size. We can't just use the current sizes
of the children, because that calculation would always end up with of the children, because that calculation would always end up with
our current size. Could query each child, and use that size to 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 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 and height passed in, accept bounding box. However, we know our
children and they don't have any particular preferred geometry, children and they don't have any particular preferred geometry,
except the bigger the better. Therefore, if the parent suggested a except the bigger the better. Therefore, if the parent suggested a
size, we'll take it. */ size, we'll take it. */
static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, 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 /* if proposed size is large enough, accept it. Otherwise, suggest
our arbitrary initial size. */ 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; result = XtGeometryAlmost;
reply_return->height = INITIAL_HEIGHT; reply_return->height = INITIAL_HEIGHT;
@ -265,9 +265,9 @@ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request,
result = XtGeometryYes; result = XtGeometryYes;
} }
if (request->request_mode & CWWidth) if (request->request_mode & CWWidth)
{ {
if (request->width < INITIAL_WIDTH) if (request->width < INITIAL_WIDTH)
{ {
result = XtGeometryAlmost; result = XtGeometryAlmost;
reply_return->width = INITIAL_WIDTH; 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) ArgList args, Cardinal *num_args)
{ {
ScrollBoxWidget sbwcurrent = (ScrollBoxWidget)current; ScrollBoxWidget sbwcurrent = (ScrollBoxWidget)current;

View File

@ -15,9 +15,9 @@
$Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $ $Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $
*/ */
/* /*
* scrollBoxP.h - Private definitions for scrollBox widget * scrollBoxP.h - Private definitions for scrollBox widget
* *
*/ */
#ifndef _XORAscrollBoxP_h #ifndef _XORAscrollBoxP_h

View File

@ -2,7 +2,7 @@
/* $Id: compose.h,v 1.3 2008/07/14 04:24:52 wmcbrine Exp $ */ /* $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. */ is not included when PDCurses is built with XIM support. */
#define MAX_COMPOSE_CHARS 14 #define MAX_COMPOSE_CHARS 14

View File

@ -2,9 +2,9 @@
* *
* This file is only used with the ncurses test programs. * This file is only used with the ncurses test programs.
* *
* Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build
* it), or edit ncurses_testdir appropriately in the Makefile. Configure * it), or edit ncurses_testdir appropriately in the Makefile. Configure
* and build PDCurses for X11. (Sorry, other ports won't work yet.) * and build PDCurses for X11. (Sorry, other ports won't work yet.)
* Change to this directory, and: * Change to this directory, and:
* *
* "make ncurses_tests" to start. * "make ncurses_tests" to start.
@ -40,7 +40,7 @@
# define USE_WIDEC_SUPPORT 1 # define USE_WIDEC_SUPPORT 1
#endif #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 ACS_ chars
*/ */

View File

@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $")
int PDC_clearclipboard(void); int PDC_clearclipboard(void);
Description: Description:
PDC_getclipboard() gets the textual contents of the system's PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard(). 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. 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. clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard. 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: Return Values:
indicator of success/failure of call. indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful 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 the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support PDC_CLIP_ACCESS_ERROR no clipboard support

View File

@ -51,8 +51,8 @@ chtype acs_map[128] =
0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3,
0x00b7, 0x00b7,
# else # else
A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), 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(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, A(26), A(27), A(28), A(29), A(30), 0xb7,
# endif # endif

View File

@ -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); unsigned long PDC_get_input_fd(void);
Description: 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(). reads its input from. It can be used for select().
Portability X/Open BSD SYS V Portability X/Open BSD SYS V
@ -32,7 +32,7 @@ bool PDC_check_key(void)
FD_ZERO(&xc_readfds); FD_ZERO(&xc_readfds);
FD_SET(xc_key_sock, &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) NULL, &socket_timeout)) < 0)
XCursesExitCursesProcess(3, "child - exiting from " XCursesExitCursesProcess(3, "child - exiting from "
"PDC_check_key select failed"); "PDC_check_key select failed");

View File

@ -71,7 +71,7 @@ int PDC_resize_screen(int nlines, int ncols)
XCursesCOLS = SP->cols; XCursesCOLS = SP->cols;
PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d SP->lines %d " 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)); shmkey_Xcurscr, SP->lines, SP->cols));
Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0);

View File

@ -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 PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE. FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses PDC_set_title() sets the title of the window in which the curses

View File

@ -99,7 +99,7 @@ int XC_read_socket(int sock_num, void *buf, int len)
SP->resized = FALSE; SP->resized = FALSE;
memcpy(buf, &rc, sizeof(int)); memcpy(buf, &rc, sizeof(int));
return 0; return 0;
} }
@ -178,7 +178,7 @@ static int _setup_curses(void)
if (wait_value != CURSES_CHILD) if (wait_value != CURSES_CHILD)
return ERR; 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 */ segment can be allocated */
if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700)) < 0) if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700)) < 0)
@ -226,13 +226,13 @@ int XCursesInitscr(int argc, char *argv[])
XC_LOG(("XCursesInitscr() - called\n")); XC_LOG(("XCursesInitscr() - called\n"));
shmkeySP = getpid(); shmkeySP = getpid();
if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_display_sockets) < 0) if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_display_sockets) < 0)
{ {
fprintf(stderr, "ERROR: cannot create display socketpair\n"); fprintf(stderr, "ERROR: cannot create display socketpair\n");
return ERR; return ERR;
} }
if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_key_sockets) < 0) if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_key_sockets) < 0)
{ {
fprintf(stderr, "ERROR: cannot create key socketpair\n"); fprintf(stderr, "ERROR: cannot create key socketpair\n");

View File

@ -178,10 +178,10 @@ void XC_say(const char *msg);
enum enum
{ {
CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION, CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION,
CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR, CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR,
CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR, CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR,
CURSES_EXIT CURSES_EXIT
}; };

View File

@ -377,8 +377,8 @@ static XrmOptionDescRec options[] =
CCOLOR(Black), CCOLOR(Red), CCOLOR(Green), CCOLOR(Yellow), CCOLOR(Black), CCOLOR(Red), CCOLOR(Green), CCOLOR(Yellow),
CCOLOR(Blue), CCOLOR(Magenta), CCOLOR(Cyan), CCOLOR(White), CCOLOR(Blue), CCOLOR(Magenta), CCOLOR(Cyan), CCOLOR(White),
CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen), CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen),
CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta), CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta),
CCOLOR(BoldCyan), CCOLOR(BoldWhite) CCOLOR(BoldCyan), CCOLOR(BoldWhite)
}; };
@ -533,7 +533,7 @@ RETSIGTYPE XCursesSigwinchHandler(int signo)
PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n", PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n",
XCLOGMSG, signo)); 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 */ 02-Feb-1999 */
SP->resized += 1; SP->resized += 1;
@ -545,13 +545,13 @@ RETSIGTYPE XCursesSigwinchHandler(int signo)
#endif #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 */ xpos and ypos */
static void _make_xy(int x, int y, int *xpos, int *ypos) static void _make_xy(int x, int y, int *xpos, int *ypos)
{ {
*xpos = (x * font_width) + xc_app_data.borderWidth; *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; xc_app_data.borderWidth;
} }
@ -953,7 +953,7 @@ static void _refresh_screen(void)
start_col = (int)*(Xcurscr + XCURSCR_START_OFF + row); start_col = (int)*(Xcurscr + XCURSCR_START_OFF + row);
_display_text((const chtype *)(Xcurscr + XCURSCR_Y_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); num_cols, FALSE);
*(Xcurscr + XCURSCR_LENGTH_OFF + row) = 0; *(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")); XC_LOG(("ClientMessage received\n"));
/* This code used to include handling of WM_SAVE_YOURSELF, but /* This code used to include handling of WM_SAVE_YOURSELF, but
it resulted in continual failure of THE on my Toshiba laptop. it resulted in continual failure of THE on my Toshiba laptop.
Removed on 3-3-2001. Now only exits on WM_DELETE_WINDOW. */ Removed on 3-3-2001. Now only exits on WM_DELETE_WINDOW. */
if ((Atom)client_event->data.s[0] == wm_atom[0]) 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) 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) */ with a KeyPress event (or reset by the mouse event handler) */
if (SP->return_key_modifiers && if (SP->return_key_modifiers &&
#ifndef PDC_XIM #ifndef PDC_XIM
keysym != compose_key && keysym != compose_key &&
#endif #endif
IsModifierKey(keysym)) IsModifierKey(keysym))
{ {
@ -1086,7 +1086,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params,
#ifndef PDC_XIM #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. */ key; if it is, set the compose state and exit. */
if (keysym == compose_key) if (keysym == compose_key)
@ -1105,16 +1105,16 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params,
SP->visibility = save_visibility; SP->visibility = save_visibility;
_make_xy(SP->curscol, SP->cursrow, &xpos, &ypos); _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))); (SP->curscol * sizeof(chtype)));
_set_cursor_color(ch, &fore, &back); _set_cursor_color(ch, &fore, &back);
XSetForeground(XCURSESDISPLAY, rect_cursor_gc, colors[back]); XSetForeground(XCURSESDISPLAY, rect_cursor_gc, colors[back]);
XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc,
xpos + 1, ypos - font_height + xpos + 1, ypos - font_height +
xc_app_data.normalFont->descent + 1, xc_app_data.normalFont->descent + 1,
font_width - 2, font_height - 2); font_width - 2, font_height - 2);
compose_state = STATE_COMPOSE; compose_state = STATE_COMPOSE;
@ -1138,7 +1138,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params,
key = buffer[0]; key = buffer[0];
compose_index = -1; compose_index = -1;
for (i = 0; i < (int)strlen(compose_chars); i++) for (i = 0; i < (int)strlen(compose_chars); i++)
if (compose_chars[i] == key) if (compose_chars[i] == key)
{ {
@ -1193,7 +1193,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params,
compose_state = STATE_NORMAL; compose_state = STATE_NORMAL;
compose_index = 0; compose_index = 0;
_redraw_cursor(); _redraw_cursor();
return; 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. */ NOT zero. */
if (key) if (key)
@ -1316,7 +1316,7 @@ static void XCursesHandleString(Widget w, XEvent *event, String *params,
ptr = (unsigned char *)*params; ptr = (unsigned char *)*params;
if (ptr[0] == '0' && ptr[1] == 'x' && ptr[2] != '\0') if (ptr[0] == '0' && ptr[1] == 'x' && ptr[2] != '\0')
{ {
unsigned char c; unsigned char c;
unsigned long total = 0; unsigned long total = 0;
@ -1376,7 +1376,7 @@ static void _paste_utf8(Widget w, XtPointer event, Atom *selection, Atom *type,
if (!*type || !*length) if (!*type || !*length)
{ {
XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string, XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string,
event, ((XButtonEvent *)event)->time); event, ((XButtonEvent *)event)->time);
return; return;
} }
@ -1421,14 +1421,14 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target,
if (*target == XA_TARGETS(XtDisplay(topLevel))) if (*target == XA_TARGETS(XtDisplay(topLevel)))
{ {
XSelectionRequestEvent *req = XtGetSelectionRequest(w, XSelectionRequestEvent *req = XtGetSelectionRequest(w,
*selection, (XtRequestId)NULL); *selection, (XtRequestId)NULL);
Atom *targetP; Atom *targetP;
XPointer std_targets; XPointer std_targets;
unsigned long std_length; unsigned long std_length;
XmuConvertStandardSelection(topLevel, req->time, selection, XmuConvertStandardSelection(topLevel, req->time, selection,
target, type_return, &std_targets, target, type_return, &std_targets,
&std_length, format_return); &std_length, format_return);
@ -1475,7 +1475,7 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target,
return True; return True;
} }
else else
return XmuConvertStandardSelection(topLevel, CurrentTime, return XmuConvertStandardSelection(topLevel, CurrentTime,
selection, target, type_return, (XPointer*)value_return, selection, target, type_return, (XPointer*)value_return,
length_return, format_return); length_return, format_return);
} }
@ -1544,7 +1544,7 @@ static void _selection_off(void)
_display_screen(); _display_screen();
selection_start_x = selection_start_y = selection_end_x = selection_start_x = selection_start_y = selection_end_x =
selection_end_y = 0; selection_end_y = 0;
mouse_selection = FALSE; mouse_selection = FALSE;
@ -1560,8 +1560,8 @@ static void _selection_on(int x, int y)
static void _selection_extend(int x, int y) static void _selection_extend(int x, int y)
{ {
int temp, current_start, current_end, current_start_x, int temp, current_start, current_end, current_start_x,
current_end_x, current_start_y, current_end_y, new_start, 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; new_end, new_start_x, new_end_x, new_start_y, new_end_y;
XC_LOG(("_selection_extend() - called\n")); XC_LOG(("_selection_extend() - called\n"));
@ -1591,7 +1591,7 @@ static void _selection_extend(int x, int y)
current_start_y = selection_start_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. */ Convert the new position to a linear expression. */
selection_end_x = x; selection_end_x = x;
@ -1621,25 +1621,25 @@ static void _selection_extend(int x, int y)
} }
if (new_end > current_end) 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); new_end_y, TRUE);
else if (new_end < current_end) 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); current_end_y, FALSE);
else if (new_start < current_start) 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); current_start_y, TRUE);
else if (new_start > current_start) 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); new_start_x, new_start_y, FALSE);
else else
_show_selection(current_start_x, current_start_y, _show_selection(current_start_x, current_start_y,
new_start_x, new_start_y, TRUE); new_start_x, new_start_y, TRUE);
} }
static void _selection_set(void) 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; start_col, row, num_chars, ch, last_nonblank, length, newlen;
chtype *ptr = NULL; 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", PDC_LOG(("%s:_display_cursor() - draw char at row: %d col %d\n",
XCLOGMSG, old_row, old_x)); 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 */ ignore the request */
if (old_row >= XCursesLINES || old_x >= COLS || 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++) for (i = 1; i <= SP->visibility; i++)
XDrawLine(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, 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 + xpos + i, ypos - xc_app_data.normalFont->ascent +
font_height - 1); font_height - 1);
} }
else else
@ -1869,7 +1869,7 @@ static void _handle_enter_leave(Widget w, XtPointer client_data,
window_entered = FALSE; 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 */ not current */
_redraw_cursor(); _redraw_cursor();
@ -1972,7 +1972,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
memset(&Mouse_status, 0, sizeof(Mouse_status)); 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; PDC_MOUSE_WHEEL_DOWN : PDC_MOUSE_WHEEL_UP;
MOUSE_X_POS = MOUSE_Y_POS = -1; MOUSE_X_POS = MOUSE_Y_POS = -1;
@ -2022,7 +2022,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
case MotionNotify: case MotionNotify:
MOUSE_LOG(("\nMotionNotify: y: %d x: %d Width: %d " 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)); font_width, font_height));
MOUSE_X_POS = (event->xbutton.x - xc_app_data.borderWidth) / MOUSE_X_POS = (event->xbutton.x - xc_app_data.borderWidth) /
@ -2039,12 +2039,12 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
else else
_selection_off(); _selection_off();
/* Throw away mouse movements if they are in the same character /* Throw away mouse movements if they are in the same character
position as the last mouse event, or if we are currently in position as the last mouse event, or if we are currently in
the middle of a double click event. */ the middle of a double click event. */
if ((MOUSE_X_POS == save_mouse_status.x && 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) save_mouse_status.button[button_no - 1] == BUTTON_DOUBLE_CLICKED)
{ {
send_key = FALSE; send_key = FALSE;
@ -2070,7 +2070,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
if (!handle_real_release) if (!handle_real_release)
{ {
if ((event->xbutton.time - last_button_press_time) < if ((event->xbutton.time - last_button_press_time) <
SP->mouse_wait && SP->mouse_wait &&
(event->xbutton.time != last_button_press_time)) (event->xbutton.time != last_button_press_time))
{ {
/* The "real" release was shorter than usleep() 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; send_key = FALSE;
if (XtOwnSelection(topLevel, XA_PRIMARY, if (XtOwnSelection(topLevel, XA_PRIMARY,
event->xbutton.time, _convert_proc, event->xbutton.time, _convert_proc,
_lose_ownership, NULL) == False) _lose_ownership, NULL) == False)
_selection_off(); _selection_off();
@ -2102,8 +2102,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
} }
else else
{ {
/* Button release longer than usleep() time; /* Button release longer than usleep() time;
therefore generate a press and wait for the real therefore generate a press and wait for the real
release to occur later. */ release to occur later. */
MOUSE_LOG(("Generated Release at: %ld - " MOUSE_LOG(("Generated Release at: %ld - "
@ -2138,8 +2138,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
{ {
send_key = FALSE; send_key = FALSE;
if (XtOwnSelection(topLevel, XA_PRIMARY, if (XtOwnSelection(topLevel, XA_PRIMARY,
event->xbutton.time, _convert_proc, event->xbutton.time, _convert_proc,
_lose_ownership, NULL) == False) _lose_ownership, NULL) == False)
_selection_off(); _selection_off();
@ -2174,7 +2174,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params,
BUTTON_STATUS(button_no), Mouse_status.changes)); BUTTON_STATUS(button_no), Mouse_status.changes));
MOUSE_LOG(("Send: %d Button1: %x Button2: %x Button3: %x %d %d\n", 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)); BUTTON_STATUS(3), XCursesLINES, XCursesCOLS));
if (!send_key || MOUSE_X_POS < 0 || MOUSE_X_POS >= 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; double viewport_y = (double)SP->sb_viewport_y;
int cur_y = SP->sb_cur_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. */ as no scrolling is permitted. */
if (SP->sb_viewport_y >= SP->sb_total_y) 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), XawScrollbarSetThumb(w, (double)(cur_x / total_x),
(double)(viewport_x / total_x)); (double)(viewport_x / total_x));
_send_key_to_curses(KEY_SR, NULL, TRUE); _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) static void _resize(void)
{ {
short save_atrtab[PDC_COLOR_PAIRS * 2]; short save_atrtab[PDC_COLOR_PAIRS * 2];
after_first_curses_request = FALSE; after_first_curses_request = FALSE;
@ -2369,11 +2369,11 @@ static void _resize(void)
if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, if ((shmid_Xcurscr = shmget(shmkey_Xcurscr,
SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0)
{ {
perror("Cannot allocate shared memory for curscr"); perror("Cannot allocate shared memory for curscr");
_exit_process(4, SIGKILL, "exiting from _process_curses_requests"); _exit_process(4, SIGKILL, "exiting from _process_curses_requests");
} }
Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0);
memset(Xcurscr, 0, SP->XcurscrSize); memset(Xcurscr, 0, SP->XcurscrSize);
@ -2385,7 +2385,7 @@ static void _resize(void)
static void _set_title(void) static void _set_title(void)
{ {
char title[1024]; /* big enough for window title */ char title[1024]; /* big enough for window title */
int pos; int pos;
if ((XC_read_socket(xc_display_sock, &pos, sizeof(int)) < 0) || 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 else
{ {
/* Here all is OK, send PDC_CLIP_SUCCESS, then length, then /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then
contents */ contents */
if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) < 0) 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; wcontents[i] = 0;
len = i; 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 */ contents */
if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) >= 0) if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) >= 0)
if (XC_write_display_socket_int(len) >= 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) wcontents, len * sizeof(wchar_t)) >= 0)
{ {
free(wcontents); free(wcontents);
@ -2598,40 +2598,40 @@ static void _resume_curses(void)
/* The curses process sent us a message */ /* The curses process sent us a message */
static void _process_curses_requests(XtPointer client_data, int *fid, static void _process_curses_requests(XtPointer client_data, int *fid,
XtInputId *id) XtInputId *id)
{ {
struct timeval socket_timeout = {0}; struct timeval socket_timeout = {0};
int s; int s;
int old_row, new_row; int old_row, new_row;
int old_x, new_x; int old_x, new_x;
int pos, num_cols; 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")); XC_LOG(("_process_curses_requests() - called\n"));
if (!received_map_notify) if (!received_map_notify)
return; return;
FD_ZERO(&xc_readfds); FD_ZERO(&xc_readfds);
FD_SET(xc_display_sock, &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) NULL, &socket_timeout)) < 0)
_exit_process(2, SIGKILL, "exiting from _process_curses_requests" _exit_process(2, SIGKILL, "exiting from _process_curses_requests"
" - select failed"); " - select failed");
if (!s) /* no requests pending - should never happen! */ if (!s) /* no requests pending - should never happen! */
return; 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 /* read first integer to determine total message has been
received */ received */
XC_LOG(("_process_curses_requests() - before XC_read_socket()\n")); 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" _exit_process(3, SIGKILL, "exiting from _process_curses_requests"
" - first read"); " - first read");
@ -2639,8 +2639,8 @@ static void _process_curses_requests(XtPointer client_data, int *fid,
after_first_curses_request = TRUE; after_first_curses_request = TRUE;
switch(num_cols) switch(num_cols)
{ {
case CURSES_EXIT: /* request from curses to stop */ case CURSES_EXIT: /* request from curses to stop */
XC_LOG(("CURSES_EXIT received from child\n")); XC_LOG(("CURSES_EXIT received from child\n"));
_exit_process(0, 0, "XCursesProcess requested to exit by child"); _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); XBell(XCURSESDISPLAY, 50);
break; break;
/* request from curses to confirm completion of display */ /* request from curses to confirm completion of display */
case CURSES_REFRESH: case CURSES_REFRESH:
XC_LOG(("CURSES_REFRESH received from child\n")); XC_LOG(("CURSES_REFRESH received from child\n"));
_refresh_screen(); _refresh_screen();
_resume_curses(); _resume_curses();
break; break;
@ -2670,7 +2670,7 @@ static void _process_curses_requests(XtPointer client_data, int *fid,
_exit_process(5, SIGKILL, "exiting from CURSES_CURSOR " _exit_process(5, SIGKILL, "exiting from CURSES_CURSOR "
"_process_curses_requests"); "_process_curses_requests");
memcpy(&pos, buf, sizeof(int)); memcpy(&pos, buf, sizeof(int));
old_row = pos & 0xFF; old_row = pos & 0xFF;
old_x = pos >> 8; old_x = pos >> 8;
@ -2690,9 +2690,9 @@ static void _process_curses_requests(XtPointer client_data, int *fid,
cursor will stay solid. */ cursor will stay solid. */
if (window_entered) if (window_entered)
{ {
if (visible_cursor) if (visible_cursor)
{ {
/* Cursor currently ON, turn it off */ /* Cursor currently ON, turn it off */
int save_visibility = SP->visibility; int save_visibility = SP->visibility;
@ -2701,16 +2701,16 @@ static void _process_curses_requests(XtPointer client_data, int *fid,
SP->visibility = save_visibility; SP->visibility = save_visibility;
visible_cursor = FALSE; visible_cursor = FALSE;
} }
else else
{ {
/* Cursor currently OFF, turn it on */ /* Cursor currently OFF, turn it on */
_redraw_cursor(); _redraw_cursor();
visible_cursor = TRUE; visible_cursor = TRUE;
} }
} }
break; break;
case CURSES_TITLE: case CURSES_TITLE:
XC_LOG(("CURSES_TITLE received from child\n")); 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: case CURSES_RESIZE:
XC_LOG(("CURSES_RESIZE received from child\n")); XC_LOG(("CURSES_RESIZE received from child\n"));
_resize(); _resize();
_resume_curses(); _resume_curses();
break; break;
case CURSES_GET_SELECTION: case CURSES_GET_SELECTION:
XC_LOG(("CURSES_GET_SELECTION received from child\n")); 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(); _resume_curses();
break; break;
default: default:
PDC_LOG(("%s:Unknown request %d\n", XCLOGMSG, num_cols)); 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) XEvent *event, Boolean *unused)
{ {
XC_LOG(("_handle_structure_notify() - called\n")); XC_LOG(("_handle_structure_notify() - called\n"));
@ -2922,10 +2922,10 @@ int XCursesSetupX(int argc, char *argv[])
/* Check application resource values here */ /* 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; 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; xc_app_data.normalFont->max_bounds.descent;
font_ascent = xc_app_data.normalFont->max_bounds.ascent; 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->max_bounds.rbearing -
xc_app_data.italicFont->min_bounds.lbearing || xc_app_data.italicFont->min_bounds.lbearing ||
font_height != font_height !=
xc_app_data.italicFont->max_bounds.ascent + xc_app_data.italicFont->max_bounds.ascent +
xc_app_data.italicFont->max_bounds.descent; xc_app_data.italicFont->max_bounds.descent;
/* Calculate size of display window */ /* Calculate size of display window */
@ -2978,28 +2978,28 @@ int XCursesSetupX(int argc, char *argv[])
if (xc_app_data.scrollbarWidth && sb_started) if (xc_app_data.scrollbarWidth && sb_started)
{ {
scrollBox = XtVaCreateManagedWidget(program_name, scrollBox = XtVaCreateManagedWidget(program_name,
scrollBoxWidgetClass, topLevel, XtNwidth, scrollBoxWidgetClass, topLevel, XtNwidth,
window_width + xc_app_data.scrollbarWidth, window_width + xc_app_data.scrollbarWidth,
XtNheight, window_height + xc_app_data.scrollbarWidth, XtNheight, window_height + xc_app_data.scrollbarWidth,
XtNwidthInc, font_width, XtNheightInc, font_height, NULL); XtNwidthInc, font_width, XtNheightInc, font_height, NULL);
drawing = XtVaCreateManagedWidget(program_name, drawing = XtVaCreateManagedWidget(program_name,
boxWidgetClass, scrollBox, XtNwidth, boxWidgetClass, scrollBox, XtNwidth,
window_width, XtNheight, window_height, XtNwidthInc, window_width, XtNheight, window_height, XtNwidthInc,
font_width, XtNheightInc, font_height, NULL); font_width, XtNheightInc, font_height, NULL);
scrollVert = XtVaCreateManagedWidget("scrollVert", scrollVert = XtVaCreateManagedWidget("scrollVert",
scrollbarWidgetClass, scrollBox, XtNorientation, scrollbarWidgetClass, scrollBox, XtNorientation,
XtorientVertical, XtNheight, window_height, XtNwidth, XtorientVertical, XtNheight, window_height, XtNwidth,
xc_app_data.scrollbarWidth, NULL); xc_app_data.scrollbarWidth, NULL);
XtAddCallback(scrollVert, XtNscrollProc, _scroll_up_down, drawing); XtAddCallback(scrollVert, XtNscrollProc, _scroll_up_down, drawing);
XtAddCallback(scrollVert, XtNjumpProc, _thumb_up_down, drawing); XtAddCallback(scrollVert, XtNjumpProc, _thumb_up_down, drawing);
scrollHoriz = XtVaCreateManagedWidget("scrollHoriz", scrollHoriz = XtVaCreateManagedWidget("scrollHoriz",
scrollbarWidgetClass, scrollBox, XtNorientation, scrollbarWidgetClass, scrollBox, XtNorientation,
XtorientHorizontal, XtNwidth, window_width, XtNheight, XtorientHorizontal, XtNwidth, window_width, XtNheight,
xc_app_data.scrollbarWidth, NULL); xc_app_data.scrollbarWidth, NULL);
XtAddCallback(scrollHoriz, XtNscrollProc, _scroll_left_right, drawing); XtAddCallback(scrollHoriz, XtNscrollProc, _scroll_left_right, drawing);
@ -3036,7 +3036,7 @@ int XCursesSetupX(int argc, char *argv[])
LINES = XCursesLINES; LINES = XCursesLINES;
COLS = XCursesCOLS; COLS = XCursesCOLS;
if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN,
0700 | IPC_CREAT)) < 0) 0700 | IPC_CREAT)) < 0)
{ {
perror("Cannot allocate shared memory for SCREEN"); 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)); 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) XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0)
{ {
perror("Cannot allocate shared memory for curscr"); 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); 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); xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF);
PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d LINES %d COLS %d\n", 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 */ /* Add Event handlers to the drawing widget */
XtAddEventHandler(drawing, ExposureMask, False, _handle_expose, NULL); XtAddEventHandler(drawing, ExposureMask, False, _handle_expose, NULL);
XtAddEventHandler(drawing, StructureNotifyMask, False, XtAddEventHandler(drawing, StructureNotifyMask, False,
_handle_structure_notify, NULL); _handle_structure_notify, NULL);
XtAddEventHandler(drawing, EnterWindowMask | LeaveWindowMask, False, XtAddEventHandler(drawing, EnterWindowMask | LeaveWindowMask, False,
_handle_enter_leave, NULL); _handle_enter_leave, NULL);
XtAddEventHandler(topLevel, 0, True, _handle_nonmaskable, 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) */ program) */
XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask, XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask,
_process_curses_requests, NULL); _process_curses_requests, NULL);
/* If there is a cursorBlink resource, start the Timeout event */ /* 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, XtAppAddTimeOut(app_context, xc_app_data.cursorBlinkRate,
_blink_cursor, NULL); _blink_cursor, NULL);
/* Leave telling the curses process that it can start to here so /* Leave telling the curses process that it can start to here so
that when the curses process makes a request, the Xcurses that when the curses process makes a request, the Xcurses
process can service the request. */ process can service the request. */
XC_write_display_socket_int(CURSES_CHILD); 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(&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); xc_app_data.normalFont, COLOR_WHITE, COLOR_BLACK);
_get_gc(&block_cursor_gc, xc_app_data.normalFont, _get_gc(&block_cursor_gc, xc_app_data.normalFont,

View File

@ -35,7 +35,7 @@
MODULE_ID("$Id: fld_ftchoice.c,v 1.12 2010/01/23 21:14:35 tom Exp $") 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( | Function : int set_fieldtype_choice(
| FIELDTYPE *typ, | FIELDTYPE *typ,
| bool (* const next_choice)(FIELD *,const void *), | bool (* const next_choice)(FIELD *,const void *),

View File

@ -35,14 +35,14 @@
MODULE_ID("$Id: fld_ftlink.c,v 1.14 2010/01/23 21:14:35 tom Exp $") 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( | Function : FIELDTYPE *link_fieldtype(
| FIELDTYPE *type1, | FIELDTYPE *type1,
| FIELDTYPE *type2) | FIELDTYPE *type2)
| |
| Description : Create a new fieldtype built from the two given types. | Description : Create a new fieldtype built from the two given types.
| They are connected by an logical 'OR'. | 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_BAD_ARGUMENT - invalid arguments
| E_SYSTEM_ERROR - system error (no memory) | E_SYSTEM_ERROR - system error (no memory)
| |

View File

@ -35,12 +35,12 @@
MODULE_ID("$Id: fld_info.c,v 1.11 2010/01/23 21:14:35 tom Exp $") 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, | Function : int field_info(const FIELD *field,
| int *rows, int *cols, | int *rows, int *cols,
| int *frow, int *fcol, | int *frow, int *fcol,
| int *nrow, int *nbuf) | int *nrow, int *nbuf)
| |
| Description : Retrieve infos about the fields creation parameters. | Description : Retrieve infos about the fields creation parameters.
| |
| Return Values : E_OK - success | 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, | Function : int dynamic_field_info(const FIELD *field,
| int *drows, int *dcols, | int *drows, int *dcols,
| int *maxgrow) | int *maxgrow)
| |
| Description : Retrieve informations about a dynamic fields current | Description : Retrieve informations about a dynamic fields current
| dynamic parameters. | dynamic parameters.
| |

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $") 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) | Function : int set_field_just(FIELD *field, int just)
| |
| Description : Set the fields type of justification. | Description : Set the fields type of justification.
| |
| Return Values : E_OK - success | 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 ) | Function : int field_just( const FIELD *field )
| |
| Description : Retrieve the fields type of justification | Description : Retrieve the fields type of justification
| |
| Return Values : The justification type. | Return Values : The justification type.

View File

@ -35,14 +35,14 @@
MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $") MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
| Facility : libnform | Facility : libnform
| Function : FIELD *link_field(FIELD *field, int frow, int fcol) | Function : FIELD *link_field(FIELD *field, int frow, int fcol)
| |
| Description : Duplicates the field at the specified position. The | Description : Duplicates the field at the specified position. The
| new field shares its buffers with the original one, | new field shares its buffers with the original one,
| the attributes are independent. | the attributes are independent.
| If an error occurs, errno is set to | If an error occurs, errno is set to
| |
| E_BAD_ARGUMENT - invalid argument | E_BAD_ARGUMENT - invalid argument
| E_SYSTEM_ERROR - system error | E_SYSTEM_ERROR - system error
| |

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_max_field(FIELD *field, int maxgrow)
| |
| Description : Set the maximum growth for a dynamic field. If maxgrow=0 | Description : Set the maximum growth for a dynamic field. If maxgrow=0
| the field may grow to any possible size. | the field may grow to any possible size.
| |

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $") 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) | Function : int move_field(FIELD *field,int frow, int fcol)
| |
| Description : Moves the disconnected field to the new location in | Description : Moves the disconnected field to the new location in
| the forms subwindow. | the forms subwindow.
| |

View File

@ -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) | Function : int set_field_opts(FIELD *field, Field_Options opts)
| |
| Description : Turns on the named options for this field and turns | Description : Turns on the named options for this field and turns
| off all the remaining options. | 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) | Function : Field_Options field_opts(const FIELD *field)
| |
| Description : Retrieve the fields options. | Description : Retrieve the fields options.
| |
| Return Values : The 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) | 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. | remaining options are unchanged.
| |
| Return Values : E_OK - success | 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) | 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. | remaining options are unchanged.
| |
| Return Values : E_OK - success | Return Values : E_OK - success

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_pad.c,v 1.10 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_field_pad(FIELD *field, int ch)
| |
| Description : Set the pad character used to fill the field. This must | Description : Set the pad character used to fill the field. This must
| be a printable character. | 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) | Function : int field_pad(const FIELD *field)
| |
| Description : Retrieve the fields pad character. | Description : Retrieve the fields pad character.
| |
| Return Values : The pad character. | Return Values : The pad character.

View File

@ -35,10 +35,10 @@
MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $") 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) | 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. | the form.
| |
| Return Values : E_OK - success | 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) | Function : bool new_page(const FIELD *field)
| |
| Description : Retrieve the info whether or not the field starts a | Description : Retrieve the info whether or not the field starts a
| new page on the form. | new page on the form.
| |

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_field_status(FIELD *field, bool status)
| |
| Description : Set or clear the 'changed' indication flag for that | Description : Set or clear the 'changed' indication flag for that
| fields primary buffer. | 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) | Function : bool field_status(const FIELD *field)
| |
| Description : Retrieve the value of the 'changed' indication flag | 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 | Return Values : TRUE - buffer has been changed
| FALSE - buffer has not been changed | FALSE - buffer has not been changed

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_type.c,v 1.16 2010/01/23 21:14:36 tom Exp $") 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,...) | Function : int set_field_type(FIELD *field, FIELDTYPE *type,...)
| |
| Description : Associate the specified fieldtype with the field. | Description : Associate the specified fieldtype with the field.
| Certain field types take additional arguments. Look | Certain field types take additional arguments. Look
| at the spec of the field types ! | 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) | Function : FIELDTYPE *field_type(const FIELD *field)
| |
| Description : Retrieve the associated fieldtype for this field. | Description : Retrieve the associated fieldtype for this field.
| |
| Return Values : Pointer to fieldtype of NULL if none is defined. | Return Values : Pointer to fieldtype of NULL if none is defined.

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: fld_user.c,v 1.16 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_field_userptr(FIELD *field, void *usrptr)
| |
| Description : Set the pointer that is reserved in any field to store | Description : Set the pointer that is reserved in any field to store
| application relevant informations | 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) | Function : void *field_userptr(const FIELD *field)
| |
| Description : Return the pointer that is reserved in any field to | Description : Return the pointer that is reserved in any field to
| store application relevant informations. | store application relevant informations.
| |

View File

@ -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_TYPE_IPV4(void);
extern NCURSES_EXPORT(FIELDTYPE *) extern NCURSES_EXPORT(FIELDTYPE *)
_nc_generic_fieldtype(bool (*const field_check) (FORM*, _nc_generic_fieldtype(bool (*const field_check) (FORM*,
FIELD *, FIELD *,
const void *), const void *),
bool (*const char_check) (int, bool (*const char_check) (int,
FORM*, FORM*,
FIELD*, FIELD*,
const void *), const void *),
bool (*const next)(FORM*,FIELD*,const void*), bool (*const next)(FORM*,FIELD*,const void*),
bool (*const prev)(FORM*,FIELD*,const void*), bool (*const prev)(FORM*,FIELD*,const void*),

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: frm_cursor.c,v 1.10 2010/01/23 21:14:36 tom Exp $") 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) | Function : int pos_form_cursor(FORM * form)
| |
| Description : Moves the form window cursor to the location required | Description : Moves the form window cursor to the location required
| by the form driver to resume form processing. This may | by the form driver to resume form processing. This may
| be needed after the application calls a curses library | be needed after the application calls a curses library

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: frm_data.c,v 1.15 2010/01/23 21:14:36 tom Exp $") 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) | Function : bool data_behind(const FORM *form)
| |
| Description : Check for off-screen data behind. This is nearly trivial | Description : Check for off-screen data behind. This is nearly trivial
| because the beginning of a field is fixed. | 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( | Function : static char * Only_Padding(
| WINDOW *w, | WINDOW *w,
| int len, | int len,
| int pad) | int pad)
| |
| Description : Test if 'length' cells starting at the current position | Description : Test if 'length' cells starting at the current position
| contain a padding character. | 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) | Function : bool data_ahead(const FORM *form)
| |
| Description : Check for off-screen data ahead. This is more difficult | 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 | Return Values : TRUE - there are off-screen data ahead
| FALSE - there are no off-screen data ahead | FALSE - there are no off-screen data ahead

View File

@ -64,11 +64,11 @@ static FORM default_form =
NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
| Facility : libnform | Facility : libnform
| Function : static FIELD *Insert_Field_By_Position( | Function : static FIELD *Insert_Field_By_Position(
| FIELD *new_field, | FIELD *new_field,
| FIELD *head ) | FIELD *head )
| |
| Description : Insert new_field into sorted fieldlist with head "head" | Description : Insert new_field into sorted fieldlist with head "head"
| and return new head of sorted fieldlist. Sorting | and return new head of sorted fieldlist. Sorting
| criteria is (row,column). This is a circular list. | 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) | Function : static void Disconnect_Fields(FORM *form)
| |
| Description : Break association between form and array of fields. | Description : Break association between form and array of fields.
| |
| Return Values : - | Return Values : -
@ -142,9 +142,9 @@ Disconnect_Fields(FORM *form)
} }
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
| Facility : libnform | Facility : libnform
| Function : static int Connect_Fields(FORM *form, FIELD **fields) | Function : static int Connect_Fields(FORM *form, FIELD **fields)
| |
| Description : Set association between form and array of fields. | Description : Set association between form and array of fields.
| |
| Return Values : E_OK - no error | 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) | 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. | If there are fields, position to first active field.
| |
| Return Values : E_OK - success | 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 ) | Function : FORM *new_form_sp(SCREEN* sp, FIELD** fields )
| |
| Description : Create new form with given array of fields. | Description : Create new form with given array of fields.
| |
| Return Values : Pointer to form. NULL if error occurred. | 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 ) | Function : FORM* new_form(FIELD** fields )
| |
| Description : Create new form with given array of fields. | Description : Create new form with given array of fields.
| |
| Return Values : Pointer to form. NULL if error occurred. | Return Values : Pointer to form. NULL if error occurred.
@ -351,9 +351,9 @@ new_form(FIELD **fields)
#endif #endif
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
| Facility : libnform | Facility : libnform
| Function : int free_form( FORM *form ) | Function : int free_form( FORM *form )
| |
| Description : Release internal memory associated with form. | Description : Release internal memory associated with form.
| |
| Return Values : E_OK - no error | 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 ) | Function : int set_form_fields( FORM *form, FIELD **fields )
| |
| Description : Set a new association of an array of fields to a form | Description : Set a new association of an array of fields to a form
| |
| Return Values : E_OK - no error | 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 ) | Function : FIELD **form_fields( const FORM *form )
| |
| Description : Retrieve array of fields | Description : Retrieve array of fields
| |
| Return Values : Pointer to field array | 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 ) | Function : int field_count( const FORM *form )
| |
| Description : Retrieve number of fields | Description : Retrieve number of fields
| |
| Return Values : Number of fields, -1 if none are defined | Return Values : Number of fields, -1 if none are defined

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_form_opts(FORM *form, Form_Options opts)
| |
| Description : Turns on the named options and turns off all the | Description : Turns on the named options and turns off all the
| remaining options for that form. | 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 *) | Function : Form_Options form_opts(const FORM *)
| |
| Description : Retrieves the current form options. | Description : Retrieves the current form options.
| |
| Return Values : The option flags. | 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) | 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. | changed.
| |
| Return Values : E_OK - success | Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options | E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
NCURSES_EXPORT(int) 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) | 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. | changed.
| |
| Return Values : E_OK - success | Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options | E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
NCURSES_EXPORT(int) NCURSES_EXPORT(int)

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: frm_page.c,v 1.11 2010/01/23 21:14:36 tom Exp $") 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) | Function : int set_form_page(FORM * form,int page)
| |
| Description : Set the page number of the form. | Description : Set the page number of the form.
| |
| Return Values : E_OK - success | 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) | Function : int form_page(const FORM * form)
| |
| Description : Return the current page of the form. | Description : Return the current page of the form.
| |
| Return Values : >= 0 : current page number | Return Values : >= 0 : current page number

Some files were not shown because too many files have changed in this diff Show More