From 9e037c33e0994d46da03b236aa3dc211c3e0f2b2 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Tue, 3 Jan 2006 20:07:15 +0000 Subject: [PATCH] Removed remnants of unfinished Unix port. --- curses.h | 24 +----------- curspriv.h | 7 +--- panel/panel.c | 7 +--- pdcurses/beep.c | 18 ++------- pdcurses/color.c | 14 +------ pdcurses/getch.c | 21 +---------- pdcurses/getstr.c | 21 +---------- pdcurses/initscr.c | 30 ++------------- pdcurses/inopts.c | 90 +-------------------------------------------- pdcurses/termattr.c | 59 +---------------------------- pdcurses/window.c | 6 +-- 11 files changed, 17 insertions(+), 280 deletions(-) diff --git a/curses.h b/curses.h index 0441a3ca..2b00a1b7 100644 --- a/curses.h +++ b/curses.h @@ -18,7 +18,7 @@ *************************************************************************** */ /* -$Id: curses.h,v 1.63 2006/01/03 19:54:29 wmcbrine Exp $ +$Id: curses.h,v 1.64 2006/01/03 20:07:12 wmcbrine Exp $ */ /* *---------------------------------------------------------------------- @@ -677,26 +677,6 @@ PDCurses portable platform definitions list: # endif #endif -#if 0 -/*---------------------------------------- -* gcc under UNIX -* -* GNU definitions: -* UNIX -*/ -#ifdef UNIX -# define HAVE_PROTO 1 /* GNU C supports ANSI C prototypes */ -# ifdef SUNOS -# define NO_VSSCANF -# define NO_MEMMOVE -# undef BSD -# endif -# ifdef linux -# undef BSD -# endif -#endif -#endif - /*---------------------------------------- * MicroWay NDP C/C++ 386 4.2.0 compiler */ @@ -2009,7 +1989,7 @@ int PDC_CDECL PDC_set_line_color Args(( short )); #define wstandend(w) wattrset(w, A_NORMAL) #define wstandout(w) wattrset(w, A_STANDOUT) -#if !defined(UNIX) && !defined(XCURSES) +#if !defined(XCURSES) # define nocbreak() (SP->cbreak = FALSE, SP->delaytenths = 0, OK) # define cbreak() (SP->cbreak = TRUE, OK) # define nocrmode() (SP->cbreak = FALSE, OK) diff --git a/curspriv.h b/curspriv.h index ce696758..eb7265f7 100644 --- a/curspriv.h +++ b/curspriv.h @@ -18,7 +18,7 @@ *************************************************************************** */ /* -$Id: curspriv.h,v 1.14 2006/01/03 19:54:29 wmcbrine Exp $ +$Id: curspriv.h,v 1.15 2006/01/03 20:07:14 wmcbrine Exp $ */ /* * @@ -343,11 +343,6 @@ int PDC_get_scrn_mode Args(( void )); int PDC_query_adapter_type Args(( void )); # endif -# ifdef UNIX -int PDC_kbhit Args((void)); -int PDC_setup_keys Args((void)); -# endif - # ifdef WIN32 void PDC_doupdate Args((void)); # endif diff --git a/panel/panel.c b/panel/panel.c index 34173942..60b9599b 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -25,13 +25,8 @@ #include -#ifdef UNIX -#include -#include -#endif - #ifdef PDCDEBUG -char *rcsid_panel = "$Id: panel.c,v 1.8 2005/12/14 19:40:29 wmcbrine Exp $"; +char *rcsid_panel = "$Id: panel.c,v 1.9 2006/01/03 20:07:15 wmcbrine Exp $"; #endif diff --git a/pdcurses/beep.c b/pdcurses/beep.c index 26804a6a..cec9e171 100644 --- a/pdcurses/beep.c +++ b/pdcurses/beep.c @@ -23,11 +23,6 @@ #endif #include -#ifdef UNIX -#include -#include -#endif - /* undefine any macros for functions defined in this module */ #undef beep #undef flash @@ -38,7 +33,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_beep = "$Id: beep.c,v 1.3 2006/01/03 08:32:12 wmcbrine Exp $"; +char *rcsid_beep = "$Id: beep.c,v 1.4 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -89,7 +84,7 @@ int PDC_CDECL beep() PDC_beep(); - return( OK ); + return OK; } /***********************************************************************/ #ifdef HAVE_PROTO @@ -101,22 +96,15 @@ int PDC_CDECL flash() { PDC_LOG(("flash() - called\n")); -#ifdef UNIX - if (flash_screen != NULL) - putp(flash_screen); - return(OK); -#endif - #if defined(DOS) || defined(OS2) || defined(WIN32) PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_NORMAL); napms( 50 ); PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_REVERSE); wrefresh(curscr); - return( OK ); #endif #if defined(XCURSES) XCursesInstructAndWait(CURSES_FLASH); - return( OK ); #endif + return OK; } diff --git a/pdcurses/color.c b/pdcurses/color.c index c9dea350..39007538 100644 --- a/pdcurses/color.c +++ b/pdcurses/color.c @@ -27,11 +27,6 @@ # include #endif -#ifdef UNIX -#include -#include -#endif - /* undefine any macros for functions defined in this module */ #undef start_color #undef init_pair @@ -53,7 +48,7 @@ static int PDC_init_pair(); #endif #ifdef PDCDEBUG -char *rcsid_color = "$Id: color.c,v 1.13 2006/01/03 07:34:43 wmcbrine Exp $"; +char *rcsid_color = "$Id: color.c,v 1.14 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -322,14 +317,7 @@ int PDC_CDECL can_change_color() { PDC_LOG(("can_change_color() - called\n")); -#ifdef UNIX - if (can_change) - return(TRUE); - else - return(FALSE); -#else return(FALSE); -#endif } /***********************************************************************/ #ifdef HAVE_PROTO diff --git a/pdcurses/getch.c b/pdcurses/getch.c index 6cb91310..bd7778b6 100644 --- a/pdcurses/getch.c +++ b/pdcurses/getch.c @@ -39,7 +39,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_getch = "$Id: getch.c,v 1.11 2006/01/03 07:34:43 wmcbrine Exp $"; +char *rcsid_getch = "$Id: getch.c,v 1.12 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -152,12 +152,7 @@ extern WINDOW* _getch_win_; #endif /* static chtype buffer[_INBUFSIZ];MH*/ /* character buffer */ static int buffer[_INBUFSIZ]; /* character buffer */ -#ifdef UNIX - short display_key = 0400; - bool cbreak_set = FALSE; -#else short display_key = 0x100; -#endif int waitingtenths = 0; PDC_LOG(("wgetch() - called\n")); @@ -229,20 +224,6 @@ extern WINDOW* _getch_win_; for(;;) /* loop for any buffering */ { -#ifdef UNIX - if (!(SP->raw_inp || SP->cbreak)) - { - cbreak(); - cbreak_set = TRUE; - } - if (w->_use_keypad) - key = PDC_sysgetch(); - else - key = PDC_rawgetch(); - if (cbreak_set) - nocbreak(); -#endif - #if defined(DOS) || defined(OS2) || defined(WIN32) if (SP->raw_inp) { diff --git a/pdcurses/getstr.c b/pdcurses/getstr.c index a5e4e09a..d0fc0a76 100644 --- a/pdcurses/getstr.c +++ b/pdcurses/getstr.c @@ -43,7 +43,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_getstr = "$Id: getstr.c,v 1.9 2006/01/03 07:34:43 wmcbrine Exp $"; +char *rcsid_getstr = "$Id: getstr.c,v 1.10 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -213,24 +213,6 @@ int n; if (win == (WINDOW *)NULL) return (ERR); -#ifdef UNIX -/* - * this code is very dodgy - * - wrefresh(win); - - while ((*str = wgetch(win)) != ERR && *str != '\n') - ; - if (*str == ERR) { - *str = '\0'; - waddstr(win,p); - return ERR; - } - *str = '\0'; - waddstr(win,p); - return OK; -*/ -#else oldcbreak = SP->cbreak; /* remember states */ oldecho = SP->echo; oldnodelay = win->_nodelay; @@ -343,5 +325,4 @@ int n; win->_nodelay = oldnodelay; return (OK); -#endif } diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index a1c5264b..af7348b5 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -27,12 +27,6 @@ #include #endif -#ifdef UNIX -#define NOTLIB -#include -#include -#endif - /* undefine any macros for functions defined in this module */ #undef initscr #undef endwin @@ -52,16 +46,8 @@ # undef wnoutrefresh #endif -#ifdef UNIX -#define NOTLIB -#include -#include -/* following is to stop compilation problems with #define of lines */ -#undef lines -#endif - #ifdef PDCDEBUG -char *rcsid_initscr = "$Id: initscr.c,v 1.13 2006/01/03 19:54:29 wmcbrine Exp $"; +char *rcsid_initscr = "$Id: initscr.c,v 1.14 2006/01/03 20:07:15 wmcbrine Exp $"; #else char* _curses_notice = "PDCurses 2.2 - Public Domain 1994"; #endif @@ -119,7 +105,7 @@ extern void efree(); /* user's efree(ptr) */ # endif #endif -#if !defined(UNIX) && !defined(XCURSES) +#if !defined(XCURSES) # ifdef HAVE_PROTO extern void* malloc( size_t ); /* runtime's malloc(size) */ extern void* calloc( size_t, size_t ); /* runtime's calloc(num,size) */ @@ -283,12 +269,6 @@ register int i; reallc = realloc; } -#ifdef UNIX - setupterm((char *)0,1,(int *)0); - if (enter_ca_mode != NULL) - putp(enter_ca_mode); -#endif - #if defined (XCURSES) if (XCursesInitscr(NULL,argc,argv) == ERR) exit(7); @@ -428,11 +408,7 @@ register int i; SP->alive = TRUE; -#ifdef UNIX - PDC_setup_keys(); -#else - def_shell_mode(); /* don't do this for UNIX as scropen has already changed things */ -#endif + def_shell_mode(); return( stdscr ); } diff --git a/pdcurses/inopts.c b/pdcurses/inopts.c index 59d4bdfd..a0eba9f7 100644 --- a/pdcurses/inopts.c +++ b/pdcurses/inopts.c @@ -23,12 +23,6 @@ #endif #include -#ifdef UNIX -#define NOTLIB -#include -#include -#endif - /* undefine any macros for functions defined in this module */ #undef cbreak #undef nocbreak @@ -55,7 +49,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_inopts = "$Id: inopts.c,v 1.5 2006/01/03 07:41:49 wmcbrine Exp $"; +char *rcsid_inopts = "$Id: inopts.c,v 1.6 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -207,21 +201,6 @@ int PDC_CDECL cbreak() { PDC_LOG(("cbreak() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - _CUR_TERM.prog_mode.c_lflag &= ~(ICANON); - _CUR_TERM.prog_mode.c_iflag &= ~(ICRNL); -/* _CUR_TERM.prog_mode.c_lflag |= ISIG;*/ - _CUR_TERM.prog_mode.c_cc[VMIN] = 1; - _CUR_TERM.prog_mode.c_cc[VTIME] = 0; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM.prog_mode.sg_flags |= CBREAK; - ioctl(_CUR_TERM.fd, TIOCSETP, &_CUR_TERM.prog_mode); -#endif - -#endif - SP->cbreak = TRUE; return( OK ); } @@ -235,16 +214,6 @@ int PDC_CDECL nocbreak() { PDC_LOG(("nocbreak() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - _CUR_TERM.prog_mode.c_lflag |= ICANON; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM->prog_mode.sg_flags &= ~CBREAK; - ioctl(_CUR_TERM.fd, TIOCSETP,&_CUR_TERM.prog_mode); -#endif -#endif - SP->cbreak = FALSE; SP->delaytenths = 0; return( OK ); @@ -259,16 +228,6 @@ int PDC_CDECL echo() { PDC_LOG(("echo() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - _CUR_TERM.prog_mode.c_lflag |= ECHOCTL|ECHOKE; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM.prog_mode.sg_flags |= ECHO; - ioctl(_CUR_TERM.fd, TIOCSETP, &_CUR_TERM.prog_mode); -#endif -#endif - SP->echo = TRUE; return( OK ); } @@ -282,16 +241,6 @@ int PDC_CDECL noecho() { PDC_LOG(("noecho() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - _CUR_TERM.prog_mode.c_lflag &= ~(ECHO|ECHOPRT); - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM.prog_mode.sg_flags &= ~ECHO; - ioctl(_CUR_TERM.fd, TIOCSETP, &_CUR_TERM.prog_mode); -#endif -#endif - SP->echo = FALSE; return( OK ); } @@ -425,26 +374,6 @@ int PDC_CDECL raw() KbdInfo.fsMask &= ~KEYBOARD_ASCII_MODE; KbdSetStatus(&KbdInfo,0); # endif -#endif - -#if defined( UNIX ) /* || defined( EMXVIDEO ) NOT COMPLETED */ -#ifdef USE_TERMIO -#if 0 - _CUR_TERM.prog_mode.c_lflag &= ~(ICANON|ISIG); - _CUR_TERM.prog_mode.c_iflag &= ~(INPCK|ISTRIP|IXON); - _CUR_TERM.prog_mode.c_oflag &= ~(OPOST); - _CUR_TERM.prog_mode.c_cc[VMIN] = 1; - _CUR_TERM.prog_mode.c_cc[VTIME] = 0; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#endif - _CUR_TERM.prog_mode.c_lflag &= ~(ICANON|ISIG); - _CUR_TERM.prog_mode.c_iflag &= ~(IXON); - _CUR_TERM.prog_mode.c_iflag |= ICRNL; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM.prog_mode.sg_flags |= RAW; - ioctl(_CUR_TERM.fd, TIOCSETP, &_CUR_TERM.prog_mode); -#endif #endif SP->raw_inp = TRUE; @@ -475,23 +404,6 @@ int PDC_CDECL noraw() KbdInfo.fsMask &= ~KEYBOARD_BINARY_MODE; KbdSetStatus(&KbdInfo,0); # endif -#endif - -#if defined( UNIX ) /* || defined( EMXVIDEO ) NOT COMPLETE */ -#ifdef USE_TERMIO -#if 0 - _CUR_TERM.prog_mode.c_lflag |= ISIG|ICANON; - _CUR_TERM.prog_mode.c_iflag |= IXON|INPCK|ISTRIP; - _CUR_TERM.prog_mode.c_oflag |= OPOST; - _CUR_TERM.prog_mode.c_cc[VMIN] = _CUR_TERM.shell_mode.c_cc[VMIN]; - _CUR_TERM.prog_mode.c_cc[VTIME] = _CUR_TERM.shell_mode.c_cc[VTIME]; -#endif - _CUR_TERM.prog_mode.c_lflag |= ICANON; - ioctl(_CUR_TERM.fd, TCSETAW, &_CUR_TERM.prog_mode); -#else - _CUR_TERM.prog_mode.sg_flags &= ~RAW; - ioctl(_CUR_TERM.fd, TIOCSETP, &_CUR_TERM.prog_mode); -#endif #endif SP->raw_inp = FALSE; diff --git a/pdcurses/termattr.c b/pdcurses/termattr.c index 987a52c1..384de232 100644 --- a/pdcurses/termattr.c +++ b/pdcurses/termattr.c @@ -23,11 +23,6 @@ #endif #include -#ifdef UNIX -#include -#include -#endif - #include #include #include @@ -48,7 +43,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_termattr = "$Id: termattr.c,v 1.6 2006/01/03 19:54:29 wmcbrine Exp $"; +char *rcsid_termattr = "$Id: termattr.c,v 1.7 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -157,15 +152,11 @@ int PDC_CDECL baudrate() { PDC_LOG(("baudrate() - called\n")); -#ifdef UNIX - return (_CUR_TERM.baudrate); -#else #ifdef FAST_VIDEO return (SP->direct_video ? INT_MAX : 19200 ); #else return (19200); /* Approx. guess at BIOS speeds.*/ #endif -#endif } /***********************************************************************/ #ifdef HAVE_PROTO @@ -177,17 +168,7 @@ char PDC_CDECL erasechar() { PDC_LOG(("erasechar() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - ioctl(_CUR_TERM.fd, TCGETA, &_CUR_TERM.prog_mode); - return(_CUR_TERM.prog_mode.c_cc[VERASE]); -#else - ioctl(_CUR_TERM.fd, TIOCGETP, &_CUR_TERM.prog_mode.v6); - return(_CUR_TERM.prog_mode.v6.sg_erase); -#endif -#else return( _ECHAR ); /* character delete char (^H) */ -#endif } /***********************************************************************/ #ifdef HAVE_PROTO @@ -199,14 +180,7 @@ bool PDC_CDECL has_ic() { PDC_LOG(("has_ic() - called\n")); -#ifdef UNIX - if (insert_character != NULL && delete_character != NULL) - return(TRUE); - else - return(FALSE); -#else return( TRUE ); -#endif } /***********************************************************************/ #ifdef HAVE_PROTO @@ -218,14 +192,7 @@ bool PDC_CDECL has_il() { PDC_LOG(("has_il() - called\n")); -#ifdef UNIX - if (insert_line != NULL && delete_line != NULL) - return(TRUE); - else - return(FALSE); -#else return( TRUE ); -#endif } /***********************************************************************/ #ifdef HAVE_PROTO @@ -237,17 +204,7 @@ char PDC_CDECL killchar() { PDC_LOG(("killchar() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - ioctl(_CUR_TERM.fd, TCGETA, &_CUR_TERM.prog_mode); - return(_CUR_TERM.prog_mode.c_cc[VKILL]); -#else - ioctl(_CUR_TERM.fd, TIOCGETP, &_CUR_TERM.prog_mode.v6); - return(_CUR_TERM.prog_mode.v6.sg_kill); -#endif -#else return( _DLCHAR ); /* line delete char (^U) */ -#endif } /***********************************************************************/ #ifdef HAVE_PROTO @@ -390,19 +347,5 @@ char PDC_CDECL wordchar() { PDC_LOG(("wordchar() - called\n")); -#ifdef UNIX -#ifdef USE_TERMIO - ioctl(_CUR_TERM.fd, TCGETA, &_CUR_TERM.prog_mode); - return(_CUR_TERM.prog_mode.c_cc[VWERASE]); -#else -#ifdef TIOCGLTC - ioctl(_CUR_TERM.fd, TIOCGLTC, &_CUR_TERM.prog_mode.bsd_new); - return(_CUR_TERM.prog_mode.bsd_new.t_werase); -#else - return(0); -#endif -#endif -#else return (_DWCHAR); /* word delete char */ -#endif } diff --git a/pdcurses/window.c b/pdcurses/window.c index 4df8e144..fa92e2b6 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -48,7 +48,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_window = "$Id: window.c,v 1.7 2006/01/03 07:34:43 wmcbrine Exp $"; +char *rcsid_window = "$Id: window.c,v 1.8 2006/01/03 20:07:15 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -226,9 +226,7 @@ extern void (*fre)(); } } } -#ifdef UNIX - PDC_gotoxy(begy, begx); -#endif + return( win ); } /***********************************************************************/