Article View: news.software.readers
Article #29549Re: SLRN 0.9.2.1 beta - recognizing terminal size?
From: Michael Israeli
Date: Fri, 17 Jan 1997 00:00
Date: Fri, 17 Jan 1997 00:00
50 lines
2217 bytes
2217 bytes
In <slrn5dukjm.9rk.davis@mygir.davis.net>,
John E. Davis <davis@space.mit.edu> wrote:
> If you use gcc on a Sun, you have to use the -traditional-cpp compiler
> flag. It is well known that there is a conflict between the sun
> include files and gcc. Also, the window size is determined in
> slang/src/sldisply.c. One of your include files (see sldisply.c) must
> define TIOCGWINSZ for it to work properly. This is usually defined
> when /usr/include/termios.h is included. That file will be included
> if slang/src/config.h defines HAVE_TERMIOS_H.
Well, your help is much appreciated. Today I was able to compile slrn
on our SunOS 4.1.4 machine and the window size works at > 24 lines.
There was no slang/src/sldisply.c file in the distribution I got, but I
used your suggestions to do the following:
added -traditional-cpp to the src/Makefile:
CFLAGS = -g -O -fno-strength-reduce -DX_DISPLAY_MISSING
-traditional-cpp
then, in src/slrn.c where it said #ifdef HAVE_TERMIOS_H, I changed that
to
#if 1 so it will do it anway:
#if 1
struct winsize wind_struct;
if (Slrn_Batch)
return;
do
{
if ((ioctl(1,TIOCGWINSZ,&wind_struct) == 0)
|| (ioctl(0, TIOCGWINSZ, &wind_struct) == 0)
|| (ioctl(2, TIOCGWINSZ, &wind_struct) == 0))
{
c = (int) wind_struct.ws_col;
r = (int) wind_struct.ws_row;
break;
}
}
while (errno == EINTR);
And it compiled and works like a charm. Thanks again for the help. :)
- Izzy
Technical Details
Message-ID:
<slrn5e049e.ng5.izzy@nothing.izzy.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn5dtjbh.8ia.hillary@unix3.netaxs.com> <slrn5dukjm.9rk.davis@mygir.davis.net>Show Full Headers
Complete Article Headers
Message-ID: <slrn5e049e.ng5.izzy@nothing.izzy.com> Subject: Re: SLRN 0.9.2.1 beta - recognizing terminal size? Date: Fri, 17 Jan 1997 00:00:00 +0000 From: izzy@izzy.com (Michael Israeli) References: <slrn5dtjbh.8ia.hillary@unix3.netaxs.com> <slrn5dukjm.9rk.davis@mygir.davis.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 210525489 Organization: Dip n Strip has moved - BOFH branch Newsgroups: news.software.readers