BSD 3 development
[unix-history] / usr / src / cmd / pxp / printf.c
CommitLineData
eb8dd88e
BJ
1/* Copyright (c) 1979 Regents of the University of California */
2/*
3 * Hacked "printf" which prints through putchar.
4 * DONT USE WITH STDIO!
5 */
6printf(fmt, args)
7char *fmt;
8{
9 _doprnt(fmt, &args, 0);
10}
11
12_strout(count, string, adjust, foo, fillch)
13register char *string;
14register int count;
15int adjust;
16register struct { int a[6]; } *foo;
17{
18
19 while (adjust < 0) {
20 if (*string=='-' && fillch=='0') {
21 if (foo)
22 fputc(*string++, foo);
23 else
24 putchar(*string++);
25 count--;
26 }
27 if (foo)
28 fputc(fillch, foo);
29 else
30 putchar(fillch);
31 adjust++;
32 }
33 while (--count>=0)
34 if (foo)
35 fputc(*string++, foo);
36 else
37 putchar(*string++);
38 while (adjust) {
39 if (foo)
40 fputc(fillch, foo);
41 else
42 putchar(fillch);
43 adjust--;
44 }
45}