show.c (b97fa2ef508bb1cc99621edb8b6d03845b55b8bd) | show.c (afb033d5c4f01a464f57fe8e68d741246d9df492) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $Id$ | 36 * $Id: show.c,v 1.7 1997/02/22 13:58:45 peter Exp $ |
37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdio.h> | 37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdio.h> |
44#if __STDC__ | 44#ifdef __STDC__ |
45#include <stdarg.h> 46#else 47#include <varargs.h> 48#endif 49 50#include "shell.h" 51#include "parser.h" 52#include "nodes.h" --- 240 unchanged lines hidden (view full) --- 293 return; 294 putc(c, tracefile); 295 if (c == '\n') 296 fflush(tracefile); 297} 298 299 300void | 45#include <stdarg.h> 46#else 47#include <varargs.h> 48#endif 49 50#include "shell.h" 51#include "parser.h" 52#include "nodes.h" --- 240 unchanged lines hidden (view full) --- 293 return; 294 putc(c, tracefile); 295 if (c == '\n') 296 fflush(tracefile); 297} 298 299 300void |
301#if __STDC__ | 301#ifdef __STDC__ |
302trace(const char *fmt, ...) 303#else 304trace(va_alist) 305 va_dcl 306#endif 307{ 308 va_list va; | 302trace(const char *fmt, ...) 303#else 304trace(va_alist) 305 va_dcl 306#endif 307{ 308 va_list va; |
309#if __STDC__ | 309#ifdef __STDC__ |
310 va_start(va, fmt); 311#else 312 char *fmt; 313 va_start(va); 314 fmt = va_arg(va, char *); 315#endif 316 if (tracefile != NULL) { 317 (void) vfprintf(tracefile, fmt, va); --- 15 unchanged lines hidden (view full) --- 333 fflush(tracefile); 334} 335 336 337static void 338trstring(s) 339 char *s; 340{ | 310 va_start(va, fmt); 311#else 312 char *fmt; 313 va_start(va); 314 fmt = va_arg(va, char *); 315#endif 316 if (tracefile != NULL) { 317 (void) vfprintf(tracefile, fmt, va); --- 15 unchanged lines hidden (view full) --- 333 fflush(tracefile); 334} 335 336 337static void 338trstring(s) 339 char *s; 340{ |
341 register char *p; | 341 char *p; |
342 char c; 343 344 if (tracefile == NULL) 345 return; 346 putc('"', tracefile); 347 for (p = s ; *p ; p++) { 348 switch (*p) { 349 case '\n': c = 'n'; goto backslash; --- 82 unchanged lines hidden --- | 342 char c; 343 344 if (tracefile == NULL) 345 return; 346 putc('"', tracefile); 347 for (p = s ; *p ; p++) { 348 switch (*p) { 349 case '\n': c = 'n'; goto backslash; --- 82 unchanged lines hidden --- |