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

View File

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

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

View File

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

View File

@ -343,7 +343,7 @@ void inputTest(WINDOW *win)
sw = w / 3;
sh = h / 3;
if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2))
if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2))
== NULL)
return;
@ -424,11 +424,11 @@ void inputTest(WINDOW *win)
else if (BUTTON_CHANGED(3))
button = 3;
if (button && (BUTTON_STATUS(button) &
if (button && (BUTTON_STATUS(button) &
BUTTON_MODIFIER_MASK))
{
waddstr(win, " Modifier(s):");
if (BUTTON_STATUS(button) & BUTTON_SHIFT)
waddstr(win, " SHIFT");
@ -611,7 +611,7 @@ void outputTest(WINDOW *win)
wmove(win1, 8, 26);
wrefresh(win1);
wgetch(win1);
wclear(win1);
wattron(win1, A_BLINK);
@ -892,7 +892,7 @@ void acsTest(WINDOW *win)
"ACS_LARROW", "ACS_RARROW", "ACS_UARROW", "ACS_DARROW",
"ACS_BOARD", "ACS_LANTERN", "ACS_BLOCK"
#ifdef ACS_S3
, "ACS_S3", "ACS_S7", "ACS_LEQUAL", "ACS_GEQUAL",
, "ACS_S3", "ACS_S7", "ACS_LEQUAL", "ACS_GEQUAL",
"ACS_PI", "ACS_NEQUAL", "ACS_STERLING"
#endif
};
@ -902,17 +902,17 @@ void acsTest(WINDOW *win)
#if HAVE_WIDE
cchar_t *wacs_values[] =
{
WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER,
WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE,
WACS_ULCORNER, WACS_URCORNER, WACS_LLCORNER, WACS_LRCORNER,
WACS_LTEE, WACS_RTEE, WACS_TTEE, WACS_BTEE, WACS_HLINE,
WACS_VLINE, WACS_PLUS,
WACS_S1, WACS_S9, WACS_DIAMOND, WACS_CKBOARD, WACS_DEGREE,
WACS_S1, WACS_S9, WACS_DIAMOND, WACS_CKBOARD, WACS_DEGREE,
WACS_PLMINUS, WACS_BULLET,
WACS_LARROW, WACS_RARROW, WACS_UARROW, WACS_DARROW, WACS_BOARD,
WACS_LARROW, WACS_RARROW, WACS_UARROW, WACS_DARROW, WACS_BOARD,
WACS_LANTERN, WACS_BLOCK
# ifdef WACS_S3
, WACS_S3, WACS_S7, WACS_LEQUAL, WACS_GEQUAL, WACS_PI,
, WACS_S3, WACS_S7, WACS_LEQUAL, WACS_GEQUAL, WACS_PI,
WACS_NEQUAL, WACS_STERLING
# endif
};
@ -923,7 +923,7 @@ void acsTest(WINDOW *win)
static const wchar_t greek[] = {0x0395, 0x03bb, 0x03bb, 0x03b7,
0x03bd, 0x03b9, 0x03ba, 0x03ac, 0};
static const wchar_t georgian[] = {0x10e5, 0x10d0, 0x10e0, 0x10d7,
static const wchar_t georgian[] = {0x10e5, 0x10d0, 0x10e0, 0x10d7,
0x10e3, 0x10da, 0x10d8, L' ', 0x10d4, 0x10dc, 0x10d0, 0};
#endif
@ -993,13 +993,13 @@ void colorTest(WINDOW *win)
{
static const short colors[] =
{
COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE,
COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE,
COLOR_CYAN, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE
};
static const char *colornames[] =
{
"COLOR_BLACK", "COLOR_RED", "COLOR_GREEN", "COLOR_BLUE",
"COLOR_BLACK", "COLOR_RED", "COLOR_GREEN", "COLOR_BLUE",
"COLOR_CYAN", "COLOR_MAGENTA", "COLOR_YELLOW", "COLOR_WHITE"
};

View File

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

View File

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

View File

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

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] =
{
A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10),
A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19),
A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10),
A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19),
A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
')', '*',
A(0x1a), A(0x1b), A(0x18), A(0x19),
@ -25,17 +25,17 @@ chtype acs_map[128] =
0xdb,
'1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
'>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
'>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
A(0x04), 0xb1,
'b', 'c', 'd', 'e',
0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d,
0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3,
0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d,
0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3,
0xd8, 0x9c, 0xf9,
A(127)
@ -72,7 +72,7 @@ void PDC_gotoyx(int row, int col)
PDCINT(0x10, regs);
}
/* update the given physical line to look like the corresponding line in
/* update the given physical line to look like the corresponding line in
curscr */
void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
@ -93,7 +93,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
struct {unsigned char text, attr;} temp_line[256];
/* replace the attribute part of the chtype with the actual
/* replace the attribute part of the chtype with the actual
color value for each chtype in the line */
for (j = 0; j < len; j++)

View File

@ -117,7 +117,7 @@ typedef union
struct
{
unsigned short di, di_hi, si, si_hi, bp, bp_hi, res, res_hi,
bx, bx_hi, dx, dx_hi, cx, cx_hi, ax, ax_hi,
bx, bx_hi, dx, dx_hi, cx, cx_hi, ax, ax_hi,
flags, es, ds, fs, gs, ip, cs, sp, ss;
} w;

View File

@ -1,5 +1,5 @@
/* Public Domain Curses */
/* MS C doesn't return flags from int86() */
#ifdef MSC
# define USE_KBHIT
@ -21,7 +21,7 @@ RCSID("$Id: pdckbd.c,v 1.87 2008/07/13 16:08:17 wmcbrine Exp $")
unsigned long PDC_get_input_fd(void);
Description:
PDC_get_input_fd() returns the file descriptor that PDCurses
PDC_get_input_fd() returns the file descriptor that PDCurses
reads its input from. It can be used for select().
Portability X/Open BSD SYS V
@ -277,7 +277,7 @@ static int _process_mouse_events(void)
{
if (button[i].pressed)
{
/* Check for a click -- a PRESS followed
/* Check for a click -- a PRESS followed
immediately by a release */
if (!button[i].released)
@ -451,14 +451,14 @@ int PDC_get_key(void)
return key;
}
/* discard any pending keyboard or mouse input -- this is the core
/* discard any pending keyboard or mouse input -- this is the core
routine for flushinp() */
void PDC_flushinp(void)
{
PDC_LOG(("PDC_flushinp() - called\n"));
/* Force the BIOS keyboard buffer head and tail pointers to be
/* Force the BIOS keyboard buffer head and tail pointers to be
the same... Real nasty trick... */
setdosmemword(0x41a, getdosmemword(0x41c));

View File

@ -84,10 +84,10 @@ static int _get_font(void)
return retval;
}
/* _set_font() - Sets the current font size, if the adapter allows such a
change. It is an error to attempt to change the font size on a
"bogus" adapter. The reason for this is that we have a known video
adapter identity problem. e.g. Two adapters report the same identifying
/* _set_font() - Sets the current font size, if the adapter allows such a
change. It is an error to attempt to change the font size on a
"bogus" adapter. The reason for this is that we have a known video
adapter identity problem. e.g. Two adapters report the same identifying
characteristics. */
static void _set_font(int size)
@ -154,7 +154,7 @@ static void _set_font(int size)
pdc_font = _get_font();
}
/* _set_80x25() - force a known screen state: 80x25 text mode. Forces the
/* _set_80x25() - force a known screen state: 80x25 text mode. Forces the
appropriate 80x25 alpha mode given the display adapter. */
static void _set_80x25(void)
@ -193,7 +193,7 @@ static int _get_scrn_mode(void)
return (int)regs.h.al;
}
/* _set_scrn_mode() - Sets the BIOS Video Mode Number only if it is
/* _set_scrn_mode() - Sets the BIOS Video Mode Number only if it is
different from the current video mode. */
static void _set_scrn_mode(int new_mode)
@ -213,7 +213,7 @@ static void _set_scrn_mode(int new_mode)
COLS = PDC_get_columns();
}
/* _sanity_check() - A video adapter identification sanity check. This
/* _sanity_check() - A video adapter identification sanity check. This
routine will force sane values for various control flags. */
static int _sanity_check(int adapter)
@ -230,7 +230,7 @@ static int _sanity_check(int adapter)
switch (rows)
{
case 25:
case 43:
case 43:
break;
default:
pdc_bogus_adapter = TRUE;
@ -445,7 +445,7 @@ static int _query_adapter_type(void)
return _sanity_check(retval);
}
/* close the physical screen -- may restore the screen to its state
/* close the physical screen -- may restore the screen to its state
before PDC_scr_open(); miscellaneous cleanup */
void PDC_scr_close(void)
@ -503,7 +503,7 @@ void PDC_scr_free(void)
pdc_atrtab = (unsigned char *)NULL;
}
/* open the physical screen -- allocate SP, miscellaneous intialization,
/* open the physical screen -- allocate SP, miscellaneous intialization,
and may save the existing screen for later restoration */
int PDC_scr_open(int argc, char **argv)
@ -543,7 +543,7 @@ int PDC_scr_open(int argc, char **argv)
SP->mouse_wait = PDC_CLICK_PERIOD;
SP->audible = TRUE;
/* If the environment variable PDCURSES_BIOS is set, the DOS int10()
/* If the environment variable PDCURSES_BIOS is set, the DOS int10()
BIOS calls are used in place of direct video memory access. */
if (getenv("PDCURSES_BIOS"))
@ -596,7 +596,7 @@ int PDC_resize_screen(int nlines, int ncols)
PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n",
nlines, ncols));
/* Trash the stored value of orig_cursor -- it's only good if the
/* Trash the stored value of orig_cursor -- it's only good if the
video mode doesn't change */
SP->orig_cursor = 0x0607;

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

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

View File

@ -4,7 +4,7 @@
RCSID("$Id: pdcdisp.c,v 1.49 2008/07/14 04:24:51 wmcbrine Exp $")
/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these
/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these
match code page 437 and compatible pages (CP850, CP852, etc.) */
#ifdef CHTYPE_LONG
@ -70,7 +70,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno));
/* replace the attribute part of the chtype with the
/* replace the attribute part of the chtype with the
actual color value for each chtype in the line */
for (j = 0; j < len; j++)

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

View File

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

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

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

View File

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

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

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

View File

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

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);
Description:
erase() and werase() copy blanks (i.e. the background chtype) to
erase() and werase() copy blanks (i.e. the background chtype) to
every cell of the window.
clear() and wclear() are similar to erase() and werase(), but
they also call clearok() to ensure that the the window is
they also call clearok() to ensure that the the window is
cleared on the next wrefresh().
clrtobot() and wclrtobot() clear the window from the current
clrtobot() and wclrtobot() clear the window from the current
cursor position to the end of the window.
clrtoeol() and wclrtoeol() clear the window from the current

View File

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

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 *, ...);
Description:
traceon() and traceoff() toggle the recording of debugging
information to the file "trace". Although not standard, similar
traceon() and traceoff() toggle the recording of debugging
information to the file "trace". Although not standard, similar
functions are in some other curses implementations.
PDC_debug() is the function that writes to the file, based on
whether traceon() has been called. It's used from the PDC_LOG()
PDC_debug() is the function that writes to the file, based on
whether traceon() has been called. It's used from the PDC_LOG()
macro.
Portability X/Open BSD SYS V
@ -43,7 +43,7 @@ void PDC_debug(const char *fmt, ...)
time_t now;
if (!pdc_trace_on)
return;
return;
/* open debug log file append */

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

View File

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

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);
Description:
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
a character is read from the terminal associated with the window.
In nodelay mode, if there is no input waiting, the value ERR is
returned. In delay mode, the program will hang until the system
passes text through to the program. Depending on the setting of
cbreak(), this will be after one character or after the first
newline. Unless noecho() has been set, the character will also
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
a character is read from the terminal associated with the window.
In nodelay mode, if there is no input waiting, the value ERR is
returned. In delay mode, the program will hang until the system
passes text through to the program. Depending on the setting of
cbreak(), this will be after one character or after the first
newline. Unless noecho() has been set, the character will also
be echoed into the designated window.
If keypad() is TRUE, and a function key is pressed, the token for
@ -44,25 +44,25 @@ RCSID("$Id: getch.c,v 1.72 2008/07/13 16:08:18 wmcbrine Exp $")
If nodelay(win, TRUE) has been called on the window and no input
is waiting, the value ERR is returned.
ungetch() places ch back onto the input queue to be returned by
ungetch() places ch back onto the input queue to be returned by
the next call to wgetch().
flushinp() throws away any type-ahead that has been typed by the
flushinp() throws away any type-ahead that has been typed by the
user and has not yet been read by the program.
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
control, alt, numlock) effective at the time of the last getch()
call, if PDC_save_key_modifiers(TRUE) has been called before the
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
modifier(s) were set. PDC_return_key_modifiers() tells getch()
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
control, alt, numlock) effective at the time of the last getch()
call, if PDC_save_key_modifiers(TRUE) has been called before the
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
modifier(s) were set. PDC_return_key_modifiers() tells getch()
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
etc.). These may not work on all platforms.
NOTE: getch() and ungetch() are implemented as macros, to avoid
NOTE: getch() and ungetch() are implemented as macros, to avoid
conflict with many DOS compiler's runtime libraries.
Return Value:
These functions return ERR or the value of the character, meta
These functions return ERR or the value of the character, meta
character or function key token.
Portability X/Open BSD SYS V
@ -173,7 +173,7 @@ int wgetch(WINDOW *win)
else
if (win->_delayms)
{
/* Can't really do millisecond intervals, so delay in
/* Can't really do millisecond intervals, so delay in
1/20ths of a second (50ms) */
waitcount = win->_delayms / 50;
@ -181,7 +181,7 @@ int wgetch(WINDOW *win)
waitcount = 1;
}
/* refresh window when wgetch is called if there have been changes
/* refresh window when wgetch is called if there have been changes
to it and it is not a pad */
if (!(win->_flags & _PAD) && ((!win->_leaveit &&
@ -240,7 +240,7 @@ int wgetch(WINDOW *win)
if (!win->_use_keypad)
key = -1;
/* filter mouse events; translate mouse clicks in the slk
/* filter mouse events; translate mouse clicks in the slk
area to function keys */
else if (key == KEY_MOUSE)

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

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);
Description:
The getyx() macro (defined in curses.h -- the prototypes here
are merely illustrative) puts the current cursor position of the
specified window into y and x. getbegyx() and getmaxyx() return
the starting coordinates and size of the specified window,
respectively. getparyx() returns the starting coordinates of the
parent's window, if the specified window is a subwindow;
The getyx() macro (defined in curses.h -- the prototypes here
are merely illustrative) puts the current cursor position of the
specified window into y and x. getbegyx() and getmaxyx() return
the starting coordinates and size of the specified window,
respectively. getparyx() returns the starting coordinates of the
parent's window, if the specified window is a subwindow;
otherwise it sets y and x to -1. These are all macros.
getsyx() gets the coordinates of the virtual screen cursor, and

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

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);
Description:
These routines read a chtype or cchar_t string from the window,
starting at the current or specified position, and ending at the
These routines read a chtype or cchar_t string from the window,
starting at the current or specified position, and ending at the
right margin, or after n elements, whichever is less.
Return Value:
All functions return the number of elements read, or ERR on
All functions return the number of elements read, or ERR on
error.
Portability X/Open BSD SYS V

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

View File

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

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);
Description:
The insch() functions insert a chtype into the window at the
current or specified cursor position. The cursor is NOT
advanced. A newline is equivalent to clrtoeol(); tabs are
expanded; other control characters are converted as with
The insch() functions insert a chtype into the window at the
current or specified cursor position. The cursor is NOT
advanced. A newline is equivalent to clrtoeol(); tabs are
expanded; other control characters are converted as with
unctrl().
The ins_wch() functions are the wide-character
equivalents, taking cchar_t pointers rather than chtypes.
Video attributes can be combined with a character by ORing
them into the parameter. Text, including attributes, can be
them into the parameter. Text, including attributes, can be
copied from one place to another using inch() and insch().
insrawch() etc. are PDCurses-specific wrappers for insch() etc.
insrawch() etc. are PDCurses-specific wrappers for insch() etc.
that disable the translation of control characters.
Return Value:

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

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

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

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);
Description:
keyname() returns a string corresponding to the argument key.
keyname() returns a string corresponding to the argument key.
key may be any key returned by wgetch().
key_name() is the wide-character version. It takes a wchar_t
key_name() is the wide-character version. It takes a wchar_t
parameter, but still returns a char *.
has_key() returns TRUE for recognized keys, FALSE otherwise.
has_key() returns TRUE for recognized keys, FALSE otherwise.
This function is an ncurses extension.
Portability X/Open BSD SYS V

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

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

View File

@ -43,7 +43,7 @@ RCSID("$Id: overlay.c,v 1.36 2008/07/14 12:35:23 wmcbrine Exp $")
**man-end****************************************************************/
/* Thanks to Andreas Otte <venn@@uni-paderborn.de> for the
/* Thanks to Andreas Otte <venn@@uni-paderborn.de> for the
corrected overlay()/overwrite() behavior. */
static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
@ -85,7 +85,7 @@ static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
if (fc == _NO_CHANGE)
fc = col + dst_tc;
lc = col + dst_tc;
}
@ -130,7 +130,7 @@ int overlay(const WINDOW *src_w, WINDOW *dst_w)
last_col = min(src_w->_begx + src_w->_maxx, dst_w->_begx + dst_w->_maxx);
last_line = min(src_w->_begy + src_w->_maxy, dst_w->_begy + dst_w->_maxy);
/* determine the overlapping region of the two windows in real
/* determine the overlapping region of the two windows in real
coordinates */
/* if no overlapping region, do nothing */
@ -187,7 +187,7 @@ int overwrite(const WINDOW *src_w, WINDOW *dst_w)
last_col = min(src_w->_begx + src_w->_maxx, dst_w->_begx + dst_w->_maxx);
last_line = min(src_w->_begy + src_w->_maxy, dst_w->_begy + dst_w->_maxy);
/* determine the overlapping region of the two windows in real
/* determine the overlapping region of the two windows in real
coordinates */
/* if no overlapping region, do nothing */

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 use on the screen.
newpad() creates a new pad data structure.
newpad() creates a new pad data structure.
subpad() creates a new sub-pad within a pad, at position (begy,
begx), with dimensions of nlines lines and ncols columns. This
position is relative to the pad, and not to the screen as with
subwin. Changes to either the parent pad or sub-pad will affect
both. When using sub-pads, you may need to call touchwin()
begx), with dimensions of nlines lines and ncols columns. This
position is relative to the pad, and not to the screen as with
subwin. Changes to either the parent pad or sub-pad will affect
both. When using sub-pads, you may need to call touchwin()
before calling prefresh().
pnoutrefresh() copies the specified pad to the virtual screen.
@ -46,7 +46,7 @@ RCSID("$Id: pad.c,v 1.50 2008/07/14 12:22:13 wmcbrine Exp $")
These routines are analogous to wnoutrefresh() and wrefresh().
(py, px) specifies the upper left corner of the part of the pad
to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen
to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen
rectangle that will contain the selected part of the pad.
pechochar() is functionally equivalent to addch() followed by
@ -87,7 +87,7 @@ WINDOW *newpad(int nlines, int ncols)
win->_flags = _PAD;
/* save default values in case pechochar() is the first call to
/* save default values in case pechochar() is the first call to
prefresh(). */
save_pminrow = 0;
@ -120,10 +120,10 @@ WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begy, int begx)
(begx + ncols) > (orig->_begx + orig->_maxx))
return (WINDOW *)NULL;
if (!nlines)
if (!nlines)
nlines = orig->_maxy - 1 - j;
if (!ncols)
if (!ncols)
ncols = orig->_maxx - 1 - k;
if ( !(win = PDC_makenew(nlines, ncols, begy, begx)) )
@ -199,7 +199,7 @@ int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1, int sy2, int sx2)
memcpy(curscr->_y[sline] + sx1, w->_y[pline] + px,
num_cols * sizeof(chtype));
if ((curscr->_firstch[sline] == _NO_CHANGE)
if ((curscr->_firstch[sline] == _NO_CHANGE)
|| (curscr->_firstch[sline] > sx1))
curscr->_firstch[sline] = sx1;
@ -220,8 +220,8 @@ int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1, int sy2, int sx2)
curscr->_clear = TRUE;
}
/* position the cursor to the pad's current position if possible --
is the pad current position going to end up displayed? if not,
/* position the cursor to the pad's current position if possible --
is the pad current position going to end up displayed? if not,
then don't move the cursor; if so, move it to the correct place */
if (!w->_leaveit && w->_cury >= py && w->_curx >= px &&
@ -241,7 +241,7 @@ int pechochar(WINDOW *pad, chtype ch)
if (waddch(pad, ch) == ERR)
return ERR;
return prefresh(pad, save_pminrow, save_pmincol, save_sminrow,
return prefresh(pad, save_pminrow, save_pmincol, save_sminrow,
save_smincol, save_smaxrow, save_smaxcol);
}
@ -253,7 +253,7 @@ int pecho_wchar(WINDOW *pad, const cchar_t *wch)
if (!wch || (waddch(pad, *wch) == ERR))
return ERR;
return prefresh(pad, save_pminrow, save_pmincol, save_sminrow,
return prefresh(pad, save_pminrow, save_pmincol, save_sminrow,
save_smincol, save_smaxrow, save_smaxcol);
}
#endif

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

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

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

View File

@ -130,17 +130,17 @@ int vw_scanw(WINDOW *win, const char *fmt, va_list varglist)
#ifndef HAVE_VSSCANF
/* _pdc_vsscanf() - Internal routine to parse and format an input
buffer. It scans a series of input fields; each field is formatted
according to a supplied format string and the formatted input is
stored in the variable number of addresses passed. Returns the number
/* _pdc_vsscanf() - Internal routine to parse and format an input
buffer. It scans a series of input fields; each field is formatted
according to a supplied format string and the formatted input is
stored in the variable number of addresses passed. Returns the number
of input fields or EOF on error.
Don't compile this unless required. Some compilers (at least Borland
Don't compile this unless required. Some compilers (at least Borland
C++ 3.0) have to link with math libraries due to the use of floats.
Based on vsscanf.c and input.c from emx 0.8f library source,
Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to
Based on vsscanf.c and input.c from emx 0.8f library source,
Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to
its inclusion in PDCurses. */
#define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')

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

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

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)
Description:
These functions manipulate a window that contain Soft Label Keys
(SLK). To use the SLK functions, a call to slk_init() must be
made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
These functions manipulate a window that contain Soft Label Keys
(SLK). To use the SLK functions, a call to slk_init() must be
made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
lines from the useable screen, depending on the format selected.
The line(s) removed from the screen are used as a separate
The line(s) removed from the screen are used as a separate
window, in which SLKs are displayed.
slk_init() requires a single parameter which describes the
slk_init() requires a single parameter which describes the
format of the SLKs as follows:
0 3-2-3 format
1 4-4 format
2 4-4-4 format (ncurses extension)
@ -116,7 +116,7 @@ int slk_init(int fmt)
if (SP)
return ERR;
switch (fmt)
switch (fmt)
{
case 0: /* 3 - 2 - 3 */
labels = LABEL_NORMAL;
@ -218,7 +218,7 @@ int slk_set(int labnum, const char *label, int justify)
labnum--;
if (!label || !(*label))
if (!label || !(*label))
{
/* Clear the label */
@ -433,7 +433,7 @@ static void _slk_calc(void)
col += label_length;
if (i == 3)
col = COLS - (label_length * 4) + 1;
col = COLS - (label_length * 4) + 1;
}
break;
@ -497,7 +497,7 @@ void PDC_slk_initialize(void)
if (!SP->slk_winptr)
{
if ( !(SP->slk_winptr = newwin(SP->slklines, COLS,
if ( !(SP->slk_winptr = newwin(SP->slklines, COLS,
LINES - SP->slklines, 0)) )
return;
@ -555,7 +555,7 @@ int PDC_mouse_in_slk(int y, int x)
PDC_LOG(("PDC_mouse_in_slk() - called: y->%d x->%d\n", y, x));
/* If the line on which the mouse was clicked is NOT the last line
/* If the line on which the mouse was clicked is NOT the last line
of the screen, we are not interested in it. */
if (!slk || !SP->slk_winptr || (y != SP->slk_winptr->_begy + label_line))
@ -578,7 +578,7 @@ int slk_wset(int labnum, const wchar_t *label, int justify)
labnum--;
if (!label || !(*label))
if (!label || !(*label))
{
/* Clear the label */

View File

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

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));
Description:
mvcur() lets you move the physical cursor without updating any
mvcur() lets you move the physical cursor without updating any
window cursor positions. It returns OK or ERR.
The rest of these functions are currently implemented as stubs,
The rest of these functions are currently implemented as stubs,
returning the appropriate errors and doing nothing else.
Portability X/Open BSD SYS V

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

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

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
window by calling newwin(0, 0, 0, 0).
delwin() deletes the named window, freeing all associated
memory. In the case of overlapping windows, subwindows should be
delwin() deletes the named window, freeing all associated
memory. In the case of overlapping windows, subwindows should be
deleted before the main window.
mvwin() moves the window so that the upper left-hand corner is
@ -78,12 +78,12 @@ RCSID("$Id: window.c,v 1.62 2008/07/13 16:08:18 wmcbrine Exp $")
wsyncdown() causes a touchwin() of the current window if any of
its parent's windows have been touched.
resize_window() allows the user to resize an existing window. It
resize_window() allows the user to resize an existing window. It
returns the pointer to the new window, or NULL on failure.
wresize() is an ncurses-compatible wrapper for resize_window().
Note that, unlike ncurses, it will NOT process any subwindows of
the window. (However, you still can call it _on_ subwindows.) It
the window. (However, you still can call it _on_ subwindows.) It
returns OK or ERR.
PDC_makenew() allocates all data for a new WINDOW * except the

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

View File

@ -62,7 +62,7 @@ void PDC_update_rects(void)
{
if (rectcount)
{
/* if the maximum number of rects has been reached, we're
/* if the maximum number of rects has been reached, we're
probably better off doing a full screen update */
if (rectcount == MAXRECT)
@ -102,7 +102,7 @@ static void _set_attr(chtype ch)
if (newfg != foregr)
{
SDL_SetPalette(pdc_font, SDL_LOGPAL,
SDL_SetPalette(pdc_font, SDL_LOGPAL,
pdc_color + newfg, pdc_flastc, 1);
foregr = newfg;
}
@ -151,8 +151,8 @@ void PDC_gotoyx(int row, int col)
if (!SP->visibility)
return;
/* draw a new cursor by overprinting the existing character in
reverse, either the full cell (when visibility == 2) or the
/* draw a new cursor by overprinting the existing character in
reverse, either the full cell (when visibility == 2) or the
lowest quarter of it (when visibility == 1) */
ch = curscr->_y[row][col] ^ A_REVERSE;
@ -270,7 +270,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
else
if (lastrect.y != dest.y)
uprect[rectcount++] = dest;
}
}
else
uprect[rectcount++] = dest;

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);
Description:
PDC_get_input_fd() returns the file descriptor that PDCurses
PDC_get_input_fd() returns the file descriptor that PDCurses
reads its input from. It can be used for select().
Portability X/Open BSD SYS V
@ -111,7 +111,7 @@ bool PDC_check_key(void)
Uint32 current = SDL_GetTicks();
int haveevent = SDL_PollEvent(&event);
/* if we have an event, or 30 ms have passed without a screen
/* if we have an event, or 30 ms have passed without a screen
update, or the timer has wrapped, update now */
if (haveevent ||

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

View File

@ -10,7 +10,7 @@
#include <stdlib.h>
#include <time.h>
/* You could #include pdcsdl.h, or just add the relevant declarations
/* You could #include pdcsdl.h, or just add the relevant declarations
here: */
PDCEX SDL_Surface *pdc_screen;
@ -54,7 +54,7 @@ int main(int argc, char **argv)
dest.w = i;
dest.h = j;
SDL_FillRect(pdc_screen, &dest,
SDL_FillRect(pdc_screen, &dest,
SDL_MapRGB(pdc_screen->format, rand() % 256,
rand() % 256, rand() % 256));
}

View File

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

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

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(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19),
A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
')', '*',
# ifdef PDC_WIDE

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)
{
CONSOLE_CURSOR_INFO ci;
PDC_LOG(("PDC_get_cursor_mode() - called\n"));
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);
Description:
PDC_get_input_fd() returns the file descriptor that PDCurses
PDC_get_input_fd() returns the file descriptor that PDCurses
reads its input from. It can be used for select().
Portability X/Open BSD SYS V
@ -36,7 +36,7 @@ static int save_press = 0;
#define MEV save_ip.Event.MouseEvent
/************************************************************************
* Table for key code translation of function keys in keypad mode *
* Table for key code translation of function keys in keypad mode *
* These values are for strict IBM keyboard compatibles only *
************************************************************************/
@ -181,8 +181,8 @@ static KPTAB kptab[] =
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0},
@ -311,11 +311,11 @@ static int _get_key_count(void)
}
else
{
/* Check for diacritics. These are dead keys. Some locales
have modified characters like umlaut-a, which is an "a"
with two dots on it. In some locales you have to press a
special key (the dead key) immediately followed by the
"a" to get a composed umlaut-a. The special key may have
/* Check for diacritics. These are dead keys. Some locales
have modified characters like umlaut-a, which is an "a"
with two dots on it. In some locales you have to press a
special key (the dead key) immediately followed by the
"a" to get a composed umlaut-a. The special key may have
a normal meaning with different modifiers. */
if (KEV.uChar.UnicodeChar || !(MapVirtualKey(vk, 2) & 0x80000000))
@ -637,9 +637,9 @@ void PDC_flushinp(void)
int PDC_mouse_set(void)
{
/* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear
/* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear
all other flags, including the extended flags;
If turning off the mouse: Set QuickEdit Mode to the status it
If turning off the mouse: Set QuickEdit Mode to the status it
had on startup, and clear all other flags */
SetConsoleMode(pdc_con_in, SP->_trap_mbe ?

View File

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

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
/* $Id: compose.h,v 1.3 2008/07/14 04:24:52 wmcbrine Exp $ */
/* Tables and variables for the built-in compose key system. This file
/* Tables and variables for the built-in compose key system. This file
is not included when PDCurses is built with XIM support. */
#define MAX_COMPOSE_CHARS 14

View File

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

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

View File

@ -51,8 +51,8 @@ chtype acs_map[128] =
0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3,
0x00b7,
# else
A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16),
A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25),
A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16),
A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25),
A(26), A(27), A(28), A(29), A(30), 0xb7,
# endif

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,14 +35,14 @@
MODULE_ID("$Id: fld_ftlink.c,v 1.14 2010/01/23 21:14:35 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : FIELDTYPE *link_fieldtype(
| FIELDTYPE *type1,
| FIELDTYPE *type2)
|
|
| Description : Create a new fieldtype built from the two given types.
| They are connected by an logical 'OR'.
| If an error occurs, errno is set to
| If an error occurs, errno is set to
| E_BAD_ARGUMENT - invalid arguments
| E_SYSTEM_ERROR - system error (no memory)
|

View File

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

View File

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

View File

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

View File

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

View File

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

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)
|
|
| Description : Turns on the named options for this field and turns
| off all the remaining options.
|
@ -64,9 +64,9 @@ set_field_opts(FIELD *field, Field_Options opts)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : Field_Options field_opts(const FIELD *field)
|
|
| Description : Retrieve the fields options.
|
| Return Values : The options.
@ -80,10 +80,10 @@ field_opts(const FIELD *field)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int field_opts_on(FIELD *field, Field_Options opts)
|
| Description : Turns on the named options for this field and all the
|
| Description : Turns on the named options for this field and all the
| remaining options are unchanged.
|
| Return Values : E_OK - success
@ -108,10 +108,10 @@ field_opts_on(FIELD *field, Field_Options opts)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int field_opts_off(FIELD *field, Field_Options opts)
|
| Description : Turns off the named options for this field and all the
|
| Description : Turns off the named options for this field and all the
| remaining options are unchanged.
|
| Return Values : E_OK - success

View File

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

View File

@ -35,10 +35,10 @@
MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int set_new_page(FIELD *field, bool new_page_flag)
|
| Description : Marks the field as the beginning of a new page of
|
| Description : Marks the field as the beginning of a new page of
| the form.
|
| Return Values : E_OK - success
@ -62,9 +62,9 @@ set_new_page(FIELD *field, bool new_page_flag)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : bool new_page(const FIELD *field)
|
|
| Description : Retrieve the info whether or not the field starts a
| new page on the form.
|

View File

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

View File

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

View File

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

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_generic_fieldtype(bool (*const field_check) (FORM*,
FIELD *,
_nc_generic_fieldtype(bool (*const field_check) (FORM*,
FIELD *,
const void *),
bool (*const char_check) (int,
FORM*,
FIELD*,
bool (*const char_check) (int,
FORM*,
FIELD*,
const void *),
bool (*const next)(FORM*,FIELD*,const void*),
bool (*const prev)(FORM*,FIELD*,const void*),

View File

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

View File

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

View File

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

View File

@ -35,9 +35,9 @@
MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int set_form_opts(FORM *form, Form_Options opts)
|
|
| Description : Turns on the named options and turns off all the
| remaining options for that form.
|
@ -60,9 +60,9 @@ set_form_opts(FORM *form, Form_Options opts)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : Form_Options form_opts(const FORM *)
|
|
| Description : Retrieves the current form options.
|
| Return Values : The option flags.
@ -75,13 +75,13 @@ form_opts(const FORM *form)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int form_opts_on(FORM *form, Form_Options opts)
|
| Description : Turns on the named options; no other options are
|
| Description : Turns on the named options; no other options are
| changed.
|
| Return Values : E_OK - success
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(int)
@ -100,13 +100,13 @@ form_opts_on(FORM *form, Form_Options opts)
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int form_opts_off(FORM *form, Form_Options opts)
|
| Description : Turns off the named options; no other options are
|
| Description : Turns off the named options; no other options are
| changed.
|
| Return Values : E_OK - success
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(int)

View File

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

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