Index: curses.h =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/curses.h,v retrieving revision 1.20 diff -u -r1.20 curses.h --- curses.h 1 Jul 2004 07:25:27 -0000 1.20 +++ curses.h 6 Aug 2004 05:48:56 -0000 @@ -547,6 +547,9 @@ # ifndef HAVE_LIMITS_H # define HAVE_LIMITS_H /* have */ # endif +# ifndef HAVE_STRING_H /* have */ +# define HAVE_STRING_H +# endif # ifndef HAVE_MEMORY_H # define HAVE_MEMORY_H /* have */ # endif @@ -770,10 +773,10 @@ # define TRUE !FALSE #endif #ifndef NULL -# define NULL 0 /* Null pointer */ +# define NULL (void*)0 /* Null pointer */ #endif #ifndef ERR -# define ERR 0 /* general error flag */ +# define ERR -1 /* general error flag */ #endif #ifndef OK # define OK 1 /* general OK flag */ @@ -1598,10 +1601,16 @@ char PDC_CDECL erasechar Args(( void )); int PDC_CDECL flash Args(( void )); int PDC_CDECL flushinp Args(( void )); +attr_t PDC_CDECL getattrs Args(( WINDOW* )); int PDC_CDECL getsyx Args(( int*, int* )); int PDC_CDECL halfdelay Args(( int )); bool PDC_CDECL has_colors Args(( void )); +bool PDC_CDECL has_ic Args((void)); +bool PDC_CDECL has_il Args((void)); +bool PDC_CDECL has_key Args(( int )); int PDC_CDECL hline Args(( chtype, int )); +int PDC_CDECL idlok Args(( WINDOW *win, bool bf )); +int PDC_CDECL idcok Args(( WINDOW *win, bool bf )); int PDC_CDECL immedok Args(( WINDOW*, bool )); int PDC_CDECL inchnstr Args(( chtype *, int )); int PDC_CDECL init_color Args(( short, short, short, short )); @@ -1722,6 +1731,7 @@ #endif int PDC_CDECL wredrawln Args(( WINDOW*, int ,int )); int PDC_CDECL wrefresh Args(( WINDOW* )); +int PDC_CDECL wresize Args((WINDOW **win, int lins, int cols)); int PDC_CDECL wscrl Args(( WINDOW*, int )); int PDC_CDECL wsetscrreg Args(( WINDOW*, int, int )); int PDC_CDECL wtimeout Args(( WINDOW *, int )); @@ -1845,8 +1855,8 @@ #define getsyx(y,x) { if( curscr->_leaveit) (y)=(x)=-1; else getyx(curscr,(y),(x)); } #define getyx(w,y,x) ( y = (w)->_cury, x = (w)->_curx ) #define has_colors() ((SP->mono) ? FALSE : TRUE) -#define idcok(w,flag) OK -#define idlok(w,flag) OK +/*#define idcok(w,flag) OK*/ +/*#define idlok(w,flag) OK*/ #define inch() (stdscr->_y[stdscr->_cury][stdscr->_curx]) #define inchstr( c ) inchnstr( c, stdscr->_maxx-stdscr->_curx ) #define innstr(str,n) winnstr(stdscr,(str),(n)) @@ -1886,6 +1896,7 @@ #define mvwdelch(w,y,x) (wmove( w, y, x )==ERR?ERR:wdelch( w )) #define mvwgetch(w,y,x) (wmove( w, y, x )==ERR?ERR:wgetch( w )) #define mvwgetstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:wgetstr( w, str )) +#define mvwgetnstr(w,y,x,str,n) (wmove( w, y, x )==ERR?ERR:wgetnstr( w, str , n )) #define mvwinch(w,y,x) (wmove( w, y, x )==ERR?ERR:((w)->_y[y][x])) #define mvwinchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, (w)->_maxx-(w)->_curx )) #define mvwinchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, n )) @@ -1931,13 +1942,13 @@ #if !defined(UNIX) && !defined(XCURSES) /* set delaytenths = 0 added - William McBrine */ -# define nocbreak() (SP->cbreak = FALSE, SP->delaytenths = 0) -# define cbreak() (SP->cbreak = TRUE) -# define nocrmode() (SP->cbreak = FALSE) -# define crmode() (SP->cbreak = TRUE) -# define noecho() (SP->echo = FALSE,OK) -# define echo() (SP->echo = TRUE,OK) -# define nodelay(w,flag) (w->_nodelay = flag) +# define nocbreak() (SP->cbreak = FALSE, SP->delaytenths = 0, OK) +# define cbreak() (SP->cbreak = TRUE, OK) +# define nocrmode() (SP->cbreak = FALSE, OK) +# define crmode() (SP->cbreak = TRUE, OK) +# define noecho() (SP->echo = FALSE, OK) +# define echo() (SP->echo = TRUE, OK) +# define nodelay(w,flag) (w->_nodelay = flag, OK) #endif #if defined(PDCURSES) Index: pdcurses/attr.c =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/pdcurses/attr.c,v retrieving revision 1.1 diff -u -r1.1 attr.c --- pdcurses/attr.c 10 Jan 2001 08:26:48 -0000 1.1 +++ pdcurses/attr.c 11 May 2004 04:50:54 -0000 @@ -34,6 +34,7 @@ #undef standout #undef wstandend #undef wstandout +#undef getattrs /* undefine any macros for functions called by this module if in debug mode */ #ifdef PDCDEBUG @@ -233,6 +234,17 @@ } /***********************************************************************/ #ifdef HAVE_PROTO +attr_t PDC_CDECL getattrs(WINDOW* win) +#else +attr_t PDC_CDECL getattrs(win) +WINDOW *win; +#endif +/***********************************************************************/ +{ + return win ? win->_attrs : 0; +} +/***********************************************************************/ +#ifdef HAVE_PROTO int PDC_CDECL standend(void) #else int PDC_CDECL standend() Index: pdcurses/pdcdebug.c =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/pdcurses/pdcdebug.c,v retrieving revision 1.2 diff -u -r1.2 pdcdebug.c --- pdcurses/pdcdebug.c 23 Jun 2002 04:13:02 -0000 1.2 +++ pdcurses/pdcdebug.c 5 Aug 2004 09:08:50 -0000 @@ -92,7 +92,7 @@ va_start(args); #endif - fprintf( dbfp, "At: %8.8d - %d secs ", clock(), clock() / CLOCKS_PER_SEC ); + fprintf( dbfp, "At: %8.8ld - %ld secs ", (long int)clock(), clock() / CLOCKS_PER_SEC ); vsprintf(buffer,fmt,args); fputs(buffer,dbfp); va_end(args); Index: pdcurses/util.c =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/pdcurses/util.c,v retrieving revision 1.5 diff -u -r1.5 util.c --- pdcurses/util.c 2 Jan 2004 05:50:05 -0000 1.5 +++ pdcurses/util.c 21 Jul 2004 11:40:35 -0000 @@ -173,17 +173,10 @@ } return( strbuf ); } + /***********************************************************************/ -#ifdef HAVE_PROTO -char * PDC_CDECL keyname(int key) -#else -char * PDC_CDECL keyname(key) -int key; -#endif -/***********************************************************************/ -{ - static char *key_name[] = - { + +static char *key_name[] = { "KEY_BREAK","KEY_DOWN","KEY_UP","KEY_LEFT","KEY_RIGHT","KEY_HOME","KEY_BACKSPACE", "KEY_F0","KEY_F(1)","KEY_F(2)","KEY_F(3)","KEY_F(4)","KEY_F(5)", "KEY_F(6)","KEY_F(7)","KEY_F(8)","KEY_F(9)","KEY_F(10)", @@ -235,13 +228,19 @@ "KEY_CONTROL_L","KEY_CONTROL_R", "KEY_ALT_L","KEY_ALT_R", "KEY_RESIZE", "KEY_SUP", "KEY_SDOWN" - }; - +}; +/***********************************************************************/ +#ifdef HAVE_PROTO +char * PDC_CDECL keyname(int key) +#else +char * PDC_CDECL keyname(key) +int key; +#endif +/***********************************************************************/ +{ #ifdef PDCDEBUG if (trace_on) PDC_debug("keyname() - called: key %d\n",key); #endif - - key -= KEY_MIN; if (key >= 0 && key <= sizeof(key_name) / sizeof(key_name[0])) @@ -251,6 +250,21 @@ } /***********************************************************************/ #ifdef HAVE_PROTO +bool PDC_CDECL has_key(int key) +#else +bool PDC_CDECL has_key(key) +int key; +#endif +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("has_key() - called: key %d\n",key); +#endif + key -= KEY_MIN; + return key >= 0 + && key <= sizeof(key_name) / sizeof(key_name[0]); +} +/***********************************************************************/ +#ifdef HAVE_PROTO int PDC_CDECL delay_output( int ms ) #else int PDC_CDECL delay_output(ms) Index: pdcurses/window.c =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/pdcurses/window.c,v retrieving revision 1.2 diff -u -r1.2 window.c --- pdcurses/window.c 16 Dec 2002 06:59:12 -0000 1.2 +++ pdcurses/window.c 11 May 2004 04:50:28 -0000 @@ -35,6 +35,7 @@ #undef syncok #undef wcursyncup #undef wsyncdown +#undef wresize #undef resize_window /* undefine any macros for functions called by this module if in debug mode */ @@ -543,6 +544,24 @@ } /***********************************************************************/ #ifdef HAVE_PROTO +int PDC_CDECL wresize(WINDOW **win, int lins, int cols) +#else +int PDC_CDECL wresize(win, lins, cols) +WINDOW **win; +int lins; +int cols; +#endif +/***********************************************************************/ +{ + WINDOW* new; + new = resize_window(*win, lins ,cols); + if (!new) + return ERR; + *win = new; + return OK; +} +/***********************************************************************/ +#ifdef HAVE_PROTO WINDOW * PDC_CDECL resize_window(WINDOW *win, int lins, int cols) #else WINDOW * PDC_CDECL resize_window(win,lins,cols) Index: win32/mingwin32.mak =================================================================== RCS file: /cvsroot/pdcurses/PDCurses/win32/mingwin32.mak,v retrieving revision 1.2 diff -u -r1.2 mingwin32.mak --- win32/mingwin32.mak 1 Jul 2004 07:21:06 -0000 1.2 +++ win32/mingwin32.mak 6 Aug 2004 06:05:02 -0000 @@ -12,8 +12,10 @@ # Change these for your environment... # ################################################################################ -PDCURSES_HOME =d:/pdcurses/pdcurses -CC_HOME =c:/mingw32 +#PDCURSES_HOME =d:/pdcurses/pdcurses +PDCURSES_HOME =C:/Lang/sf.net/cvs/PDCurses +#CC_HOME =c:/mingw32 +CC_HOME =C:/Lang/MinGW ################################################################################ # Nothing below here should required changing. ################################################################################ @@ -34,10 +36,10 @@ CC = gcc ifeq ($(DEBUG),Y) - CFLAGS = -c -g -Wall -DPDCDEBUG -D_NO_OLDNAMES + CFLAGS = -c -g -Wall -DPDCDEBUG -D_NO_OLDNAMES -DPDC_STATIC_BUILD LDFLAGS = -g else - CFLAGS = -c -O -Wall -D_NO_OLDNAMES + CFLAGS = -c -O3 -march=i586 -mcpu=i586 -Wall -D_NO_OLDNAMES -DPDC_STATIC_BUILD LDFLAGS = endif @@ -60,13 +62,14 @@ DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe ################################################################################ -all: $(PDCLIBS) $(DEMOS) +#all: $(PDCLIBS) $(DEMOS) +all: $(PDCLIBS) clean: -del *.o - -del curses.lib - -del panel.lib -del *.exe + -del pdcurses.a + -del panel.a demos: $(DEMOS)