[net.unix] curses & ultrix

drears@ardec.arpa (FSAC) (07/23/86)

We are running Ultrix 1.2 on a VAX 8600.  I am trying to compile a
a set of programs using curses.  Unfortunately Ultrix's curses
doesn't conform with SYSV or 4.2 BSD.
  The first problem I had was the defines of BOLD, DIM, etc was
missing from /usr/include/curses.h.  I had to redefine that file. 
I also noticed that the structure element of win_attrs was changed to
win_flags (Probabably so DEC could say they made "major" changes to it)
The functions attron & attroff (in curses.h they are macros which are
mapped to wattron & wattroff) are missing.  I attempted to write
these functions but as I do not have source I can only guess at
this.  This is how these functions look:

/*  These functions are added on because ULTRIX 
is a incomplete package */

wattron(win, att)
WINDOW *win;
int	att;
{
	win->_flags |= att;
}


wattroff(win, att)
WINDOW *win;
int	att;
{
	win->_flags &= ~att;
}

The attributes are defined as:

#define A_STANDOUT	0000200
#define A_UNDERLINE	0000400
#define A_REVERSE	0001000
#define A_BLINK		0002000
#define A_DIM		0004000
#define A_BOLD		0010000
#define A_NORMAL	0000000

	The programs now compile but when I run it It does not turn on
the attributes.  Can anyone provide insight into fixing this ?  

	    Dennis

Bader@b.psy.cmu.EDU (Miles Bader) (07/23/86)

As far as I know, curses has *never* had these things. 4.2/4.1 have only
a single highlighting mode, which is turned on/off by
standout()/standend().  The flags in the window structure of my curses.h
(4.2 on an IBM RT is what I'm looking at, but as I remember, 4.1 was the
same) are in field called _flags.  Are you sure you're not thinking of the
at&t rewrite of curses?

jpn@teddy.UUCP (John P. Nelson) (07/24/86)

>We are running Ultrix 1.2 on a VAX 8600.  I am trying to compile a
>a set of programs using curses.  Unfortunately Ultrix's curses
>doesn't conform with SYSV or 4.2 BSD.
>  The first problem I had was the defines of BOLD, DIM, etc was
>missing from /usr/include/curses.h.

Well, while it is true that ULTRIX curses is not compatible with the
SYSV curses, it IS compatible with the 4.2BSD curses.  Unforunately,
the BSD curses does not have such things as BOLD, DIM, etc.  If you
were using BOLD or DIM on a 4.2 machine, it was because someone
ported the system V curses to it.

Just wanted to set the record straight.

guy@sun.uucp (Guy Harris) (07/24/86)

(This was sent to INFO-UNIX and INFO-C, and thus appeared both in "net.unix"
and "net.lang.c".  Since "curses" is a UNIX facility, rather than a standard
C library, further discussion should continue only in "net.unix" and
INFO-UNIX.)

> We are running Ultrix 1.2 on a VAX 8600.  I am trying to compile a
> a set of programs using curses.  Unfortunately Ultrix's curses
> doesn't conform with SYSV or 4.2 BSD.
>
> (long list of alleged changes from System V "curses", which sound
> more like the "curses" in question is the 4.2BSD "curses")

Are you sure that it doesn't conform with 4.2BSD?  Did they claim that
it conformed with the System V "curses"?  If so, did they actually supply
*two* versions of "curses"; one compatible with System V and one compatible
with 4.2BSD?  The 4.2BSD "curses" does NOT support arbitrary per-character
attributes.  As such, naturally the defines of BOLD, DIM, etc., the
macros "attron" and "attroff", and the functions "wattron" and "wattoff"
that they call would be missing.  Furthermore, there IS no element of a
WINDOW structure called "_attrs"; there IS one called "_flags" (I presume
that's what you meant when you referred to "win_attrs" and "win_flags").
If "_flags" is a short, the chances are overwhelming that the version of
"curses" you're using is a 4.2BSD version, rather than a System V version.
If so, you're SOL; you will never get the extra attributes stuff to work.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)