Commit c5773723 authored by deuce's avatar deuce
Browse files

Final killing of the SP macro... she's dead Jim.

Any *nix program using the standard build system will now compile with XCurses
if XCURSES is set like so:
gmake XCURSES=1

This is currently experimental... in theory it should work, but I'm not
betting the farm on 'er.
parent dfa1073f
# Available Options:
# NEED_CURSES = Set flags suitable for building with the curses lib
# NEED_UIFC = Set flags for use with UIFC
# XCURSES = Use XCurses
# You really should set this first.
UIFC_SRC ?= $(XPDEV)../uifc/
......@@ -27,15 +28,25 @@ endif
ifdef USE_UIFC32
UIFC_CFLAGS += -DUSE_UIFC32
UIFC_OBJS += $(LIBODIR)/uifc32.o
USE_CIOWRAP := 1
endif
ifdef USE_CIOWRAP
UIFC_OBJS += $(LIBODIR)/ciowrap.o
UIFC_NEED_CURSES := 1
endif
# Curses Stuff
ifeq ($(os),qnx)
CURSES_LDFLAGS += -lncurses
ifdef XCURSES
CURSES_LDFLAGS += -lXCurses -L/usr/local/lib -lXaw -lXmu -lXt -lX11 -lSM -lICE -lXext -L/usr/X11R6/lib
CURSES_CFLAGS += -DXCURSES -I/usr/local/include
else
CURSES_LDFLAGS += -lcurses
ifeq ($(os),qnx)
CURSES_LDFLAGS += -lncurses
CURSES_CFLAGS += -DN_CURSES_LIB
else
CURSES_LDFLAGS += -lcurses
CURSES_CFLAGS += -DCURSES_LIB
endif
endif
ifdef NEED_CURSES
......
......@@ -601,7 +601,13 @@ void initciowrap(long inmode)
{
short fg, bg, pair=0;
#ifdef XCURSES
char *argv[2]={"Syhcnronet",NULL};
Xinitscr(1,argv);
#else
initscr();
#endif
start_color();
cbreak();
noecho();
......
/* $Id$ */
#include <curses.h>
#ifdef XCURSES
#include <xcurses.h>
#endif
#ifdef N_CURSES_LIB
#include <ncurses.h>
#endif
#ifdef CURSES_LIB
#include <curses.h>
#endif
#ifndef ACS_SBSD
#define ACS_SBSD ACS_SBSS
......
......@@ -335,7 +335,7 @@ static void truncsp(char *str)
uint c;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
while(c && (uchar)str[c-1]<=' ') c--;
str[c]=0;
}
......@@ -1200,7 +1200,7 @@ in_win[i++]='
in_win[i++]=hclr|(bclr<<4);
if(plen) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4); }
for(c=0;prompt[c];c++) {
......@@ -1213,7 +1213,7 @@ if(plen) {
c++; }
for(c=0;c<max+2;c++) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4); }
in_win[i++]='';
......@@ -1392,7 +1392,7 @@ while(1) {
gettext(wherex()+1,y,wherex()+(j-i),y,buf);
puttext(wherex(),y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+1),y);
for(k=i;k<j;k++)
str[k]=str[k+1];
......@@ -1412,7 +1412,7 @@ while(1) {
gettext(wherex(),y,wherex()+(j-i),y,buf);
puttext(wherex()-1,y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+2),y);
i--;
j--;
......@@ -1438,7 +1438,7 @@ while(1) {
continue;
if(mode&K_ALPHA && !isalpha(ch))
continue;
if((ch>=SP || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max)) {
if((ch>=' ' || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max)) {
if(mode&K_UPPER)
ch=toupper(ch);
if(ins) {
......@@ -1624,7 +1624,7 @@ void upop(char *str)
showmouse();
return; }
gettext(28,12,53,14,sav);
memset(buf,SP,25*3*2);
memset(buf,' ',25*3*2);
for(i=1;i<26*3*2;i+=2)
buf[i]=(hclr|(bclr<<4));
buf[0]='';
......@@ -1689,7 +1689,7 @@ void help()
return; }
hidemouse();
gettext(1,1,80,25,savscrn);
memset(buf,SP,76*21*2);
memset(buf,' ',76*21*2);
for(i=1;i<76*21*2;i+=2)
buf[i]=(hclr|(bclr<<4));
buf[0]='';
......
......@@ -215,7 +215,6 @@
#define FF 0x0c /* Form feed ^L */
#define CR '\r' /* Carriage return ^M */
#define ESC 0x1b /* Escape ^[ */
#define SP ' ' /* Space */
#define DEL 0x7f /* Delete ^BS */
#endif
......
......@@ -392,7 +392,7 @@ static void truncsp(char *str)
uint c;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
while(c && (uchar)str[c-1]<=' ') c--;
if(str[c]!=0) /* don't write to string constants */
str[c]=0;
}
......@@ -1260,7 +1260,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
in_win[i++]=hclr|(bclr<<4);
if(plen) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4);
}
......@@ -1276,7 +1276,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
}
for(c=0;c<max+2;c++) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4);
}
......@@ -1467,7 +1467,7 @@ static int ugetstr(char *outstr, int max, long mode)
gettext(wherex(),y,wherex()+(j-i),y,buf);
puttext(wherex()-1,y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+2),y);
i--;
j--;
......@@ -1482,7 +1482,7 @@ static int ugetstr(char *outstr, int max, long mode)
gettext(wherex()+1,y,wherex()+(j-i),y,buf);
puttext(wherex(),y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+1),y);
for(k=i;k<j;k++)
str[k]=str[k+1];
......@@ -1520,7 +1520,7 @@ static int ugetstr(char *outstr, int max, long mode)
continue;
if(mode&K_ALPHA && !isalpha(ch))
continue;
if((ch>=SP || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max) && isprint(ch))
if((ch>=' ' || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max) && isprint(ch))
{
if(mode&K_UPPER)
ch=toupper(ch);
......@@ -1729,7 +1729,7 @@ void upop(char *str)
return;
}
gettext(28,12,53,14,sav);
memset(buf,SP,25*3*2);
memset(buf,' ',25*3*2);
for(i=1;i<26*3*2;i+=2)
buf[i]=(hclr|(bclr<<4));
buf[0]='';
......@@ -1829,7 +1829,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
gettext(1,1,api->scrn_width,api->scrn_len,savscrn);
if(!is_redraw) {
memset(buf,SP,width*height*2);
memset(buf,' ',width*height*2);
for(i=1;i<width*height*2;i+=2)
buf[i]=(hclr|(bclr<<4));
buf[0]='';
......@@ -1916,7 +1916,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
curs_set(1);
return;
}
memset(textbuf,SP,(width-2-pad-pad)*lines*2);
memset(textbuf,' ',(width-2-pad-pad)*lines*2);
for(i=1;i<(width-2-pad-pad)*lines*2;i+=2)
buf[i]=(hclr|(bclr<<4));
i=0;
......
......@@ -167,7 +167,7 @@ static void truncsp(char *str)
uint c;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
while(c && (uchar)str[c-1]<=' ') c--;
str[c]=0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment