* patches for RasMol
@ 1998-10-08 7:58 Michal Jaegermann
1998-10-08 8:02 ` Roman Martonak
0 siblings, 1 reply; 2+ messages in thread
From: Michal Jaegermann @ 1998-10-08 7:58 UTC (permalink / raw)
To: axp-list
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 <features.h>
+# 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 <sys/types.h>
@@ -49,7 +60,11 @@
#define TCSETAW TIOCSETAW
#define TCGETA TIOCGETA
#else
+#ifdef LXGLIBC
+#include <termios.h>
+#else
#include <sys/termio.h>
+#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()
{
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: patches for RasMol
1998-10-08 7:58 patches for RasMol Michal Jaegermann
@ 1998-10-08 8:02 ` Roman Martonak
0 siblings, 0 replies; 2+ messages in thread
From: Roman Martonak @ 1998-10-08 8:02 UTC (permalink / raw)
To: axp-list
Thanks a lot, I hope to have cleaner fun with molecules (in fact, clusters) now.
Best regards,
Roman Martonak.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-10-08 8:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-10-08 7:58 patches for RasMol Michal Jaegermann
1998-10-08 8:02 ` Roman Martonak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox