home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / radio202 / patch04 < prev    next >
Encoding:
Text File  |  1993-06-03  |  18.7 KB  |  697 lines

  1. Newsgroups: comp.sources.unix
  2. From: guido.van.rossum@cwi.nl (Guido van Rossum)
  3. Subject: v26i240: radio - UDP broadcast/receive utilities for audio data, V2.0, Patch04
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: guido.van.rossum@cwi.nl (Guido van Rossum)
  8. Posting-Number: Volume 26, Issue 240
  9. Archive-Name: radio2.0.2/patch04
  10.  
  11. This is official patch number 4 for radio version 2.0, bringing it up
  12. to patch level 4, or version 2.0.4.  See the blurb a little further
  13. below if you don't know what radio is.
  14.  
  15. Changes in 2.0 patchlevel 4
  16. ---------------------------
  17.  
  18. Fix broken info reply from broadcast (no port was filled in).
  19.  
  20. Made port numbers in info messages from radio/broadcast positive
  21. integers.
  22.  
  23. Some new debug messages in radio.c.
  24.  
  25. Port to HP-UX by Philippe-Andre Prindeville <philipp@res.enst.fr>.
  26. (This uses the raw interface to the hardware.  Philippe-Andre has
  27. tried to use the AAPI library but can't get it to work properly.  If
  28. you think you can get the AAPI version working, let me know and I'll
  29. send you his AAPI patches.)
  30.  
  31. The following improvements are thanks to Andreas Stolcke
  32. <stolcke@ICSI.Berkeley.EDU>:
  33.  
  34. It is now possible to have multiple broadcast processes running on the
  35. same host; the transmission socket is no longer bound to a fixed port
  36. (you may have to zero the control port with -c 0 if your system
  37. doesn't have the SO_REUSEPORT socket option).
  38.  
  39. Radio -r is now implemented by filtering packets based on sender's
  40. address rather than connecting to a fixed port.
  41.  
  42. Fixed integer overflow in broadcast -t after about 35 minutes.
  43.  
  44. Ignore tune requests to invalid port numbers.
  45.  
  46. Fixed unused variable in "bad broadcast address" error message.
  47.  
  48. Let opensock() return -1 on error.
  49.  
  50. ******************
  51. * What is radio? *
  52. ******************
  53.  
  54. If you have a local area network full of workstations with audio
  55. capabilities and at least one FM/AM radio or other audio source, you
  56. can broadcast the audio over the network, and let other users listen
  57. to it.
  58.  
  59. This software works for Sun Sparcs running SunOS 4.0 or 4.1, for SGI
  60. Indigo or Personal IRIS 4D/30 or 4D/35 workstations running SGI IRIX
  61. 4.0 or 3.3.2, NeXT workstations (running version 2.1), DECstations
  62. equipped with DEC lofi, machines running the AudioFile audio server
  63. from DEC CRL, and HP machines with audio hardware.  At CWI, versions
  64. of it have been in continuous use on a mix of Sun and SGI system types
  65. for almost two years; version 1.0 (patchlevel 4) was last tested on a
  66. NeXT.  (I've heard that the program doesn't work on NeXT 3.1; if you
  67. fix it please send me the changes!)
  68.  
  69. Man pages for "radio" and "broadcast" are provided.
  70.  
  71. The implementation continuously transmits UDP broadcast packets of
  72. 1400 bytes each (i.e. less than six per second), which contain the
  73. data in U-LAW format (8000 samples/second, 1 byte/sample,
  74. logarithmically encoded).  On a typical ethernet, this uses about 1
  75. percent of the net available bandwith.  Some loss of UDP packets is
  76. tolerated by the receiving program (this is heard as short
  77. interruptions of the sound).  Every now and then, a short "station
  78. call" packet is transmitted as well, for the benefit of advanced
  79. listening programs.
  80.  
  81. If you missed a part of the posting of radio, you can ftp the whole
  82. source from ftp.cwi.nl [192.16.184.180], file /pub/radio2.0.*.tar.Z,
  83. or from the comp.sources.unix archives.
  84.  
  85. Enjoy,
  86.  
  87. --Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
  88.  
  89. Prereq: 3
  90.  
  91. *** pl3/patchlevel.h    Fri May  7 16:29:01 1993
  92. --- ./patchlevel.h        Mon May 17 10:48:51 1993
  93. ***************
  94. *** 1 ****
  95. ! #define PATCHLEVEL 3
  96. --- 1 ----
  97. ! #define PATCHLEVEL 4
  98. *** pl3/Makefile    Fri May  7 16:28:59 1993
  99. --- ./Makefile    Mon May 10 21:27:11 1993
  100. ***************
  101. *** 27,30 ****
  102.           @echo 'You must use "make sun4.0", "make sun4.1",'
  103. !         @echo '"make next", "make sgi", "make lofi" or'
  104. !         @echo '"make audiofile"'
  105.           exit 1
  106. --- 27,30 ----
  107.           @echo 'You must use "make sun4.0", "make sun4.1",'
  108. !         @echo '"make next", "make sgi", "make hpux",'
  109. !         @echo '"make lofi" or "make audiofile"'
  110.           exit 1
  111. ***************
  112. *** 52,53 ****
  113. --- 52,66 ----
  114.           make all sndulaw
  115. + hpux:        # HPUX 8.07
  116. +         make all 'LIBS=-lX11' \
  117. +             CC="cc -Aa" \
  118. +             CFLAGS="-D_HPUX_SOURCE +e -I/usr/include/X11R4"
  119. + # If you are using the AAPI (Audio Application Programming Interface),
  120. + # use the next 3 lines instead and don't forget to edit radio.h.
  121. + #hpux:        # HPUX 8.07
  122. + #        make all 'LIBS=-lX11' \
  123. + #            CC="cc -Aa" \
  124. + #    CFLAGS="-D_HPUX_SOURCE +e -I/usr/include/Motif1.1 -I/usr/include/X11R4"
  125.   
  126. *** pl3/README    Fri May  7 16:28:59 1993
  127. --- ./README    Tue May 11 16:37:06 1993
  128. ***************
  129. *** 3,5 ****
  130.   
  131. ! This is Radio version 2.0, patchlevel 3 (a.k.a. 2.0.3).
  132.   
  133. --- 3,5 ----
  134.   
  135. ! This is Radio version 2.0, patchlevel 4 (a.k.a. 2.0.4).
  136.   
  137. ***************
  138. *** 13,20 ****
  139.   4.0 or 3.3.2, NeXT workstations (running version 2.1), DECstations
  140. ! equipped with DEC lofi, and machines running the Audio File audio
  141. ! server from DEC CRL.  At CWI, versions of it have been in continuous
  142. ! use on a mix of Sun and SGI system types for almost two years; version
  143. ! 1.0 (patchlevel 4) was last tested on a NeXT.  (I've heard that the
  144. ! program doesn't work on NeXT 3.1; if you fix it please send me the
  145. ! changes!)
  146.   
  147. --- 13,20 ----
  148.   4.0 or 3.3.2, NeXT workstations (running version 2.1), DECstations
  149. ! equipped with DEC lofi, machines running the AudioFile audio server
  150. ! from DEC CRL, and HP machines with audio hardware.  At CWI, versions
  151. ! of it have been in continuous use on a mix of Sun and SGI system types
  152. ! for almost two years; version 1.0 (patchlevel 4) was last tested on a
  153. ! NeXT.  (I've heard that the program doesn't work on NeXT 3.1; if you
  154. ! fix it please send me the changes!)
  155.   
  156. ***************
  157. *** 53,54 ****
  158. --- 53,90 ----
  159.   
  160. + Changes in 2.0 patchlevel 4
  161. + ---------------------------
  162. + Fix broken info reply from broadcast (no port was filled in).
  163. + Made port numbers in info messages from radio/broadcast positive
  164. + integers.
  165. + Some new debug messages in radio.c.
  166. + Port to HP-UX by Philippe-Andre Prindeville <philipp@res.enst.fr>.
  167. + (This uses the raw interface to the hardware.  Philippe-Andre has
  168. + tried to use the AAPI library but can't get it to work properly.  If
  169. + you think you can get the AAPI version working, let me know and I'll
  170. + send you his AAPI patches.)
  171. + The following improvements are thanks to Andreas Stolcke
  172. + <stolcke@ICSI.Berkeley.EDU>:
  173. + It is now possible to have multiple broadcast processes running on the
  174. + same host; the transmission socket is no longer bound to a fixed port
  175. + (you may have to zero the control port with -c 0 if your system
  176. + doesn't have the SO_REUSEPORT socket option).
  177. + Radio -r is now implemented by filtering packets based on sender's
  178. + address rather than connecting to a fixed port.
  179. + Fixed integer overflow in broadcast -t after about 35 minutes.
  180. + Ignore tune requests to invalid port numbers.
  181. + Fixed unused variable in "bad broadcast address" error message.
  182. + Let opensock() return -1 on error.
  183.   Changes in 2.0 patchlevel 3
  184. ***************
  185. *** 61,66 ****
  186.   
  187. ! Radio can now also be used with DEC CRL's AudioFile server or with DEC
  188. ! LoFi hardware (these options require additional software available
  189. ! elsewhere).  When compiled for AudioFile, broadcast can optionally
  190. ! record data directly from the server.
  191.   
  192. --- 97,103 ----
  193.   
  194. ! Thanks to George Neville-Neil, radio can now also be used with DEC
  195. ! CRL's AudioFile server or with DEC LoFi hardware (these options
  196. ! require additional software available elsewhere).  When compiled for
  197. ! AudioFile, broadcast can optionally record data directly from the
  198. ! server.
  199.   
  200. ***************
  201. *** 221,225 ****
  202.   For a DECStation with LoFi hardware, you need to fetch either the LoFi
  203. ! library by <gnn@cs.utwente.nl> or the DEC CRL AudioFile software
  204. ! distribution.  LoFiLib is available for ftp from pegasus.cs.utwente.nl
  205. ! in /pub/audio/libminilofi.tar.Z.  AudioFile is available for ftp from
  206.   crl.dec.com in /pub/DEC/AF/AF2R2.tar.Z.  Also get the patches from the
  207. --- 258,263 ----
  208.   For a DECStation with LoFi hardware, you need to fetch either the LoFi
  209. ! library by George Neville-Neil <gnn@cs.utwente.nl> (based on code by
  210. ! DEC CRL) or the DEC CRL AudioFile software distribution.  LoFiLib is
  211. ! available for ftp from pegasus.cs.utwente.nl in
  212. ! /pub/audio/libminilofi.tar.Z.  AudioFile is available for ftp from
  213.   crl.dec.com in /pub/DEC/AF/AF2R2.tar.Z.  Also get the patches from the
  214. *** pl3/broadcast.c    Fri May  7 16:29:00 1993
  215. --- ./broadcast.c    Tue May 11 16:20:48 1993
  216. ***************
  217. *** 86,87 ****
  218. --- 86,92 ----
  219.   
  220. + #ifdef __hpux
  221. + #include <sys/rtprio.h>
  222. + #include "audio_filehdr.h"        /* borrowed from a Sun */
  223. + #endif
  224.   #ifdef __sgi
  225. ***************
  226. *** 170,172 ****
  227.       sprintf(infostring, "radio:S:%s:%d:%d:%s:%ld:",
  228. !         name, port, transmitting, logfile, age);
  229.       n = strlen(infostring);
  230. --- 175,177 ----
  231.       sprintf(infostring, "radio:S:%s:%d:%d:%s:%ld:",
  232. !         name, 0xffff & port, transmitting, logfile, age);
  233.       n = strlen(infostring);
  234. ***************
  235. *** 199,201 ****
  236.   {
  237. -     char *broadcastaddr = NULL;
  238.       char real_buf[HEADERSIZE + 3 + BUFFERSIZE];
  239. --- 204,205 ----
  240. ***************
  241. *** 309,311 ****
  242.   
  243. !     s = opensock("data", (char *)NULL, SENDPORT, (char *)NULL, 0, 1);
  244.   
  245. --- 313,317 ----
  246.   
  247. !     s = opensock("data", (char *)NULL, 0, (char *)NULL, 0, 1);
  248. !     if (s < 0)
  249. !         exit(1);
  250.   
  251. ***************
  252. *** 316,318 ****
  253.                   "%s: bad broadcast address '%s'\n",
  254. !                 progname, broadcastaddr);
  255.               exit(2);
  256. --- 322,324 ----
  257.                   "%s: bad broadcast address '%s'\n",
  258. !                 progname, DEFMCAST);
  259.               exit(2);
  260. ***************
  261. *** 335,337 ****
  262.                       "%s: bad broadcast address '%s'\n",
  263. !                     progname, broadcastaddr);
  264.                   exit(2);
  265. --- 341,343 ----
  266.                       "%s: bad broadcast address '%s'\n",
  267. !                     progname, argv[optind]);
  268.                   exit(2);
  269. ***************
  270. *** 356,357 ****
  271. --- 362,365 ----
  272.       ctls = opensock("control", (char *)NULL, ctlport, (char *)NULL, 0, 0);
  273. +     if (ctls < 0)
  274. +         exit(1);
  275.   
  276. ***************
  277. *** 368,369 ****
  278. --- 376,381 ----
  279.   #endif
  280. + #ifdef __hpux
  281. +             Audio_filehdr hp;
  282. +             fread((char *) &hp, sizeof(Audio_filehdr), 1, stdin);
  283. + #endif
  284.           }
  285. ***************
  286. *** 372,373 ****
  287. --- 384,390 ----
  288.   
  289. + #ifdef    __hpux
  290. +     n = rtprio(0, 50);
  291. +     if (n == -1) perror("rtprio");
  292. + #endif
  293.       real_buf[0] = AUDIO_TYPE;
  294. ***************
  295. *** 514,516 ****
  296.                       strncmp(buf, "radio:s", 7) == 0) {
  297. !                     sendinfo(ctls, &ctlsin, ctlsinsize);
  298.                   }
  299. --- 531,534 ----
  300.                       strncmp(buf, "radio:s", 7) == 0) {
  301. !                     sendinfo(ctls, &ctlsin, ctlsinsize,
  302. !                          dftport);
  303.                   }
  304. ***************
  305. *** 570,574 ****
  306.   
  307. !     tsleep =  ((double) bytes/(double) rate) * 1000000
  308. !         - ((tnow.tv_sec - tstart.tv_sec) * 1000000
  309. !                     + tnow.tv_usec - tstart.tv_usec);
  310.       if (tsleep > 0) {
  311. --- 588,592 ----
  312.   
  313. !     tsleep =  ((double) bytes/(double) rate
  314. !                - (tnow.tv_sec - tstart.tv_sec)) * 1000000
  315. !               + (tnow.tv_usec - tstart.tv_usec);
  316.       if (tsleep > 0) {
  317. *** pl3/broadcast.man    Fri May  7 16:29:00 1993
  318. --- ./broadcast.man    Mon May 10 10:20:36 1993
  319. ***************
  320. *** 56,58 ****
  321.   packets through.
  322. ! Each transmission station should run on a different host though.
  323.   .SH OPTIONS
  324. --- 56,60 ----
  325.   packets through.
  326. ! Multiple transmission stations may reside on the same host, but on some
  327. ! systems they need to have different control ports specified with the
  328. ! \-c option.
  329.   .SH OPTIONS
  330. ***************
  331. *** 86,90 ****
  332.   Note that this option only has an effect if your machine supports multicasts
  333. ! and you specify a multicast address with the 
  334. ! .B \-b
  335. ! option.
  336.   .TP 10
  337. --- 88,91 ----
  338.   Note that this option only has an effect if your machine supports multicasts
  339. ! and you specify a multicast address to send to (or the default is a
  340. ! multicast address).
  341.   .TP 10
  342. *** pl3/radio.c    Fri May  7 16:29:02 1993
  343. --- ./radio.c    Tue May 11 16:40:00 1993
  344. ***************
  345. *** 103,104 ****
  346. --- 103,117 ----
  347.   #endif /* USE_SUN */
  348. + #ifdef USE_HP
  349. + #include <netinet/tcp.h>
  350. + #include <sys/audio.h>
  351. + int        one = 1;
  352. + int        interruptable = 1;
  353. + long        status;
  354. + int        external = 0;
  355. + FILE        *astream = NULL, *wstream = NULL;
  356. + #undef        index
  357. + #endif /* USE_HP */
  358.     
  359. ***************
  360. *** 172,174 ****
  361.       int s, ctls, curs;
  362. !     struct sockaddr from;
  363.       int fromlen;
  364. --- 185,187 ----
  365.       int s, ctls, curs;
  366. !     struct sockaddr_in from;
  367.       int fromlen;
  368. ***************
  369. *** 182,183 ****
  370. --- 195,197 ----
  371.       char *remotename = (char *) NULL;
  372. +     struct sockaddr_in remoteaddr;
  373.       struct timeval timeout;
  374. ***************
  375. *** 185,186 ****
  376. --- 199,203 ----
  377.       struct adpcm_state state;
  378. + #ifdef USE_HP
  379. +     int        pcnt;
  380. + #endif /* USE_HP */
  381.   #ifdef USE_AL
  382. ***************
  383. *** 207,209 ****
  384.   /* Always change these two macros and the following switch together! */
  385. ! #define OPTIONS "c:dfl:m:np:r:stv:"
  386.   #define USAGE "usage: %s [options]\n\
  387. --- 224,226 ----
  388.   /* Always change these two macros and the following switch together! */
  389. ! #define OPTIONS "c:dfl:m:np:r:stv:x"
  390.   #define USAGE "usage: %s [options]\n\
  391. ***************
  392. *** 243,244 ****
  393. --- 260,267 ----
  394.               remotename = optarg;
  395. +             if (setipaddr(remotename, &remoteaddr) < 0) {
  396. +                 fprintf(stderr,
  397. +                     "radio: %s: bad remote name\n",
  398. +                     remotename);
  399. +                 exit(2);
  400. +             }
  401.               break;
  402. ***************
  403. *** 255,257 ****
  404.           case 'n':
  405. ! #ifdef USE_SUN
  406.               interruptable = 0;
  407. --- 278,280 ----
  408.           case 'n':
  409. ! #if defined(USE_SUN) || defined(USE_HP)
  410.               interruptable = 0;
  411. ***************
  412. *** 275,276 ****
  413. --- 298,305 ----
  414.               break;
  415. +         case 'x':
  416. + #if defined(USE_HP)
  417. +             external = -1;
  418. + #else
  419. +             fprintf(stderr, "(-x not supported here)\n");
  420. + #endif
  421.           }
  422. ***************
  423. *** 303,306 ****
  424.           ctls = -1;
  425.   
  426. -     s = opensock("data", localname, receiveport, remotename, SENDPORT, 0);
  427.   #ifdef HAVE_MCAST
  428. --- 332,337 ----
  429.           ctls = -1;
  430. +     s = opensock("data", localname, receiveport, (char *)NULL, 0, 0);
  431. +     if (s < 0)
  432. +         exit(1);
  433.   
  434.   #ifdef HAVE_MCAST
  435. ***************
  436. *** 313,314 ****
  437. --- 344,348 ----
  438.       packetcount = 0;
  439. + #ifdef USE_HP
  440. +     pcnt = 0;
  441. + #endif
  442.   
  443. ***************
  444. *** 321,323 ****
  445.               FD_ZERO(&inputset);
  446. !             FD_SET(s, &inputset);
  447.               if (ctls >= 0)
  448. --- 355,358 ----
  449.               FD_ZERO(&inputset);
  450. !             if (s >= 0)
  451. !                 FD_SET(s, &inputset);
  452.               if (ctls >= 0)
  453. ***************
  454. *** 347,349 ****
  455.           n = recvfrom(curs, buf, HEADERSIZE + BUFFERSIZE, 0,
  456. !                  &from, &fromlen);
  457.           if (n <= 0) {
  458. --- 382,384 ----
  459.           n = recvfrom(curs, buf, HEADERSIZE + BUFFERSIZE, 0,
  460. !                  (struct stockaddr *)&from, &fromlen);
  461.           if (n <= 0) {
  462. ***************
  463. *** 369,371 ****
  464.                   if (pdebug)
  465. !                     fprintf(stderr, "control packet\n");
  466.                   switch(buf[6]) {
  467. --- 404,407 ----
  468.                   if (pdebug)
  469. !                     fprintf(stderr,
  470. !                         "control packet: '%s'\n", buf);
  471.                   switch(buf[6]) {
  472. ***************
  473. *** 377,381 ****
  474.                   case 'S':    /* Status from broadcast */
  475. -                     if (pdebug)
  476. -                         fprintf(stderr,
  477. -                             "Status %s\n", buf);
  478.                       break;
  479. --- 413,414 ----
  480. ***************
  481. *** 396,400 ****
  482.                       close(s);
  483. !                     s = opensock("new data", localname,
  484. !                              receiveport, remotename,
  485. !                              SENDPORT, 0);
  486.   #ifdef HAVE_MCAST
  487. --- 429,439 ----
  488.                       close(s);
  489. !                     s = opensock("new data",
  490. !                                  localname, receiveport,
  491. !                                  (char *)NULL, 0, 0);
  492. !                     /*
  493. !                      * ignore ports that we cannot reveive
  494. !                      * on (e.g., because of permissions).
  495. !                      */
  496. !                     if (s < 0)
  497. !                         break;
  498.   #ifdef HAVE_MCAST
  499. ***************
  500. *** 408,411 ****
  501.                       sprintf(buf, "radio:I:%d:%d:%s.%d",
  502. !                         !pausing, receiveport,
  503.                           VERSION, PATCHLEVEL);
  504.                       sendto(curs, buf, strlen(buf), 0,
  505. --- 447,454 ----
  506.                       sprintf(buf, "radio:I:%d:%d:%s.%d",
  507. !                         !pausing, 0xffff&receiveport,
  508.                           VERSION, PATCHLEVEL);
  509. +                     if (pdebug)
  510. +                         fprintf(stderr,
  511. +                             "sending info '%s'\n",
  512. +                             buf);
  513.                       sendto(curs, buf, strlen(buf), 0,
  514. ***************
  515. *** 441,443 ****
  516.           }
  517. !         else if (!pausing) {
  518.               encoding = PCM_64;
  519. --- 484,492 ----
  520.           }
  521. !         else if (!pausing &&
  522. !              /*
  523. !               * filter out any packets we're not interested in
  524. !               */
  525. !              (!remotename ||
  526. !               from.sin_addr.s_addr == remoteaddr.sin_addr.s_addr)) 
  527. {
  528.               encoding = PCM_64;
  529. ***************
  530. *** 577,578 ****
  531. --- 626,640 ----
  532.   #endif /* USE_AF */
  533. + #ifdef USE_HP
  534. +             if (!filter) {
  535. +                 ++pcnt;
  536. +                 if (fwrite(buf, 1, n, wstream) != n) {
  537. +                     perror("fwrite wstream");
  538. +                     break;
  539. +                 }
  540. +                 if (pcnt == PCKWIN) {
  541. +                     fclose(wstream);
  542. +                     wstream = astream;
  543. +                 }
  544. +             }
  545. + #endif /* USE_HP */
  546.               if (filter || tee) {
  547. ***************
  548. *** 656,658 ****
  549.   
  550.   #ifdef USE_SUN
  551. --- 718,719 ----
  552. ***************
  553. *** 725,727 ****
  554. --- 786,830 ----
  555.   
  556.   #endif /* USE_SUN */
  557. + #ifdef USE_HP
  558. + void open_speaker()
  559. + {    
  560. +     struct audio_gains ag;
  561. +     int        streamSocket;
  562. +     long        gain;
  563. +     char        buf[80];
  564. +     char        *p;
  565. +     p = (external ? "/dev/audioEU" : "/dev/audioIU");
  566. +     astream = fopen(p, "w");
  567. +     if (astream == NULL) {
  568. +         perror("fopen: /dev/audioIU");
  569. +         exit(1);
  570. +     }
  571. +     if (volume >= 0) {        /* user has specified a volume... */
  572. +         if (ioctl(fileno(astream), AUDIO_GET_GAINS, &ag) < 0)
  573. +             perror("ioctl: AUDIO_GET_GAINS");
  574. +         ag.transmit_gain = ((volume *
  575. +                      (AUDIO_MAX_GAIN - AUDIO_OFF_GAIN))
  576. +                     / 100) + AUDIO_OFF_GAIN;
  577. +         if (ioctl(fileno(astream), AUDIO_SET_GAINS, &ag) < 0)
  578. +             perror("ioctl: AUDIO_SET_GAINS");
  579. +     }
  580. +     wstream = fdopen(dup(fileno(astream)), "w");
  581. +     setvbuf(astream, NULL, _IONBF, 0);
  582. +     setvbuf(wstream, NULL, _IOFBF, BUFFERSIZE * PCKWIN);
  583. + }
  584. + void close_speaker()
  585. + {
  586. +     fclose(astream);
  587. + }
  588. + #endif /* USE_HP */
  589.   
  590. *** pl3/radio.h    Fri May  7 16:29:02 1993
  591. --- ./radio.h    Mon May 10 21:30:44 1993
  592. ***************
  593. *** 29,31 ****
  594.   #define RCVPORT            54321
  595. - #define SENDPORT        54318
  596.   #define INFOPORT        54317
  597. --- 29,30 ----
  598. ***************
  599. *** 75,76 ****
  600. --- 74,82 ----
  601.   #define USE_NX
  602. + #endif
  603. + #ifdef    __hpux
  604. + #define    USE_HP
  605. + /* #define UseAAPI */        /* No good */
  606. + #define    CHECK_X_SERVER
  607. + #define    PCKWIN        5
  608.   #endif
  609. *** pl3/radio.man    Fri May  7 16:29:02 1993
  610. --- ./radio.man    Sat May  8 23:13:39 1993
  611. ***************
  612. *** 85,89 ****
  613.   Multicast group.
  614. ! This only makes sense if the same multicast group is passed to the
  615. ! .B \-b
  616. ! option of
  617.   .IR broadcast (1).
  618. --- 85,87 ----
  619.   Multicast group.
  620. ! This only makes sense if the same multicast group is passed as address to
  621.   .IR broadcast (1).
  622. *** pl3/socklib.c    Fri May  7 16:29:03 1993
  623. --- ./socklib.c    Mon May 10 09:44:07 1993
  624. ***************
  625. *** 54,56 ****
  626.           perror(desc);
  627. !         exit(1);
  628.       }
  629. --- 54,56 ----
  630.           perror(desc);
  631. !         return -1;
  632.       }
  633. ***************
  634. *** 81,83 ****
  635.           perror(desc);
  636. !         exit(1);
  637.       }
  638. --- 81,84 ----
  639.           perror(desc);
  640. !         close(s);
  641. !         return -1;
  642.       }
  643. ***************
  644. *** 92,94 ****
  645.               perror(desc);
  646. !             exit(1);
  647.           }
  648. --- 93,96 ----
  649.               perror(desc);
  650. !             close(s);
  651. !             return -1;
  652.           }
  653. ***************
  654. *** 102,104 ****
  655.               perror(desc);
  656. !             exit(1);
  657.           }
  658. --- 104,107 ----
  659.               perror(desc);
  660. !             close(s);
  661. !             return -1;
  662.           }
  663.