diff --git a/dos/bccdos.lrf b/dos/bccdos.lrf index 70f3238f..aa8e5258 100644 --- a/dos/bccdos.lrf +++ b/dos/bccdos.lrf @@ -5,5 +5,4 @@ +outopts.obj +overlay.obj +pad.obj +printw.obj +refresh.obj +scanw.obj & +scr_dump.obj +scroll.obj +slk.obj +termattr.obj +terminfo.obj & +touch.obj +util.obj +window.obj +pdcdebug.obj +pdcclip.obj +pdcdisp.obj & -+pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj & -+pdcwin.obj ,lib.map ++pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj ,lib.map diff --git a/dos/mscdos.lrf b/dos/mscdos.lrf index 27f401a0..0114f5ea 100644 --- a/dos/mscdos.lrf +++ b/dos/mscdos.lrf @@ -44,5 +44,4 @@ -+pdcscrn.obj & -+pdcsetsc.obj & -+pdcutil.obj & --+pdcwin.obj & ,lib.map; diff --git a/dos/mscdos.mak b/dos/mscdos.mak index 0075fa98..aca263e0 100644 --- a/dos/mscdos.mak +++ b/dos/mscdos.mak @@ -211,9 +211,6 @@ pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) $(PDCURSES_DOS_H) pdcutil.obj: $(osdir)\pdcutil.c $(PDCURSES_HEADERS) $(PDCURSES_DOS_H) $(CC) $(CCFLAGS) $(osdir)\pdcutil.c -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(srcdir)\pdcwin.c - #------------------------------------------------------------------------ panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) diff --git a/dos/wccdos.lrf b/dos/wccdos.lrf index 156ee8e4..5119244c 100644 --- a/dos/wccdos.lrf +++ b/dos/wccdos.lrf @@ -5,4 +5,4 @@ +outopts.obj +overlay.obj +pad.obj +printw.obj +refresh.obj +scanw.obj +scr_dump.obj +scroll.obj +slk.obj +termattr.obj +terminfo.obj +touch.obj +util.obj +window.obj +pdcclip.obj +pdcdebug.obj +pdcdisp.obj -+pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj +pdcwin.obj ++pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj diff --git a/libobjs.mif b/libobjs.mif index 0f513d5c..a67c577a 100644 --- a/libobjs.mif +++ b/libobjs.mif @@ -17,7 +17,7 @@ getch.$(O) getstr.$(O) getyx.$(O) inch.$(O) inchstr.$(O) initscr.$(O) \ inopts.$(O) insch.$(O) insstr.$(O) instr.$(O) kernel.$(O) mouse.$(O) \ move.$(O) outopts.$(O) overlay.$(O) pad.$(O) printw.$(O) refresh.$(O) \ scanw.$(O) scr_dump.$(O) scroll.$(O) slk.$(O) termattr.$(O) \ -terminfo.$(O) touch.$(O) util.$(O) window.$(O) pdcdebug.$(O) pdcwin.$(O) +terminfo.$(O) touch.$(O) util.$(O) window.$(O) pdcdebug.$(O) PDCOBJS = pdcclip.$(O) pdcdisp.$(O) pdcgetsc.$(O) pdckbd.$(O) pdcscrn.$(O) \ pdcsetsc.$(O) pdcutil.$(O) diff --git a/os2/bccos2.mak b/os2/bccos2.mak index bc94c84b..bffb0eab 100644 --- a/os2/bccos2.mak +++ b/os2/bccos2.mak @@ -68,8 +68,7 @@ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) +outopts.obj +overlay.obj +pad.obj +printw.obj +refresh.obj +scanw.obj \ +scr_dump.obj +scroll.obj +slk.obj +termattr.obj +terminfo.obj \ +touch.obj +util.obj +window.obj +pdcdebug.obj +pdcclip.obj +pdcdisp.obj \ -+pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj \ -+pdcwin.obj ,lib.map ++pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj ,lib.map $(LIBPANEL) : $(PANOBJS) -del $@ diff --git a/os2/gccos2.mak b/os2/gccos2.mak index 20f7f2ca..b2f7a0da 100644 --- a/os2/gccos2.mak +++ b/os2/gccos2.mak @@ -97,7 +97,7 @@ getstr.dlo getyx.dlo inch.dlo inchstr.dlo initscr.dlo inopts.dlo \ insch.dlo insstr.dlo instr.dlo kernel.dlo mouse.dlo move.dlo outopts.dlo \ overlay.dlo pad.dlo printw.dlo refresh.dlo scanw.dlo scr_dump.dlo \ scroll.dlo slk.dlo termattr.dlo terminfo.dlo touch.dlo util.dlo \ -window.dlo pdcdebug.dlo pdcwin.dlo +window.dlo pdcdebug.dlo PDCDLOS = pdcclip.dlo pdcdisp.dlo pdcgetsc.dlo pdckbd.dlo pdcscrn.dlo \ pdcsetsc.dlo pdcutil.dlo diff --git a/os2/iccos2.lrf b/os2/iccos2.lrf index 0b0fae52..b9dc3f84 100644 --- a/os2/iccos2.lrf +++ b/os2/iccos2.lrf @@ -44,5 +44,4 @@ -+pdcscrn.obj & -+pdcsetsc.obj & -+pdcutil.obj & --+pdcwin.obj & ,lib.map; diff --git a/os2/iccos2.mak b/os2/iccos2.mak index 4da07346..ce09a15b 100644 --- a/os2/iccos2.mak +++ b/os2/iccos2.mak @@ -205,9 +205,6 @@ pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) pdcutil.obj: $(osdir)\pdcutil.c $(PDCURSES_HEADERS) $(CC) $(CCFLAGS) $(osdir)\pdcutil.c -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(srcdir)\pdcwin.c - #------------------------------------------------------------------------ panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) diff --git a/pdcurses/pdcwin.c b/pdcurses/pdcwin.c deleted file mode 100644 index 0dc922b3..00000000 --- a/pdcurses/pdcwin.c +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************ - * This file is part of PDCurses. PDCurses is public domain software; * - * you may use it for any purpose. This software is provided AS IS with * - * NO WARRANTY whatsoever. * - * * - * If you use PDCurses in an application, an acknowledgement would be * - * appreciated, but is not mandatory. If you make corrections or * - * enhancements to PDCurses, please forward them to the current * - * maintainer for the benefit of other users. * - * * - * No distribution of modified PDCurses code may be made under the name * - * "PDCurses", except by the current maintainer. (Although PDCurses is * - * public domain, the name is a trademark.) * - * * - * See the file maintain.er for details of the current maintainer. * - ************************************************************************/ - -#define CURSES_LIBRARY 1 -#include -#include - -RCSID("$Id: pdcwin.c,v 1.53 2006/08/21 18:19:46 wmcbrine Exp $"); - -/*man-start************************************************************** - - PDC_makenew() - Create a WINDOW* (sans line allocation) - - PDCurses Description: - This is a private PDCurses routine. - - Allocates all data for a new WINDOW* except the actual lines - themselves. - - PDCurses Return Value: - This function returns a valid WINDOW* on success and NULL on - error. - - PDCurses Errors: - If PDC_makenew() is unable to allocate memory for the window - structure, it will free all allocated memory and return - a NULL pointer. - - Portability: - PDCurses WINDOW *PDC_makenew(int num_lines, int num_columns, - int begy, int begx); - -**man-end****************************************************************/ - -WINDOW *PDC_makenew(int num_lines, int num_columns, int begy, int begx) -{ - int i; - WINDOW *win; - - PDC_LOG(("PDC_makenew() - called: lines %d cols %d begy %d begx %d\n", - num_lines, num_columns, begy, begx)); - - /* allocate the window structure itself */ - - if ((win = calloc(1, sizeof(WINDOW))) == (WINDOW *)NULL) - return win; - - /* allocate the line pointer array */ - - if ((win->_y = calloc(num_lines, sizeof(chtype *))) == NULL) - { - free(win); - return (WINDOW *)NULL; - } - - /* allocate the minchng and maxchng arrays */ - - if ((win->_firstch = calloc(num_lines, sizeof(int))) == NULL) - { - free(win->_y); - free(win); - return (WINDOW *)NULL; - } - - if ((win->_lastch = calloc(num_lines, sizeof(int))) == NULL) - { - free(win->_firstch); - free(win->_y); - free(win); - return (WINDOW *)NULL; - } - - /* initialize window variables */ - - win->_maxy = num_lines; /* real max screen size */ - win->_maxx = num_columns; /* real max screen size */ - win->_pmaxy = num_lines; /* real max window size */ - win->_pmaxx = num_columns; /* real max window size */ - win->_begy = begy; - win->_begx = begx; - win->_lastsy2 = LINES - 1; - win->_lastsx2 = COLS - 1; - win->_bkgd = ' '; /* wrs 4/10/93 -- initialize background to blank */ - win->_clear = (bool) ((num_lines == LINES) && (num_columns == COLS)); - win->_bmarg = num_lines - 1; - win->_parx = win->_pary = -1; - - /* init to say window all changed */ - - for (i = 0; i < num_lines; i++) - { - win->_firstch[i] = 0; - win->_lastch[i] = num_columns - 1; - } - - return win; -} - -/*man-start************************************************************** - - PDC_sync() - Cause window synchronisation to occur - - PDCurses Description: - This is a private PDCurses routine, NOT to be called by an - application. - - Handles wrefresh() and wsyncup() calls when a window is changed. - - PDCurses Return Value: - This function returns void. - - PDCurses Errors: - - Portability: - PDCurses WINDOW *PDC_sync(WINDOW *win); - -**man-end****************************************************************/ - -void PDC_sync(WINDOW *win) -{ - PDC_LOG(("PDC_sync() - called:\n")); - - if (win->_immed) - wrefresh(win); - if (win->_sync) - wsyncup(win); -} diff --git a/pdcurses/window.c b/pdcurses/window.c index c021e792..9c5550cf 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -22,7 +22,7 @@ /* undefine any macros for functions defined in this module */ #undef derwin -RCSID("$Id: window.c,v 1.37 2006/08/20 22:39:03 wmcbrine Exp $"); +RCSID("$Id: window.c,v 1.38 2006/08/21 18:38:19 wmcbrine Exp $"); /*man-start************************************************************** @@ -44,6 +44,9 @@ RCSID("$Id: window.c,v 1.37 2006/08/20 22:39:03 wmcbrine Exp $"); void wsyncdown(WINDOW *win); WINDOW *resize_window(WINDOW *w, int lins, int cols); + WINDOW *PDC_makenew(int num_lines, int num_columns, + int begy, int begx); + void PDC_sync(WINDOW *win); X/Open Description: newwin() creates a new window with the given number of lines, @@ -98,6 +101,14 @@ RCSID("$Id: window.c,v 1.37 2006/08/20 22:39:03 wmcbrine Exp $"); PDCurses Description: resize_window() allows the usrer to resize an existing window. + PDC_makenew() allocates all data for a new WINDOW* except the + actual lines themselves. If it's unable to allocate memory for + the window structure, it will free all allocated memory and + return a NULL pointer. + + PDC_sync() handles wrefresh() and wsyncup() calls when a window + is changed. + X/Open Return Value: All functions return OK on success and ERR on error. @@ -125,9 +136,85 @@ RCSID("$Id: window.c,v 1.37 2006/08/20 22:39:03 wmcbrine Exp $"); wcursyncup - - 4.0 wsyncdown - - 4.0 resize_window - - - + PDC_makenew - - - + PDC_sync - - - **man-end****************************************************************/ +WINDOW *PDC_makenew(int num_lines, int num_columns, int begy, int begx) +{ + int i; + WINDOW *win; + + PDC_LOG(("PDC_makenew() - called: lines %d cols %d begy %d begx %d\n", + num_lines, num_columns, begy, begx)); + + /* allocate the window structure itself */ + + if ((win = calloc(1, sizeof(WINDOW))) == (WINDOW *)NULL) + return win; + + /* allocate the line pointer array */ + + if ((win->_y = calloc(num_lines, sizeof(chtype *))) == NULL) + { + free(win); + return (WINDOW *)NULL; + } + + /* allocate the minchng and maxchng arrays */ + + if ((win->_firstch = calloc(num_lines, sizeof(int))) == NULL) + { + free(win->_y); + free(win); + return (WINDOW *)NULL; + } + + if ((win->_lastch = calloc(num_lines, sizeof(int))) == NULL) + { + free(win->_firstch); + free(win->_y); + free(win); + return (WINDOW *)NULL; + } + + /* initialize window variables */ + + win->_maxy = num_lines; /* real max screen size */ + win->_maxx = num_columns; /* real max screen size */ + win->_pmaxy = num_lines; /* real max window size */ + win->_pmaxx = num_columns; /* real max window size */ + win->_begy = begy; + win->_begx = begx; + win->_lastsy2 = LINES - 1; + win->_lastsx2 = COLS - 1; + win->_bkgd = ' '; /* wrs 4/10/93 -- initialize background to blank */ + win->_clear = (bool) ((num_lines == LINES) && (num_columns == COLS)); + win->_bmarg = num_lines - 1; + win->_parx = win->_pary = -1; + + /* init to say window all changed */ + + for (i = 0; i < num_lines; i++) + { + win->_firstch[i] = 0; + win->_lastch[i] = num_columns - 1; + } + + return win; +} + +void PDC_sync(WINDOW *win) +{ + PDC_LOG(("PDC_sync() - called:\n")); + + if (win->_immed) + wrefresh(win); + if (win->_sync) + wsyncup(win); +} + WINDOW *newwin(int nlines, int ncols, int begy, int begx) { WINDOW *win; diff --git a/watcom.mif b/watcom.mif index 23b9e89e..ca9c427a 100644 --- a/watcom.mif +++ b/watcom.mif @@ -10,7 +10,7 @@ getstr.obj getyx.obj inch.obj inchstr.obj initscr.obj inopts.obj & insch.obj insstr.obj instr.obj kernel.obj mouse.obj move.obj outopts.obj & overlay.obj pad.obj printw.obj refresh.obj scanw.obj scr_dump.obj & scroll.obj slk.obj termattr.obj terminfo.obj touch.obj util.obj & -window.obj pdcdebug.obj pdcwin.obj +window.obj pdcdebug.obj PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj & pdcsetsc.obj pdcutil.obj diff --git a/win32/bccwin32.mak b/win32/bccwin32.mak index bcc08da0..c8a2897e 100644 --- a/win32/bccwin32.mak +++ b/win32/bccwin32.mak @@ -68,8 +68,7 @@ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) +outopts.obj +overlay.obj +pad.obj +printw.obj +refresh.obj +scanw.obj \ +scr_dump.obj +scroll.obj +slk.obj +termattr.obj +terminfo.obj \ +touch.obj +util.obj +window.obj +pdcdebug.obj +pdcclip.obj +pdcdisp.obj \ -+pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj \ -+pdcwin.obj ,lib.map ++pdcgetsc.obj +pdckbd.obj +pdcscrn.obj +pdcsetsc.obj +pdcutil.obj ,lib.map $(LIBPANEL) : $(PANOBJS) -del $@ diff --git a/win32/lccwin32.mak b/win32/lccwin32.mak index a3a034bc..e225db53 100644 --- a/win32/lccwin32.mak +++ b/win32/lccwin32.mak @@ -78,7 +78,7 @@ getstr.obj getyx.obj inch.obj inchstr.obj initscr.obj inopts.obj \ insch.obj insstr.obj instr.obj kernel.obj mouse.obj move.obj outopts.obj \ overlay.obj pad.obj printw.obj refresh.obj scanw.obj scr_dump.obj \ scroll.obj slk.obj termattr.obj terminfo.obj touch.obj util.obj \ -window.obj pdcdebug.obj pdcwin.obj +window.obj pdcdebug.obj PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj \ pdcsetsc.obj pdcutil.obj @@ -221,9 +221,6 @@ window.obj: $(srcdir)\window.c pdcdebug.obj: $(srcdir)\pdcdebug.c $(CC) $(CCFLAGS) $(srcdir)\pdcdebug.c -pdcwin.obj: $(srcdir)\pdcwin.c - $(CC) $(CCFLAGS) $(srcdir)\pdcwin.c - pdcclip.obj: $(osdir)\pdcclip.c $(CC) $(CCFLAGS) $(osdir)\pdcclip.c diff --git a/x11/Makefile.aix.in b/x11/Makefile.aix.in index ae802e3b..139ca73d 100644 --- a/x11/Makefile.aix.in +++ b/x11/Makefile.aix.in @@ -81,7 +81,7 @@ move.o outopts.o overlay.o pad.o printw.o refresh.o scanw.o scr_dump.o \ scroll.o slk.o termattr.o terminfo.o touch.o util.o window.o PDCOBJS = pdcclip.o pdcdebug.o pdcdisp.o pdcgetsc.o pdckbd.o \ -pdcscrn.o pdcsetsc.o pdcutil.o pdcwin.o +pdcscrn.o pdcsetsc.o pdcutil.o X11OBJS = pdcx11.o x11.o sb.o ScrollBox.o @@ -240,9 +240,6 @@ pdcsetsc.o: $(osdir)/pdcsetsc.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) pdcutil.o: $(osdir)/pdcutil.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) $(CC) $(CCFLAGS) -o $@ $(osdir)/pdcutil.c -pdcwin.o: $(srcdir)/pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o $@ $(srcdir)/pdcwin.c - pdcx11.o: $(osdir)/pdcx11.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) $(CC) $(CCFLAGS) -o $@ $(osdir)/pdcx11.c diff --git a/x11/Makefile.in b/x11/Makefile.in index 57b8c282..31ebd8fa 100644 --- a/x11/Makefile.in +++ b/x11/Makefile.in @@ -93,7 +93,7 @@ move.o outopts.o overlay.o pad.o printw.o refresh.o scanw.o scr_dump.o \ scroll.o slk.o termattr.o terminfo.o touch.o util.o window.o PDCOBJS = pdcclip.o pdcdebug.o pdcdisp.o pdcgetsc.o pdckbd.o \ -pdcscrn.o pdcsetsc.o pdcutil.o pdcwin.o +pdcscrn.o pdcsetsc.o pdcutil.o X11OBJS = pdcx11.o x11.o sb.o ScrollBox.o @@ -108,7 +108,7 @@ scroll.sho slk.sho termattr.sho terminfo.sho touch.sho util.sho \ window.sho PDCSHOBJS = pdcclip.sho pdcdebug.sho pdcdisp.sho pdcgetsc.sho pdckbd.sho \ -pdcscrn.sho pdcsetsc.sho pdcutil.sho pdcwin.sho +pdcscrn.sho pdcsetsc.sho pdcutil.sho X11SHOBJS = pdcx11.sho x11.sho sb.sho ScrollBox.sho @@ -266,9 +266,6 @@ pdcsetsc.o: $(osdir)/pdcsetsc.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) pdcutil.o: $(osdir)/pdcutil.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) $(CC) $(CCFLAGS) -o $@ $(osdir)/pdcutil.c -pdcwin.o: $(srcdir)/pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o $@ $(srcdir)/pdcwin.c - pdcx11.o: $(osdir)/pdcx11.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) $(CC) $(CCFLAGS) -o $@ $(osdir)/pdcx11.c @@ -565,12 +562,6 @@ pdcutil.sho: $(osdir)/pdcutil.c $(PDCURSES_HEADERS) $(O2SHO) $(SAVE2O) -pdcwin.sho: $(srcdir)/pdcwin.c $(PDCURSES_HEADERS) - $(O2SAVE) - $(CC) $(CCFLAGS) $(DYN_COMP) $(CC2O) $(srcdir)/pdcwin.c - $(O2SHO) - $(SAVE2O) - pdcx11.sho: $(osdir)/pdcx11.c $(PDCURSES_HEADERS) $(PDCURSES_X11_H) $(O2SAVE) $(CC) $(CCFLAGS) $(DYN_COMP) $(CC2O) $(osdir)/pdcx11.c