home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / rzsz_3_24_3_src.lzh / rbsb.c < prev    next >
Text File  |  1993-11-04  |  14KB  |  735 lines

  1. /*
  2.  *    V7/BSD HACKERS:  SEE NOTES UNDER mode(2) !!!
  3.  *
  4.  *   This file is #included so the main file can set parameters such as HOWMANY.
  5.  *   See the main files (rz.c/sz.c) for compile instructions.
  6.  */
  7.  
  8. char *Copyr = "Copyright 1993 Omen Technology Inc All Rights Reserved";
  9.  
  10. #ifdef OS9
  11. #include <stdio.h>
  12. #include <sgstat.h>
  13. #include <errno.h>
  14. #include "os9.h"
  15. /* from rz.c/sz.c */
  16. extern int Baudrate;
  17. extern int Effbaud;
  18. extern int Zmodem;
  19. extern int errors;
  20. #endif
  21.  
  22. #ifdef V7
  23. #include <sys/types.h>
  24. #include <sys/stat.h>
  25. #define STAT
  26. #include <sgtty.h>
  27. #define OS "V7/BSD"
  28. #ifdef LLITOUT
  29. long Locmode;        /* Saved "local mode" for 4.x BSD "new driver" */
  30. long Locbit = LLITOUT;    /* Bit SUPPOSED to disable output translations */
  31. #include <strings.h>
  32. #endif
  33. #endif
  34.  
  35. #ifdef USG
  36. #include <sys/types.h>
  37. #include <sys/stat.h>
  38. #define STAT
  39. #include <termio.h>
  40. #define OS "SYS III/V"
  41. #define MODE2OK
  42. #include <string.h>
  43. #endif
  44.  
  45. #ifdef POSIX
  46. #define USG
  47. #include <sys/types.h>
  48. #include <sys/stat.h>
  49. #include <sys/ioctl.h>
  50. #define STAT
  51. #include <termios.h>
  52. #define OS "POSIX"
  53. #include <string.h>
  54. #ifndef READCHECK
  55. #ifndef FIONREAD
  56. #define SV
  57. #endif
  58. #endif
  59. #endif
  60.  
  61.  
  62. #ifdef T6K
  63. #include <sys/ioctl.h>        /* JPRadley: for the Tandy 6000 */
  64. #endif
  65.  
  66. #include <setjmp.h>
  67.  
  68. /*
  69. #if HOWMANY  > 255
  70. Howmany must be 255 or less
  71. #endif
  72. */
  73.  
  74.  /*
  75.  *  Some systems (Venix, Coherent, Regulus) may not support tty raw mode
  76.  *  read(2) the same way as Unix. ONEREAD must be defined to force one
  77.  *  character reads for these systems. Added 7-01-84 CAF
  78.  */
  79.  
  80. #ifndef OS9
  81. #define sendline(c) putc(c & 0377, Ttystream)
  82. #define xsendline(c) putc(c, Ttystream)
  83. #endif
  84.  
  85. FILE *Ttystream;
  86. int Tty;
  87. char linbuf[HOWMANY];
  88. char xXbuf[BUFSIZ];
  89. int Lleft=0;        /* number of characters in linbuf */
  90. jmp_buf tohere;        /* For the interrupt on RX timeout */
  91. #ifdef ONEREAD
  92. /* Sorry, Regulus and some others don't work right in raw mode! */
  93. int Readnum = 1;    /* Number of bytes to ask for in read() from modem */
  94. #else
  95. int Readnum = HOWMANY;    /* Number of bytes to ask for in read() from modem */
  96. #endif
  97. int Verbose=0;
  98.  
  99.  
  100. int Twostop;        /* Use two stop bits */
  101.  
  102.  
  103. /*
  104.  *  The following uses an external rdchk() routine if available,
  105.  *  otherwise defines the function for BSD or fakes it for SYSV.
  106.  */
  107.  
  108. #ifdef OS9
  109. rdchk(f)
  110. {
  111.     return((_gs_rdy(f) > 0) ? 1 : 0);
  112. }
  113. #else /* !OS9 */
  114. #ifndef READCHECK
  115. #ifdef FIONREAD
  116. #define READCHECK
  117. /*
  118.  *  Return non 0 iff something to read from io descriptor f
  119.  */
  120. rdchk(f)
  121. {
  122.     static long lf;
  123.  
  124.     ioctl(f, FIONREAD, &lf);
  125.     return ((int) lf);
  126. }
  127.  
  128. #else        /* FIONREAD */
  129.  
  130. #ifdef SV
  131. #define READCHECK
  132. #include <fcntl.h>
  133.  
  134. int checked = 0;
  135. /*
  136.  * Nonblocking I/O is a bit different in System V, Release 2
  137.  *  Note: this rdchk vsn throws away a byte, OK for ZMODEM
  138.  *  sender because protocol design anticipates this problem.
  139.  */
  140. #define EATSIT
  141. rdchk(f)
  142. {
  143.     int lf, savestat;
  144.     static char bchecked;
  145.  
  146.     savestat = fcntl(f, F_GETFL) ;
  147.     fcntl(f, F_SETFL, savestat | O_NONBLOCK) ;
  148.     lf = read(f, &bchecked, 1) ;
  149.     fcntl(f, F_SETFL, savestat) ;
  150.     checked = bchecked & 0377;    /* force unsigned byte */
  151.     return(lf) ;
  152. }
  153. #endif
  154. #endif
  155. #endif
  156. #endif /* !OS9 */
  157.  
  158.  
  159. #ifdef OS9
  160. #ifdef m6809
  161. int speeds[] = {
  162.     110,
  163.     300,
  164.     600,
  165.     1200,
  166.     2400,
  167.     4800,
  168.     9600,
  169.     19200,
  170.     0,
  171. };
  172. #else
  173. int speeds[] = {
  174.     50,
  175.     75,
  176.     110,
  177.     134,
  178.     150,
  179.     300,
  180.     600,
  181.     1200,
  182.     1800,
  183.     2400,
  184.     2000,
  185.     3600,
  186.     4800,
  187.     7200,
  188.     9600,
  189.     19200,
  190.     38400,
  191.     0,
  192. };
  193. #endif
  194. #else /* !OS9 */
  195. struct {
  196.     unsigned baudr;
  197.     int speedcode;
  198. } speeds[] = {
  199.     110,    B110,
  200. #ifdef B150
  201.     150,    B150,
  202. #endif
  203.     300,    B300,
  204.     600,    B600,
  205.     1200,    B1200,
  206.     2400,    B2400,
  207.     4800,    B4800,
  208.     9600,    B9600,
  209. #ifdef B19200
  210.     19200,    B19200,
  211. #endif
  212. #ifdef EXTA
  213.     19200,    EXTA,
  214. #endif
  215. #ifdef B38400
  216.     38400,    B38400,
  217. #endif
  218. #ifdef EXTB
  219.     38400,    EXTB,
  220. #endif
  221.     0,    0
  222. };
  223. #endif /* !OS9 */
  224.  
  225. static unsigned
  226. getspeed(code)
  227. {
  228. #ifdef OS9
  229.     return(speeds[code]);
  230. #else
  231.     register n;
  232.  
  233.     for (n=0; speeds[n].baudr; ++n)
  234.         if (speeds[n].speedcode == code)
  235.             return speeds[n].baudr;
  236.     if (code > 49)
  237.         return ((unsigned)code);
  238.     return 1;    /* Assume fifo if ioctl failed */
  239. #endif
  240. }
  241.  
  242.  
  243.  
  244. #ifdef OS9
  245. struct sgbuf oldtty, tty;
  246. #else /* !OS9 */
  247. #ifdef ICANON
  248. #ifdef POSIX
  249. struct termios oldtty, tty;
  250. #else
  251. struct termio oldtty, tty;
  252. #endif
  253. #else
  254. struct sgttyb oldtty, tty;
  255. struct tchars oldtch, tch;
  256. #endif
  257. #endif /* !OS9 */
  258.  
  259. /*
  260.  * mode(n)
  261.  *  3: save old tty stat, set raw mode with flow control
  262.  *  2: set XON/XOFF for sb/sz with ZMODEM or YMODEM-g
  263.  *  1: save old tty stat, set raw mode 
  264.  *  0: restore original tty mode
  265.  */
  266. mode(n)
  267. {
  268.     static did0 = FALSE;
  269.  
  270.     vfile("mode:%d", n);
  271.     switch(n) {
  272. #ifdef OS9
  273.     case 1:
  274.     case 2:
  275.     case 3:
  276.         if(!did0)
  277.             _gs_opt(Tty, &oldtty);
  278. #ifdef m6809
  279.         _strass(&tty, &oldtty, sizeof(struct sgbuf));
  280. #else
  281.         tty = oldtty;
  282. #endif
  283.                 tty.sg_case             =
  284.                 tty.sg_backsp           =
  285.                 tty.sg_delete           =
  286.                 tty.sg_echo             =
  287.                 tty.sg_alf              =
  288.                 tty.sg_nulls            =
  289.                 tty.sg_pause            =
  290.                 tty.sg_page             =
  291.                 tty.sg_bspch            =
  292.                 tty.sg_dlnch            =
  293.                 tty.sg_eorch            =
  294.                 tty.sg_eofch            =
  295.                 tty.sg_rlnch            =
  296.                 tty.sg_dulnch           =
  297.                 tty.sg_psch             =
  298.                 tty.sg_kbach            =
  299.                 tty.sg_bsech            =
  300.                 tty.sg_bellch           =0;
  301.         if (n == 2)
  302.             tty.sg_kbich    = Zmodem ? 0 : 030;
  303.         else
  304.             tty.sg_kbich    =0;
  305.                 tty.sg_parity           &= 0x9f;    /* No parity */
  306. #ifdef m6809
  307.         if(n == 3)
  308.                     tty.sg_parity   |= 0x02;    /*Set hardware flow control */
  309. #else
  310.         if(n == 3)
  311.                     tty.sg_parity   |= 0x80;    /*Set hardware flow control */
  312. #endif
  313.                 tty.sg_baud             &= 0x1f;    /* 8 bits, 1 stop */
  314.                 if(Twostop)
  315.                         tty.sg_baud     |= 0x80;    /* Set 2 stop */
  316. #ifdef MODE2OK
  317.         if (n == 2)
  318.         {
  319.             tty.sg_xon = 11;
  320.                     tty.sg_xoff = 13;
  321.         }
  322.         else
  323. #endif
  324.         {
  325.             tty.sg_xon = 0;
  326.             tty.sg_xoff = 0;
  327.         }
  328.  
  329.  
  330.                 _ss_opt(Tty, &tty);
  331.                 _ss_opt(fileno(Ttystream), &tty);
  332.                 did0 = TRUE;
  333. #ifdef m6809
  334.                 Effbaud = Baudrate = getspeed(tty.sg_baud & 0x0F);
  335. #else
  336.                 Effbaud = Baudrate = getspeed(tty.sg_baud & 0x1F);
  337. #endif
  338.         vfile("Baudrate = %d\n", Baudrate);
  339.                 return( OK );
  340. #endif /* OS9 */
  341.  
  342. #ifdef USG
  343.     case 2:        /* Un-raw mode used by sz, sb when -g detected */
  344. #ifdef POSIX
  345.         if(!did0)
  346.             (void) tcgetattr(Tty, &oldtty);
  347. #else
  348.         if(!did0)
  349.             (void) ioctl(Tty, TCGETA, &oldtty);
  350. #endif
  351.         tty = oldtty;
  352.  
  353.         tty.c_iflag = BRKINT|IXON;
  354.  
  355.         tty.c_oflag = 0;    /* Transparent output */
  356.  
  357.         tty.c_cflag &= ~(PARENB|CSIZE);        /* Disable parity */
  358.         tty.c_cflag |= (CREAD|CS8);    /* Set character size = 8 */
  359.         if (Twostop)
  360.             tty.c_cflag |= CSTOPB;    /* Set two stop bits */
  361.  
  362.  
  363. #ifdef READCHECK
  364.         tty.c_lflag = Zmodem ? 0 : ISIG;
  365.         tty.c_cc[VINTR] = Zmodem ? -1:030;    /* Interrupt char */
  366. #else
  367.         tty.c_lflag = ISIG;
  368.         tty.c_cc[VINTR] = Zmodem ? 03:030;    /* Interrupt char */
  369. #endif
  370.         tty.c_cc[VQUIT] = -1;            /* Quit char */
  371. #ifdef NFGVMIN
  372.         tty.c_cc[VMIN] = 1;
  373. #else
  374.         tty.c_cc[VMIN] = 3;     /* This many chars satisfies reads */
  375. #endif
  376.         tty.c_cc[VTIME] = 1;    /* or in this many tenths of seconds */
  377.  
  378. #ifdef POSIX
  379.         (void) tcsetattr(Tty, TCSADRAIN, &tty);
  380. #else
  381.         (void) ioctl(Tty, TCSETAW, &tty);
  382. #endif
  383.         did0 = TRUE;
  384.         return OK;
  385.     case 1:
  386.     case 3:
  387. #ifdef POSIX
  388.         if(!did0)
  389.             (void) tcgetattr(Tty, &oldtty);
  390. #else
  391.         if(!did0)
  392.             (void) ioctl(Tty, TCGETA, &oldtty);
  393. #endif
  394.         tty = oldtty;
  395.  
  396.         tty.c_iflag = n==3 ? (IXON|IXOFF) : IXOFF;
  397.  
  398.         tty.c_lflag = 0;
  399.  
  400.         tty.c_oflag = 0;
  401.  
  402.         tty.c_cflag &= ~(CSIZE|PARENB);    /* disable parity */
  403.         tty.c_cflag |= CS8;    /* Set character size = 8 */
  404.         if (Twostop)
  405.             tty.c_cflag |= CSTOPB;    /* Set two stop bits */
  406. #ifdef NFGVMIN
  407.         tty.c_cc[VMIN] = 1; /* This many chars satisfies reads */
  408. #else
  409.         tty.c_cc[VMIN] = HOWMANY; /* This many chars satisfies reads */
  410. #endif
  411.         tty.c_cc[VTIME] = 1;    /* or in this many tenths of seconds */
  412. #ifdef POSIX
  413.         (void) tcsetattr(Tty, TCSADRAIN, &tty);
  414. #else
  415.         (void) ioctl(Tty, TCSETAW, &tty);
  416. #endif
  417.         did0 = TRUE;
  418. #ifdef POSIX
  419.         Effbaud = Baudrate = getspeed(cfgetospeed(&tty));
  420. #else
  421.         Effbaud = Baudrate = getspeed(tty.c_cflag & CBAUD);
  422. #endif
  423.         vfile("Baudrate = %u\n", Baudrate);
  424.         return OK;
  425. #endif
  426. #ifdef V7
  427.     /*
  428.      *  NOTE: this should transmit all 8 bits and at the same time
  429.      *   respond to XOFF/XON flow control.  If no FIONREAD or other
  430.      *   rdchk() alternative, also must respond to INTRRUPT char
  431.      *   This doesn't work with V7.  It should work with LLITOUT,
  432.      *   but LLITOUT was broken on the machine I tried it on.
  433.      */
  434.     case 2:        /* Un-raw mode used by sz, sb when -g detected */
  435.         if(!did0) {
  436.             ioctl(Tty, TIOCEXCL, 0);
  437.             ioctl(Tty, TIOCGETP, &oldtty);
  438.             ioctl(Tty, TIOCGETC, &oldtch);
  439. #ifdef LLITOUT
  440.             ioctl(Tty, TIOCLGET, &Locmode);
  441. #endif
  442.         }
  443.         tty = oldtty;
  444.         tch = oldtch;
  445. #ifdef READCHECK
  446.         tch.t_intrc = Zmodem ? -1:030;    /* Interrupt char */
  447. #else
  448.         tch.t_intrc = Zmodem ? 03:030;    /* Interrupt char */
  449. #endif
  450.         tty.sg_flags |= (ODDP|EVENP|CBREAK);
  451.         tty.sg_flags &= ~(ALLDELAY|CRMOD|ECHO|LCASE);
  452.         ioctl(Tty, TIOCSETP, &tty);
  453.         ioctl(Tty, TIOCSETC, &tch);
  454. #ifdef LLITOUT
  455.         ioctl(Tty, TIOCLBIS, &Locbit);
  456. #else
  457.         bibi(99);    /* un-raw doesn't work w/o lit out */
  458. #endif
  459.         did0 = TRUE;
  460.         return OK;
  461.     case 1:
  462.     case 3:
  463.         if(!did0) {
  464.             ioctl(Tty, TIOCEXCL, 0);
  465.             ioctl(Tty, TIOCGETP, &oldtty);
  466.             ioctl(Tty, TIOCGETC, &oldtch);
  467. #ifdef LLITOUT
  468.             ioctl(Tty, TIOCLGET, &Locmode);
  469. #endif
  470.         }
  471.         tty = oldtty;
  472.         tty.sg_flags |= (RAW|TANDEM);
  473.         tty.sg_flags &= ~ECHO;
  474.         ioctl(Tty, TIOCSETP, &tty);
  475.         did0 = TRUE;
  476.         Effbaud = Baudrate = getspeed(tty.sg_ospeed);
  477.         return OK;
  478. #endif
  479.     case 0:
  480.         if(!did0)
  481.             return ERROR;
  482. #ifdef OS9
  483.         fflush(Ttystream);
  484.         purgeline();
  485.         _ss_opt(Tty, &oldtty);
  486.         _ss_opt(fileno(Ttystream), &oldtty);
  487. #endif /* OS9 */
  488. #ifdef USG
  489. #ifdef POSIX
  490.         (void) tcdrain(Tty);    /* Wait for output to drain */
  491.         (void) tcflush(Tty, TCIFLUSH);    /* Flush input queue */
  492.         (void) tcsetattr(Tty, TCSADRAIN, &oldtty);    /* Restore */
  493.         (void) tcflow(Tty, TCOON);    /* Restart output */
  494. #else
  495.         (void) ioctl(Tty, TCSBRK, 1);    /* Wait for output to drain */
  496.         (void) ioctl(Tty, TCFLSH, 1);    /* Flush input queue */
  497.         (void) ioctl(Tty, TCSETAW, &oldtty);    /* Restore modes */
  498.         (void) ioctl(Tty, TCXONC,1);    /* Restart output */
  499. #endif
  500. #endif
  501. #ifdef V7
  502.         ioctl(Tty, TIOCSETP, &oldtty);
  503.         ioctl(Tty, TIOCSETC, &oldtch);
  504.         ioctl(Tty, TIOCNXCL, 0);
  505. #ifdef LLITOUT
  506.         ioctl(Tty, TIOCLSET, &Locmode);
  507. #endif
  508. #endif
  509.  
  510.         return OK;
  511.     default:
  512.         return ERROR;
  513.     }
  514. }
  515.  
  516. sendbrk()
  517. {
  518. #ifdef OS9
  519.     _ss_sbreak(fileno(Ttystream));
  520. #endif /* OS9 */
  521. #ifdef V7
  522. #ifdef TIOCSBRK
  523. #define CANBREAK
  524.     sleep(1);
  525.     ioctl(Tty, TIOCSBRK, 0);
  526.     sleep(1);
  527.     ioctl(Tty, TIOCCBRK, 0);
  528. #endif
  529. #endif
  530. #ifdef USG
  531. #define CANBREAK
  532. #ifdef POSIX
  533.     tcsendbreak(Tty, 200);
  534. #else
  535.     ioctl(Tty, TCSBRK, 0);
  536. #endif
  537. #endif
  538. }
  539.  
  540. /* Initialize tty device for serial file xfer */
  541. inittty()
  542. {
  543. #ifdef OS9
  544.     char mpath[35];
  545.     char tmppath[35];
  546.  
  547.         strcpy(mpath,"/");
  548.         _gs_devn(0,tmppath);
  549.     strcat(mpath, tmppath);
  550.         Tty = open(mpath,3);
  551.     if (Tty < 0) {
  552.         fprintf(stderr," - Error #%d\n" , errno);
  553.         exit(2);
  554.     }
  555. #else /* !OS9 */
  556.     Tty = open("/dev/tty", 2);
  557.     if (Tty < 0) {
  558.         perror("/dev/tty");  exit(2);
  559.     }
  560. #endif
  561.     Ttystream = fdopen(Tty, "w");
  562. /*
  563.     setbuf(Ttystream, xXbuf);        
  564. */
  565. #ifdef OS9
  566.     Ttystream->_flag &= ~_SCF;
  567.     Ttystream->_flag |= _RBF;
  568. #endif
  569. }
  570.  
  571. /*
  572. flushmoc()
  573. {
  574.     fflush(Ttystream);
  575. }
  576. */
  577. flushmo()
  578. {
  579.     fflush(Ttystream);
  580. }
  581.  
  582. /*
  583.  * This version of readline is reasoably well suited for
  584.  * reading many characters.
  585.  *
  586.  * timeout is in tenths of seconds
  587.  */
  588. void
  589. alrm(c)
  590. {
  591.     longjmp(tohere, -1);
  592. }
  593. readline(timeout)
  594. int timeout;
  595. {
  596.     register n;
  597.     static char *cdq;    /* pointer for removing chars from linbuf */
  598.  
  599.     if (--Lleft >= 0) {
  600.         if (Verbose > 8) {
  601.             fprintf(stderr, "%02x ", *cdq&0377);
  602.         }
  603.         return (*cdq++ & 0377);
  604.     }
  605.     n = timeout/10;
  606.     if (n < 2)
  607.         n = 2;
  608.     if (Verbose > 5)
  609.         fprintf(stderr, "Calling read: alarm=%d  Readnum=%d ",
  610.           n, Readnum);
  611.     if (setjmp(tohere)) {
  612. #ifdef TIOCFLUSH
  613. /*        ioctl(Tty, TIOCFLUSH, 0); */
  614. #endif
  615.         Lleft = 0;
  616.         if (Verbose > 1)
  617.             fprintf(stderr, "Readline:TIMEOUT\n");
  618.         return TIMEOUT;
  619.     }
  620. #ifdef OS9
  621.     errno = 0;
  622.     Lleft=alarmread(Tty, cdq=linbuf, Readnum, alrm, n);
  623. #else
  624.     signal(SIGALRM, alrm); alarm(n);
  625.     errno = 0;
  626.     Lleft=read(Tty, cdq=linbuf, Readnum);
  627.     alarm(0);
  628. #endif
  629.     if (Verbose > 5) {
  630.         fprintf(stderr, "Read returned %d bytes errno=%d\n",
  631.           Lleft, errno);
  632.     }
  633.     if (Lleft < 1)
  634.         return TIMEOUT;
  635.     if (Verbose > 8) {
  636.         for (n = Lleft; --n >= 0; ) {
  637.             fprintf(stderr, "%02x ", *cdq&0377);
  638.         }
  639.         fprintf(stderr, "\n");
  640.     }
  641.     --Lleft;
  642.     return (*cdq++ & 0377);
  643. }
  644.  
  645.  
  646.  
  647. /*
  648.  * Purge the modem input queue of all characters
  649.  */
  650. purgeline()
  651. {
  652. #ifdef OS9
  653.     char ch[256];
  654.     int cnt;
  655. #endif
  656.  
  657.     Lleft = 0;
  658. #ifdef OS9
  659.     while ((cnt = _gs_rdy(Tty)) > 0)
  660.         read(Tty, ch, min(cnt, 255));
  661. #else /* !OS9 */
  662. #ifdef USG
  663. #ifdef POSIX
  664.     tcflush(Tty, 0);
  665. #else
  666.     ioctl(Tty, TCFLSH, 0);
  667. #endif
  668. #else
  669.     lseek(Tty, 0L, 2);
  670. #endif
  671. #endif /* !OS9 */
  672. }
  673.  
  674.  
  675. /* send cancel string to get the other end to shut up */
  676. canit()
  677. {
  678.     static char canistr[] = {
  679.      24,24,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,8,0
  680.     };
  681.  
  682.     zmputs(canistr);
  683.     Lleft=0;    /* Do read next time ... */
  684. }
  685.  
  686. /*
  687.  * Send a string to the modem, processing for \336 (sleep 1 sec)
  688.  *   and \335 (break signal)
  689.  */
  690. zmputs(s)
  691. char *s;
  692. {
  693.     register c;
  694.  
  695.     while (*s) {
  696.         switch (c = *s++) {
  697.         case '\336':
  698.             sleep(1); continue;
  699.         case '\335':
  700.             sendbrk(); continue;
  701.         default:
  702.             sendline(c);
  703.         }
  704.     }
  705.     flushmo();
  706. }
  707.  
  708.  
  709. /* VARARGS1 */
  710. vfile(f, a, b, c, d)
  711. char *f;
  712. long a, b, c, d;
  713. {
  714.     if (Verbose > 2) {
  715.         fprintf(stderr, f, a, b, c, d);
  716.         fprintf(stderr, "\n");
  717.     }
  718. }
  719.  
  720. /*
  721.  * Log an error
  722.  */
  723. /*VARARGS1*/
  724. void
  725. zperr(s,p,u)
  726. char *s, *p, *u;
  727. {
  728.     if (Verbose <= 0)
  729.         return;
  730.     fprintf(stderr, "Retry %d: ", errors);
  731.     fprintf(stderr, s, p, u);
  732.     fprintf(stderr, "\n");
  733. }
  734. /* End of rbsb.c */
  735.