print.c (59714) | print.c (59788) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993, 1994 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993, 1994 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/bin/stty/print.c 59714 2000-04-27 21:31:23Z ache $"; | 39 "$FreeBSD: head/bin/stty/print.c 59788 2000-04-30 17:04:26Z ache $"; |
40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <stddef.h> 45#include <stdio.h> 46#include <string.h> 47 48#include "stty.h" 49#include "extern.h" 50 51#include <sys/ioctl_compat.h> /* XXX NTTYDISC is too well hidden */ 52 53static void binit __P((char *)); 54static void bput __P((char *)); 55static char *ccval __P((struct cchar *, int)); 56 57void | 40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <stddef.h> 45#include <stdio.h> 46#include <string.h> 47 48#include "stty.h" 49#include "extern.h" 50 51#include <sys/ioctl_compat.h> /* XXX NTTYDISC is too well hidden */ 52 53static void binit __P((char *)); 54static void bput __P((char *)); 55static char *ccval __P((struct cchar *, int)); 56 57void |
58print(tp, wp, ldisc, timeout, fmt) | 58print(tp, wp, ldisc, fmt) |
59 struct termios *tp; 60 struct winsize *wp; 61 int ldisc; | 59 struct termios *tp; 60 struct winsize *wp; 61 int ldisc; |
62 int timeout; | |
63 enum FMT fmt; 64{ 65 struct cchar *p; 66 long tmp; 67 u_char *cc; 68 int cnt, ispeed, ospeed; 69 char buf1[100], buf2[100]; 70 --- 21 unchanged lines hidden (view full) --- 92 ispeed = cfgetispeed(tp); 93 ospeed = cfgetospeed(tp); 94 if (ispeed != ospeed) 95 cnt += 96 printf("ispeed %d baud; ospeed %d baud;", ispeed, ospeed); 97 else 98 cnt += printf("speed %d baud;", ispeed); 99 if (fmt >= BSD) | 62 enum FMT fmt; 63{ 64 struct cchar *p; 65 long tmp; 66 u_char *cc; 67 int cnt, ispeed, ospeed; 68 char buf1[100], buf2[100]; 69 --- 21 unchanged lines hidden (view full) --- 91 ispeed = cfgetispeed(tp); 92 ospeed = cfgetospeed(tp); 93 if (ispeed != ospeed) 94 cnt += 95 printf("ispeed %d baud; ospeed %d baud;", ispeed, ospeed); 96 else 97 cnt += printf("speed %d baud;", ispeed); 98 if (fmt >= BSD) |
100 cnt += printf(" %d rows; %d columns; drainwait %d seconds;", 101 wp->ws_row, wp->ws_col, timeout); | 99 cnt += printf(" %d rows; %d columns;", wp->ws_row, wp->ws_col); |
102 if (cnt) 103 (void)printf("\n"); 104 105#define on(f) ((tmp & (f)) != 0) 106#define put(n, f, d) \ 107 if (fmt >= BSD || on(f) != (d)) \ 108 bput((n) + on(f)); 109 --- 181 unchanged lines hidden --- | 100 if (cnt) 101 (void)printf("\n"); 102 103#define on(f) ((tmp & (f)) != 0) 104#define put(n, f, d) \ 105 if (fmt >= BSD || on(f) != (d)) \ 106 bput((n) + on(f)); 107 --- 181 unchanged lines hidden --- |