From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 28056 invoked from network); 8 Oct 1998 08:03:33 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 8 Oct 1998 08:03:33 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id DAA12205 for ; Thu, 8 Oct 1998 03:59:00 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id BAA26854 for axp-list@redhat.com; Thu, 8 Oct 1998 01:58:55 -0600 From: Michal Jaegermann Message-Id: <199810080758.BAA26854@ellpspace.math.ualberta.ca> Subject: patches for RasMol To: axp-list@redhat.com Date: Thu, 8 Oct 1998 01:58:55 -0600 (MDT) Content-Type: text Below are patches for RasMol to behave with an interactive input when used with glibc2. I think that they should also work correctly with older systems (like RH 4.2 on Alpha with glibc 1.99) but they were not tested. They are pretty easy to adjust if this is not the case. In particular I do not know for which versions putting 'struct fd_set' become harmful. If you will get compilation complaints about fd_set then adjust '#define SFDSET' to drop 'struct' from there. All this stuff is NOT Alpha specific. These patches are for release 2.6b2 - the latest one I was able to find. I included also a mod by Jim Paradis which displays a molecule name on a title bar. If you have an older version 2.6, like the one on gatekeeper.dec.com, then patches to rasmol.c still apply although it is possible that you will have to resolve some minor differences by hand. Have clean fun with molecules, Michal diff -ur orig/RasMol-2.6b2/rasmol.c RasMol-2.6b2/rasmol.c --- orig/RasMol-2.6b2/rasmol.c Mon Oct 28 08:39:08 1996 +++ RasMol-2.6b2/rasmol.c Wed Oct 7 19:46:31 1998 @@ -29,6 +29,17 @@ #include "outfile.h" +#ifdef __linux__ +# include +# if __GLIBC__ >= 2 +# define LXGLIBC +# define SFDSET fd_set +# else +# define SFDSET struct fd_set +# endif +#else +#define SFDSET struct fd_set +#endif #ifdef TERMIOS #include @@ -49,7 +60,11 @@ #define TCSETAW TIOCSETAW #define TCGETA TIOCGETA #else +#ifdef LXGLIBC +#include +#else #include +#endif /* LXGLIBC */ #endif /* _CONVEX_SOURCE */ #endif /* __FreeBSD__ */ #endif /* esv */ @@ -109,7 +124,7 @@ #endif #ifdef TERMIOS -#ifdef __FreeBSD__ +#if defined( __FreeBSD__) || defined (LXGLIBC) static struct termios OrigTerm; static struct termios IntrTerm; #else @@ -117,8 +132,8 @@ static struct termio IntrTerm; #endif -static struct fd_set OrigWaitSet; -static struct fd_set WaitSet; +static SFDSET OrigWaitSet; +static SFDSET WaitSet; static struct timeval TimeOut; static int WaitWidth; static int FileNo; @@ -210,8 +225,13 @@ #endif #ifdef TERMIOS - if( isatty(FileNo) ) + if( isatty(FileNo) ) { +#ifndef LXGLIBC ioctl(FileNo, TCSETAW, &OrigTerm); +#else + tcsetattr(FileNo, TCSANOW, &OrigTerm); +#endif + } #endif #ifdef SOCKETS @@ -508,7 +528,12 @@ if( isatty(FileNo) ) - { ioctl(FileNo, TCGETA, &OrigTerm); + { +#ifndef LXGLIBC + ioctl(FileNo, TCGETA, &OrigTerm); +#else + tcgetattr(FileNo, &OrigTerm); +#endif IntrTerm = OrigTerm; IntrTerm.c_iflag |= IGNBRK|IGNPAR; @@ -523,7 +548,11 @@ IntrTerm.c_cc[VSUSP] = 0; #endif +#ifndef LXGLIBC ioctl(FileNo, TCSETAW, &IntrTerm); +#else + tcsetattr(FileNo, TCSANOW, &IntrTerm); +#endif } #endif /* TERMIOS */ @@ -594,8 +623,8 @@ status = select( WaitWidth, (int*)&WaitSet, (int*)NULL, (int*)NULL, &TimeOut ); #else - status = select( WaitWidth, &WaitSet, (struct fd_set*)NULL, - (struct fd_set*)NULL, &TimeOut ); + status = select( WaitWidth, &WaitSet, (SFDSET*)NULL, + (SFDSET*)NULL, &TimeOut ); #endif #ifdef SOCKETS diff -ur orig/RasMol-2.6b2/molecule.c RasMol-2.6b2/molecule.c --- orig/RasMol-2.6b2/molecule.c Mon Oct 28 05:19:31 1996 +++ RasMol-2.6b2/molecule.c Thu Oct 8 01:11:56 1998 @@ -123,6 +123,7 @@ void DescribeMolecule() { char buffer[40]; + extern void SetWindowName(char *); if( CommandActive ) WriteChar('\n'); @@ -132,6 +133,10 @@ { WriteString("Molecule name ....... "); WriteString(Info.moleculename); WriteChar('\n'); + SetWindowName(Info.moleculename); + } + else { + SetWindowName("RasMol Version 2.6b2"); } if( *Info.classification ) diff -ur orig/RasMol-2.6b2/x11win.c RasMol-2.6b2/x11win.c --- orig/RasMol-2.6b2/x11win.c Thu Sep 26 05:22:42 1996 +++ RasMol-2.6b2/x11win.c Thu Oct 8 01:08:57 1998 @@ -1655,6 +1655,10 @@ return( num ); } +void SetWindowName(char *name) +{ + XStoreName(dpy, MainWin, name); +} int CreateImage() {