set.c (68617) | set.c (87701) |
---|---|
1/*- 2 * Copyright (c) 1991, 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 | 1/*- 2 * Copyright (c) 1991, 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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#include <sys/cdefs.h> 35 36__FBSDID("$FreeBSD: head/usr.bin/tset/set.c 87701 2001-12-11 23:29:45Z markm $"); 37 |
|
34#ifndef lint | 38#ifndef lint |
35#if 0 36static char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94"; | 39static const char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94"; |
37#endif | 40#endif |
38static const char rcsid[] = 39 "$FreeBSD: head/usr.bin/tset/set.c 68617 2000-11-11 23:03:38Z dg $"; 40#endif /* not lint */ | |
41 | 41 |
42#include <stdio.h> |
|
42#include <termios.h> 43#include <unistd.h> | 43#include <termios.h> 44#include <unistd.h> |
44#include <stdio.h> | 45 |
45#include "extern.h" 46 47#define CHK(val, dft) (val <= 0 ? dft : val) 48 49int set_tabs __P((void)); 50 51/* 52 * Reset the terminal mode bits to a sensible state. Very useful after --- 227 unchanged lines hidden (view full) --- 280 * This is done before if and is, so they can patch in case we blow this. 281 * Return nonzero if we set any tab stops, zero if not. 282 */ 283int 284set_tabs() 285{ 286 int c; 287 char *capsp, *clear_tabs; | 46#include "extern.h" 47 48#define CHK(val, dft) (val <= 0 ? dft : val) 49 50int set_tabs __P((void)); 51 52/* 53 * Reset the terminal mode bits to a sensible state. Very useful after --- 227 unchanged lines hidden (view full) --- 281 * This is done before if and is, so they can patch in case we blow this. 282 * Return nonzero if we set any tab stops, zero if not. 283 */ 284int 285set_tabs() 286{ 287 int c; 288 char *capsp, *clear_tabs; |
288 char *set_column, *set_pos, *Set_tab, *tg_out; | 289 char *set_column, *set_pos, *Set_tab; |
289 char caps[1024]; | 290 char caps[1024]; |
291 const char *tg_out; |
|
290 291 capsp = caps; 292 Set_tab = tgetstr("st", &capsp); 293 294 if (Set_tab && (clear_tabs = tgetstr("ct", &capsp))) { 295 (void)putc('\r', stderr); /* Force to left margin. */ 296 tputs(clear_tabs, 0, outc); 297 } --- 27 unchanged lines hidden --- | 292 293 capsp = caps; 294 Set_tab = tgetstr("st", &capsp); 295 296 if (Set_tab && (clear_tabs = tgetstr("ct", &capsp))) { 297 (void)putc('\r', stderr); /* Force to left margin. */ 298 tputs(clear_tabs, 0, outc); 299 } --- 27 unchanged lines hidden --- |