Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / discard.c,v
1 head    1.7;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.7
9 date    93.02.26.21.56.04;      author jromine; state Exp;
10 branches;
11 next    1.6;
12
13 1.6
14 date    92.12.15.00.20.22;      author jromine; state Exp;
15 branches;
16 next    1.5;
17
18 1.5
19 date    92.12.14.17.36.16;      author jromine; state Exp;
20 branches;
21 next    1.4;
22
23 1.4
24 date    90.04.05.15.31.32;      author sources; state Exp;
25 branches;
26 next    1.3;
27
28 1.3
29 date    90.04.05.14.45.54;      author sources; state Exp;
30 branches;
31 next    1.2;
32
33 1.2
34 date    90.02.05.15.01.21;      author sources; state Exp;
35 branches;
36 next    1.1;
37
38 1.1
39 date    90.02.05.15.01.16;      author sources; state Exp;
40 branches;
41 next    ;
42
43
44 desc
45 @@
46
47
48 1.7
49 log
50 @386BSD/BSD44
51 @
52 text
53 @/* discard.c - discard output on a file pointer */
54 #ifndef lint
55 static char ident[] = "@@(#)$Id: discard.c,v 1.6 1992/12/15 00:20:22 jromine Exp jromine $";
56 #endif  /* lint */
57
58 #include "../h/mh.h"
59 #include <stdio.h>
60 #ifdef POSIX
61 #include <termios.h>
62 #else
63 #ifndef SYS5
64 #include <sgtty.h>
65 #else   /* SYS5 */
66 #include <sys/types.h>
67 #include <termio.h>
68 #ifndef NOIOCTLH
69 #include <sys/ioctl.h>
70 #endif  /* NOIOCTLH */
71 #endif  /* SYS5 */
72 #endif  /* POSIX */
73
74
75 void    discard (io)
76 FILE   *io;
77 {
78 #ifndef POSIX
79 #ifndef SYS5
80     struct sgttyb   sg;
81 #else   /* SYS5 */
82     struct termio   sg;
83 #endif  /* SYS5 */
84 #endif  /* POSIX */
85
86     if (io == NULL)
87         return;
88
89 #ifdef POSIX
90     tcflush (fileno (io), TCOFLUSH);
91 #else
92 #ifndef SYS5
93     if (ioctl (fileno (io), TIOCGETP, (char *) &sg) != NOTOK)
94         (void) ioctl (fileno (io), TIOCSETP, (char *) &sg);
95 #else   /* SYS5 */
96     if (ioctl (fileno (io), TCGETA, &sg) != NOTOK)
97         (void) ioctl (fileno (io), TCSETA, &sg);
98 #endif  /* SYS5 */
99 #endif  /* POSIX */
100
101 #ifdef _FSTDIO
102     fpurge (io);
103 #else
104     if (io -> _ptr = io -> _base)
105         io -> _cnt = 0;
106 #endif
107 }
108 @
109
110
111 1.6
112 log
113 @endif sugar
114 @
115 text
116 @d3 1
117 a3 1
118 static char ident[] = "@@(#)$Id: discard.c,v 1.5 1992/12/14 17:36:16 jromine Exp jromine $";
119 d8 3
120 d20 1
121 d26 1
122 d32 1
123 d37 3
124 d47 1
125 d49 3
126 d54 1
127 @
128
129
130 1.5
131 log
132 @*** empty log message ***
133 @
134 text
135 @d3 2
136 a4 2
137 static char ident[] = "@@(#)$Id: discard.c,v 1.4 90/04/05 15:31:32 sources Exp $";
138 #endif  lint
139 d10 1
140 a10 1
141 #else   SYS5
142 d15 2
143 a16 2
144 #endif  NOIOCTLH
145 #endif  SYS5
146 d24 1
147 a24 1
148 #else   SYS5
149 d26 1
150 a26 1
151 #endif  SYS5
152 d34 1
153 a34 1
154 #else   SYS5
155 d37 1
156 a37 1
157 #endif  SYS5
158 @
159
160
161 1.4
162 log
163 @add ID
164 @
165 text
166 @d3 1
167 a3 1
168 static char ident[] = "@@(#)$Id:$";
169 @
170
171
172 1.3
173 log
174 @add ID
175 @
176 text
177 @d3 1
178 a3 1
179 static char ident[] = "$Id:";
180 @
181
182
183 1.2
184 log
185 @*** empty log message ***
186 @
187 text
188 @d2 3
189 @
190
191
192 1.1
193 log
194 @Initial revision
195 @
196 text
197 @d10 1
198 d12 1
199 @