summaryrefslogtreecommitdiff
path: root/audio/timidity/patches/patch-bb
blob: db4e28c5d1f1612f42c9d85494292b0dd2591196 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
--- motif_c.c.orig	Mon May 20 09:14:09 1996
+++ motif_c.c	Sat Mar  7 13:19:57 1998
@@ -370,15 +370,10 @@
  */
 static int ctl_read(int32 *valp)
 {
-  int num;
-
-  /* We don't wan't to lock on reading  */
-  num=pipe_read_ready(); 
-
-  if (num==0)
-      return RC_NONE;
-  
-  return(ctl_blocking_read(valp));
+    if (pipe_read_ready())
+	return(ctl_blocking_read(valp));
+    else
+	return RC_NONE;
 }
 
 static void ctl_pass_playing_list(int number_of_files, char *list_of_files[])
--- motif_p.c.orig	Mon May 20 09:09:46 1996
+++ motif_p.c	Sat Mar  7 13:22:05 1998
@@ -29,7 +29,11 @@
 #include <stdarg.h>
 #include <sys/ioctl.h>
 #ifdef SOLARIS
-#include <sys/filio.h>
+#include <sys/stropts.h>
+#endif
+#ifdef sgi
+#include <sys/time.h>
+#include <bstring.h>
 #endif
 
 #include "config.h"
@@ -39,6 +43,9 @@
 int pipeAppli[2],pipeMotif[2]; /* Pipe for communication with MOTIF process   */
 int fpip_in, fpip_out;	/* in and out depends in which process we are */
 int pid;	               /* Pid for child process */
+#ifdef sgi
+static fd_set selector;
+#endif
 
 /* DATA VALIDITY CHECK */
 #define INT_CODE 214
@@ -146,7 +153,20 @@
 {
     int num;
     
+#ifdef sgi
+    static struct timeval zero = {0, 0};
+    FD_SET(fpip_in, &selector);
+    num = select(fpip_in + 1, &selector, (fd_set *)0, (fd_set *)0, &zero);
+    if (num < 0)
+	pipe_error("pipe_read_ready");
+    num = FD_ISSET(fpip_in, &selector);
+#else
+#ifdef SOLARIS
+    ioctl(fpip_in,I_NREAD,&num); /* see how many chars in buffer. */
+#else
     ioctl(fpip_in,FIONREAD,&num); /* see how many chars in buffer. */
+#endif
+#endif
     return num;
 }
 
--- output.c.orig	Mon May 20 10:04:54 1996
+++ output.c	Sat Mar  7 13:31:24 1998
@@ -48,6 +48,11 @@
 #define DEFAULT_PLAY_MODE &sun_play_mode
 #endif
 
+#ifdef AU_SGI
+extern PlayMode sgi_play_mode;
+#define DEFAULT_PLAY_MODE &sgi_play_mode
+#endif
+
 #ifdef AU_WIN32
 extern PlayMode win32_play_mode;
 #define DEFAULT_PLAY_MODE &win32_play_mode
--- tk_c.c.orig	Mon May 20 09:14:24 1996
+++ tk_c.c	Sat Mar  7 13:27:08 1998
@@ -17,6 +17,13 @@
 #include <stdarg.h>
 #include <string.h>
 #include <sys/ioctl.h>
+#ifdef SOLARIS
+#include <sys/stropts.h>
+#endif
+#ifdef sgi
+#include <sys/time.h>
+#include <bstring.h>
+#endif
 
 #include "config.h"
 #include "common.h"
@@ -362,15 +369,10 @@
  */
 static int ctl_read(int32 *valp)
 {
-	int num;
-
-	/* We don't wan't to lock on reading  */
-	num=pipe_read_ready(); 
-
-	if (num==0)
-		return RC_NONE;
-  
+    if (pipe_read_ready())
 	return(ctl_blocking_read(valp));
+    else
+	return RC_NONE;
 }
 
 static void ctl_pass_playing_list(int number_of_files, char *list_of_files[])
@@ -439,6 +441,9 @@
 static int pipeAppli[2],pipePanel[2]; /* Pipe for communication with Tcl/Tk process   */
 static int fpip_in, fpip_out;	/* in and out depends in which process we are */
 static int pid;	               /* Pid for child process */
+#ifdef sgi
+static fd_set selector;
+#endif
 
 static void pipe_open()
 {
@@ -477,7 +482,21 @@
 static int pipe_read_ready()
 {
     int num;
+    
+#ifdef sgi
+    static struct timeval zero = {0, 0};
+    FD_SET(fpip_in, &selector);
+    num = select(fpip_in + 1, &selector, (fd_set *)0, (fd_set *)0, &zero);
+    if (num < 0)
+	pipe_error("pipe_read_ready");
+    num = FD_ISSET(fpip_in, &selector);
+#else
+#ifdef SOLARIS
+    ioctl(fpip_in,I_NREAD,&num); /* see how many chars in buffer. */
+#else
     ioctl(fpip_in,FIONREAD,&num); /* see how many chars in buffer. */
+#endif
+#endif
     return num;
 }