Lines Matching defs:output

1 /*	$NetBSD: output.c,v 1.41 2023/04/07 10:34:13 kre Exp $	*/
38 static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95";
40 __RCSID("$NetBSD: output.c,v 1.41 2023/04/07 10:34:13 kre Exp $");
45 * Shell output routines. We use our own output routines because:
47 * any pending output.
49 * save the output of the command in a region obtained
51 * output of the command via a pipe.
52 * Our output routines may be smaller than the stdio routines.
67 #include "output.h"
76 #define BLOCK_OUT -2 /* output to a fixed block of memory */
77 #define MEM_OUT -3 /* output to dynamically allocated memory */
87 struct output output = {NULL, 0, OUTBUFSIZ, NULL, 1, 0 CHAIN };
88 struct output errout = {NULL, 0, 100, NULL, 2, 0 CHAIN };
89 struct output memout = {NULL, 0, 0, NULL, MEM_OUT, 0 CHAIN };
90 struct output *out1 = &output;
91 struct output *out2 = &errout;
93 struct output *outx = &errout;
94 struct output *outxtop = NULL;
100 INCLUDE "output.h"
104 out1 = &output;
117 * Set up an output file to write to memory rather than a file.
121 open_mem(char *block, int length, struct output *file)
154 outstr(const char *p, struct output *file)
197 outshstr(const char *p, struct output *file)
264 emptyoutbuf(struct output *dest)
298 flushout(&output);
304 flushout(struct output *dest)
322 if (output.buf) {
323 ckfree(output.buf);
324 output.buf = NULL;
325 output.nleft = 0;
332 outfmt(struct output *file, const char *fmt, ...)
369 struct output strout;
384 * Formatted output. This routine handles a subset of the printf formats:
403 doformat(struct output *dest, const char *f, va_list ap)
410 error("Could not allocate formatted output buffer");
633 struct output *o = outxtop;
665 * This is a change of output file only
666 * Just close the current one, and reuse the struct output
673 * need a new output struct to become outx
692 struct output *o;
724 struct output *o;