[comp.unix.questions] unify vs curses vs terminfo

russ@wpg.UUCP (Russell Lawrence) (01/04/88)

I have been working on a screen handling package/application generator
for use with the unify database manager and have run into a major snag.

The unify functions for handling terminal io are based on terminfo/termcap
routines and are incompatible with curses.  At first, I figured that wouldn't
be a problem since I was planning on re-writing all the screen handling stuff 
anyway.  However, I quickly discovered that some unify routines that appear to 
be unrelated to screen management are also dependent in some byzantine 
fashion on termcap/terminfo --- causing my own well-tested, curses-based 
windows to royally screw-up.  

It has occured to me that I might be able to work-around the snag by 
creating a library full of null functions with termcap names to satisfy the 
demands of various unify routines.  However, that seems like a klutzy 
solution with potentially negative side-effects.  Has anyone else experienced 
this problem?  Solutions? Suggestions? Hints? Methods? Etc?

-- 
Russell Lawrence (WP Group POB 306, Metairie, LA 70004) 
AT&T: +1 504 456 0001                                  
UUCP: !{philabs,hpda,nbires,amdahl,...}!uunet!wpg!russ
COMPUSERVE: 72337,3261

syd@dsinc.UUCP (Syd Weinstein) (01/05/88)

In article <228@wpg.UUCP> russ@wpg.UUCP (Russell Lawrence) writes:
>I have been working on a screen handling package/application generator
>for use with the unify database manager and have run into a major snag.
>
>The unify functions for handling terminal io are based on terminfo/termcap
>routines and are incompatible with curses.  At first, I figured that wouldn't
>be a problem since I was planning on re-writing all the screen handling stuff 
>anyway.  However, I quickly discovered that some unify routines that appear to 
>be unrelated to screen management are also dependent in some byzantine 
>fashion on termcap/terminfo --- causing my own well-tested, curses-based 
>windows to royally screw-up.  
>
Unify in their infinite wisdom :-) has used some names for routines that
curses also uses.  For several clients we developed a curses library
that is compatible with Unify.  We can sell you that if you wish.

Using this library we have developed many applications using curses
instead of the unify routines.  We have had no problem at all using
curses this way and have run into no conflicts so far.  Of course it
does not allow mixing the unify i/o and curses i/o.  You still must use
one or the other.

BTW, unify uses their own TERMCAP/UNICAP file, and curses uses
terminfo, so it gets even wierder if you try to mix them.

Somewhere along the line, Unify said they would change their names to
no longer conflict, but to my knowledge they have not done so as of
yet.

=====================================================================
Sydney S. Weinstein, CDP, CCP
Datacomp Systems, Inc.				Voice: (215) 947-9900
{allegra,bellcore,bpa,vu-vlsi}!dsinc!syd	FAX:   (215) 938-0235

allbery@ncoast.UUCP (Brandon Allbery) (01/06/88)

As quoted from <293@dsinc.UUCP> by syd@dsinc.UUCP (Syd Weinstein):
+---------------
| Using this library we have developed many applications using curses
| instead of the unify routines.  We have had no problem at all using
| curses this way and have run into no conflicts so far.  Of course it
| does not allow mixing the unify i/o and curses i/o.  You still must use
| one or the other.
| 
| BTW, unify uses their own TERMCAP/UNICAP file, and curses uses
| terminfo, so it gets even wierder if you try to mix them.
+---------------

I have a library which emulates Unify screen calls in terms of curses calls;
aside from an odd linking command, I've had no problems with it.  Because it
is based on curses, you can freely intermix Unify and curses I/O... but you
cannot call the Unify calls on any window other than stdscr.  My routines are
upwards-compatible with Unify:  you can enable trapping of ^E ^Z ^X as in
ENTER, you can enable shellouts (^P as in "push"), editing within a field,
and there are a series of calls "uptube", "upscrf", etc. which do UPDATES
rather than just input _or_ output as the standard Unify calls do.  (Don't
tell Unify Corp., but you can also enable ^V on fields with explicit relation-
ships and the screen manager will automatically construct a window on the
related record and let you pick a value directly from it.  So much for "zoom
fields"!  ;-)

Also supported on fields are right-justification and case mapping, as well
as being able to display fields in reverse video or underlined on consenting
terminals.

Anyway, it's proof positive that it is possible to combine Unify I/O with
curses/terminfo without any real hassles.
-- 
	      Brandon S. Allbery, Moderator of comp.sources.misc
 {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
PS/2:  Half a computer.    OS/2:  Half an operating system for half a computer.