courier.c (7799f52a32f592a7efe259bc3411ba52d13db797) courier.c (e1b4d8d0746069292d84708b0e11b17a7e1ef5e0)
1/*
2 * Copyright (c) 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
1/*
2 * Copyright (c) 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
36#endif /* not lint */
35static const char rcsid[] =
36 "$FreeBSD$";
37#endif
37
38/*
39 * Routines for calling up on a Courier modem.
40 * Derived from Hayes driver.
41 */
42#include "tipconf.h"
43#include "tip.h"
44#include "acucommon.h"
45#include <stdio.h>
38
39/*
40 * Routines for calling up on a Courier modem.
41 * Derived from Hayes driver.
42 */
43#include "tipconf.h"
44#include "tip.h"
45#include "acucommon.h"
46#include <stdio.h>
47#include <unistd.h>
46
47#define MAXRETRY 5
48
49static void sigALRM();
50static int timeout = 0;
51static int connected = 0;
52static jmp_buf timeoutbuf, intbuf;
53static int coursync();

--- 240 unchanged lines hidden (view full) ---

294
295cour_write(fd, cp, n)
296int fd;
297char *cp;
298int n;
299{
300#ifdef notdef
301 if (boolean(value(VERBOSE)))
48
49#define MAXRETRY 5
50
51static void sigALRM();
52static int timeout = 0;
53static int connected = 0;
54static jmp_buf timeoutbuf, intbuf;
55static int coursync();

--- 240 unchanged lines hidden (view full) ---

296
297cour_write(fd, cp, n)
298int fd;
299char *cp;
300int n;
301{
302#ifdef notdef
303 if (boolean(value(VERBOSE)))
302 write(1, cp, n);
304 write(STDOUT_FILENO, cp, n);
303#endif
304 acu_flush ();
305 cour_nap();
306 for ( ; n-- ; cp++) {
307 write(fd, cp, 1);
308 acu_flush ();
309 cour_nap();
310 }

--- 6 unchanged lines hidden (view full) ---

317 char buf[BUFSIZ];
318
319 if (ioctl(FD, FIONREAD, &n) < 0)
320 return;
321 if (n <= 0)
322 return;
323 if (read(FD, buf, n) != n)
324 return;
305#endif
306 acu_flush ();
307 cour_nap();
308 for ( ; n-- ; cp++) {
309 write(fd, cp, 1);
310 acu_flush ();
311 cour_nap();
312 }

--- 6 unchanged lines hidden (view full) ---

319 char buf[BUFSIZ];
320
321 if (ioctl(FD, FIONREAD, &n) < 0)
322 return;
323 if (n <= 0)
324 return;
325 if (read(FD, buf, n) != n)
326 return;
325 write(1, buf, n);
327 write(STDOUT_FILENO, buf, n);
326}
327#endif
328
329cour_nap()
330{
331 acu_nap (50);
332}
333
334/* end of courier.c */
328}
329#endif
330
331cour_nap()
332{
333 acu_nap (50);
334}
335
336/* end of courier.c */