1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-17 08:15:23 +00:00

Simple changes for porting to non-UNIX systems.

input.c: The tmpf variable is defined inside an #if UNIX block at line
         506, but used outside of an #if UNIX block at line 696. Added
         #if UNIX there.

spawn.c:
    - For spawncli(), return FALSE if neither USB ot BSD is defined.
    - In spawn() and execprg(), move declarations inside USB | BSD
      block.

tcap.c: Move #if TERMCAP to avoid curses.h include on non-TERMCAP
        systems.

termio.c: For ttgetc(), return 0 if neither USG nor BSD is defined.
This commit is contained in:
Rob Gowin 2022-07-26 11:07:57 -04:00
parent db221f9705
commit 622513c218
4 changed files with 15 additions and 6 deletions

View File

@ -693,10 +693,12 @@ int getstring( const char *prompt, char *buf, int nbuf, int eolchar)
} }
TTflush() ; TTflush() ;
#if UNIX
if( tmpf != NULL) { if( tmpf != NULL) {
fclose( tmpf) ; fclose( tmpf) ;
unlink( tmp) ; unlink( tmp) ;
} }
#endif
return retval ; return retval ;
} }

14
spawn.c
View File

@ -69,6 +69,8 @@ BINDABLE( spawncli) {
term.t_nrow = term.t_ncol = 0; term.t_nrow = term.t_ncol = 0;
#endif #endif
return TRUE; return TRUE;
#else
return FALSE;
#endif #endif
} }
@ -100,14 +102,14 @@ void rtfrmshell(void)
* done. Bound to "C-X !". * done. Bound to "C-X !".
*/ */
BINDABLE( spawn) { BINDABLE( spawn) {
int s ;
char *line ;
/* don't allow this command if restricted */ /* don't allow this command if restricted */
if( restflag) if( restflag)
return resterr(); return resterr();
#if USG | BSD #if USG | BSD
int s ;
char *line ;
s = newmlarg( &line, "!", 0) ; s = newmlarg( &line, "!", 0) ;
if( s != TRUE) if( s != TRUE)
return s ; return s ;
@ -129,6 +131,8 @@ BINDABLE( spawn) {
TTkopen(); TTkopen();
sgarbf = TRUE; sgarbf = TRUE;
return TRUE; return TRUE;
#else
return FALSE;
#endif #endif
} }
@ -139,14 +143,14 @@ BINDABLE( spawn) {
*/ */
BINDABLE( execprg) { BINDABLE( execprg) {
int s ;
char *line ;
/* don't allow this command if restricted */ /* don't allow this command if restricted */
if( restflag) if( restflag)
return resterr() ; return resterr() ;
#if USG | BSD #if USG | BSD
int s ;
char *line ;
s = newmlarg( &line, "$", 0) ; s = newmlarg( &line, "$", 0) ;
if( s != TRUE) if( s != TRUE)
return s ; return s ;
@ -164,6 +168,8 @@ BINDABLE( execprg) {
while ((s = tgetc()) != '\r' && s != ' '); while ((s = tgetc()) != '\r' && s != ' ');
sgarbf = TRUE; sgarbf = TRUE;
return TRUE; return TRUE;
#else
return FALSE;
#endif #endif
} }

4
tcap.c
View File

@ -6,6 +6,8 @@
* modified by Petri Kutvonen * modified by Petri Kutvonen
*/ */
#if TERMCAP
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -24,8 +26,6 @@
#include "display.h" #include "display.h"
#include "termio.h" #include "termio.h"
#if TERMCAP
boolean eolexist = TRUE ; /* does clear to EOL exist */ boolean eolexist = TRUE ; /* does clear to EOL exist */
boolean revexist = FALSE ; /* does reverse video exist? */ boolean revexist = FALSE ; /* does reverse video exist? */
boolean sgarbf = TRUE ; /* TRUE if screen is garbage */ boolean sgarbf = TRUE ; /* TRUE if screen is garbage */

View File

@ -228,6 +228,7 @@ int ttgetc( void) {
} }
return kbdq & 255; return kbdq & 255;
#endif #endif
return 0;
} }
#if TYPEAH #if TYPEAH