BSD 3 development
[unix-history] / usr / src / cmd / csh / printf.c
CommitLineData
1b926d66
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 if (foo != 0)
20 abort();
21 while (adjust < 0) {
22 if (*string=='-' && fillch=='0') {
23 putchar(*string++);
24 count--;
25 }
26 putchar(fillch);
27 adjust++;
28 }
29 while (--count>=0)
30 putchar(*string++);
31 while (adjust) {
32 putchar(fillch);
33 adjust--;
34 }
35}