db_output.c (15680) | db_output.c (18298) |
---|---|
1/* 2 * Mach Operating System 3 * Copyright (c) 1991,1990 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 9 unchanged lines hidden (view full) --- 18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 19 * School of Computer Science 20 * Carnegie Mellon University 21 * Pittsburgh PA 15213-3890 22 * 23 * any improvements or extensions that they make and grant Carnegie the 24 * rights to redistribute these changes. 25 * | 1/* 2 * Mach Operating System 3 * Copyright (c) 1991,1990 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 9 unchanged lines hidden (view full) --- 18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 19 * School of Computer Science 20 * Carnegie Mellon University 21 * Pittsburgh PA 15213-3890 22 * 23 * any improvements or extensions that they make and grant Carnegie the 24 * rights to redistribute these changes. 25 * |
26 * $Id: db_output.c,v 1.17 1996/01/23 21:17:59 phk Exp $ | 26 * $Id: db_output.c,v 1.18 1996/05/08 04:28:35 gpalmer Exp $ |
27 */ 28 29/* 30 * Author: David B. Golub, Carnegie Mellon University 31 * Date: 7/90 32 */ 33 34/* --- 21 unchanged lines hidden (view full) --- 56 * don't print trailing spaces. This avoids most 57 * of the wraparounds. 58 */ 59static int db_output_position = 0; /* output column */ 60static int db_last_non_space = 0; /* last non-space character */ 61int db_tab_stop_width = 8; /* how wide are tab stops? */ 62#define NEXT_TAB(i) \ 63 ((((i) + db_tab_stop_width) / db_tab_stop_width) * db_tab_stop_width) | 27 */ 28 29/* 30 * Author: David B. Golub, Carnegie Mellon University 31 * Date: 7/90 32 */ 33 34/* --- 21 unchanged lines hidden (view full) --- 56 * don't print trailing spaces. This avoids most 57 * of the wraparounds. 58 */ 59static int db_output_position = 0; /* output column */ 60static int db_last_non_space = 0; /* last non-space character */ 61int db_tab_stop_width = 8; /* how wide are tab stops? */ 62#define NEXT_TAB(i) \ 63 ((((i) + db_tab_stop_width) / db_tab_stop_width) * db_tab_stop_width) |
64int db_max_width = 80; /* output line width */ | 64int db_max_width = 79; /* output line width */ |
65 66static void db_putchar __P((int c, void *arg)); 67 68/* 69 * Force pending whitespace. 70 */ 71void 72db_force_whitespace() --- 76 unchanged lines hidden (view full) --- 149 150/* 151 * Printing 152 */ 153void 154db_printf(const char *fmt, ...) 155{ 156 va_list listp; | 65 66static void db_putchar __P((int c, void *arg)); 67 68/* 69 * Force pending whitespace. 70 */ 71void 72db_force_whitespace() --- 76 unchanged lines hidden (view full) --- 149 150/* 151 * Printing 152 */ 153void 154db_printf(const char *fmt, ...) 155{ 156 va_list listp; |
157 |
|
157 va_start(listp, fmt); 158 kvprintf (fmt, db_putchar, NULL, db_radix, listp); 159 va_end(listp); 160} 161 | 158 va_start(listp, fmt); 159 kvprintf (fmt, db_putchar, NULL, db_radix, listp); 160 va_end(listp); 161} 162 |
163int db_indent; 164 165void 166db_iprintf(const char *fmt,...) 167{ 168 register int i; 169 va_list listp; 170 171 for (i = db_indent; i >= 8; i -= 8) 172 db_printf("\t"); 173 while (--i >= 0) 174 db_printf(" "); 175 va_start(listp, fmt); 176 kvprintf (fmt, db_putchar, NULL, db_radix, listp); 177 va_end(listp); 178} 179 |
|
162/* 163 * End line if too long. 164 */ 165void 166db_end_line() 167{ 168 if (db_output_position >= db_max_width) 169 db_printf("\n"); 170} | 180/* 181 * End line if too long. 182 */ 183void 184db_end_line() 185{ 186 if (db_output_position >= db_max_width) 187 db_printf("\n"); 188} |
171 | |