Made PDC_chadd() private; consigned PDC_chins() to oblivion.

This commit is contained in:
William McBrine
2006-11-03 13:41:14 +00:00
parent 0db3f478ea
commit b4332204bf
7 changed files with 23 additions and 48 deletions

View File

@@ -11,7 +11,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curses.h,v 1.242 2006/10/29 13:47:39 wmcbrine Exp $ */
/* $Id: curses.h,v 1.243 2006/11/03 13:41:14 wmcbrine Exp $ */
/*----------------------------------------------------------------------*
* PDCurses *
@@ -1479,8 +1479,6 @@ int sb_get_vert(int *, int *, int *);
int sb_refresh(void);
#endif
int PDC_chadd(WINDOW *, chtype, bool, bool);
int PDC_chins(WINDOW *, chtype, bool);
int PDC_ungetch(int);
int PDC_set_blink(bool);
int PDC_set_line_color(short);
@@ -1531,8 +1529,8 @@ unsigned long PDC_get_key_modifiers(void);
/* PDCurses-specific */
#define waddrawch(w, c) PDC_chadd(w, (chtype)c, FALSE, TRUE)
#define winsrawch(w, c) PDC_chins(w, (chtype)c, FALSE)
#define waddrawch(w, c) waddch(w, ((chtype)(c) | A_ALTCHARSET))
#define winsrawch(w, c) winsch(w, ((chtype)(c) | A_ALTCHARSET))
#define addrawch(c) waddrawch(stdscr, c)
#define insrawch(c) winsrawch(stdscr, c)
#define mvwaddrawch(w,y,x,c) (wmove(w, y, x)==ERR?ERR:waddrawch(w, c))

View File

@@ -11,7 +11,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curspriv.h,v 1.133 2006/11/01 16:36:31 wmcbrine Exp $ */
/* $Id: curspriv.h,v 1.134 2006/11/03 13:41:14 wmcbrine Exp $ */
/* CURSPRIV.H
@@ -96,6 +96,7 @@ const char *PDC_sysname(void);
/* Internal cross-module functions */
int PDC_chadd(WINDOW *, chtype, bool, bool);
WINDOW *PDC_makenew(int, int, int, int);
int PDC_mouse_in_slk(int, int);
void PDC_slk_free(void);

View File

@@ -525,8 +525,6 @@ FUNCTIONS
Curses Function Manual Page Name
PDC_chadd pdcdisp
PDC_chins pdcdisp
PDC_clearclipboard pdcclip
PDC_freeclipboard pdcclip
PDC_get_input_fd pdckbd

View File

@@ -309,8 +309,6 @@ EXPORTS
traceoff
traceon
wordchar
PDC_chadd
PDC_chins
PDC_ungetch
PDC_set_title
PDC_getclipboard

View File

@@ -14,7 +14,7 @@
#include <curspriv.h>
#include <string.h>
RCSID("$Id: insch.c,v 1.30 2006/10/23 05:46:32 wmcbrine Exp $");
RCSID("$Id: insch.c,v 1.31 2006/11/03 13:41:14 wmcbrine Exp $");
/*man-start**************************************************************
@@ -31,8 +31,6 @@ RCSID("$Id: insch.c,v 1.30 2006/10/23 05:46:32 wmcbrine Exp $");
int mvins_wch(int y, int x, const cchar_t *wch);
int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch);
int PDC_chins(WINDOW* win, chtype c, bool xlat);
X/Open Description:
The routine insch() inserts the character ch into the default
window at the current cursor position and the window cursor is
@@ -84,12 +82,6 @@ RCSID("$Id: insch.c,v 1.30 2006/10/23 05:46:32 wmcbrine Exp $");
Depending upon the state of the raw character output, 7- or
8-bit characters will be output.
PDC_chins() provides the basic functionality for [mv][w]insch().
The xlat flag indicates whether or not to perform normal
character translation. If not, then the character is output as
is. The 'xlat' flag is TRUE for the normal curses routines. This
function returns OK on success and ERR on error.
X/Open Return Value:
All functions return OK on success and ERR on error.
@@ -102,33 +94,32 @@ RCSID("$Id: insch.c,v 1.30 2006/10/23 05:46:32 wmcbrine Exp $");
wins_wch Y
mvins_wch Y
mvwins_wch Y
PDC_chins - - -
**man-end****************************************************************/
int PDC_chins(WINDOW *win, chtype c, bool xlat)
int winsch(WINDOW *win, chtype ch)
{
int x, y, maxx, offset;
chtype *temp1;
char ch = (c & A_CHARTEXT);
chtype *temp;
bool xlat;
PDC_LOG(("PDC_chins() - called: win=%x ch=%x "
"(char=%c attr=0x%x) xlat=%d\n", win, ch,
ch & A_CHARTEXT, ch & A_ATTRIBUTES, xlat));
PDC_LOG(("winsch() - called\n"));
if (win == (WINDOW *)NULL)
return ERR;
xlat = !(SP->raw_out) && !(ch & A_ALTCHARSET);
x = win->_curx;
y = win->_cury;
maxx = win->_maxx;
temp = &win->_y[y][x];
offset = 1;
temp1 = &win->_y[y][x];
if ((ch < ' ') && xlat)
if (((ch & A_CHARTEXT) < ' ') && xlat)
offset++;
memmove(temp1 + offset, temp1, (maxx - x - offset) * sizeof(chtype));
memmove(temp + offset, temp, (maxx - x - offset) * sizeof(chtype));
win->_lastch[y] = maxx - 1;
@@ -137,7 +128,7 @@ int PDC_chins(WINDOW *win, chtype c, bool xlat)
/* PDC_chadd() fixes CTRL-chars too */
return PDC_chadd(win, c, xlat, FALSE);
return PDC_chadd(win, ch, xlat, FALSE);
}
int insch(chtype ch)
@@ -147,13 +138,6 @@ int insch(chtype ch)
return winsch(stdscr, ch);
}
int winsch(WINDOW *win, chtype ch)
{
PDC_LOG(("winsch() - called\n"));
return PDC_chins(win, ch, (bool)(!(SP->raw_out)));
}
int mvinsch(int y, int x, chtype ch)
{
PDC_LOG(("mvinsch() - called\n"));
@@ -175,6 +159,13 @@ int mvwinsch(WINDOW *win, int y, int x, chtype ch)
}
#ifdef PDC_WIDE
int wins_wch(WINDOW *win, const cchar_t *wch)
{
PDC_LOG(("wins_wch() - called\n"));
return wch ? winsch(win, *wch) : ERR;
}
int ins_wch(const cchar_t *wch)
{
PDC_LOG(("ins_wch() - called\n"));
@@ -182,13 +173,6 @@ int ins_wch(const cchar_t *wch)
return wins_wch(stdscr, wch);
}
int wins_wch(WINDOW *win, const cchar_t *wch)
{
PDC_LOG(("wins_wch() - called\n"));
return wch ? PDC_chins(win, *wch, (bool)(!(SP->raw_out))) : ERR;
}
int mvins_wch(int y, int x, const cchar_t *wch)
{
PDC_LOG(("mvins_wch() - called\n"));

View File

@@ -306,8 +306,6 @@ EXPORTS resize_window
EXPORTS traceoff
EXPORTS traceon
EXPORTS wordchar
EXPORTS PDC_chadd
EXPORTS PDC_chins
EXPORTS PDC_ungetch
EXPORTS PDC_set_title
EXPORTS PDC_getclipboard

View File

@@ -302,8 +302,6 @@ resize_window
traceoff
traceon
wordchar
PDC_chadd
PDC_chins
PDC_ungetch
PDC_set_title
PDC_getclipboard