home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
minnie.tuhs.org
/
unixen.tar
/
unixen
/
PDP-11
/
Distributions
/
ucb
/
spencer_2bsd.tar.gz
/
2bsd.tar
/
src
/
ex
/
11printf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1980-02-17
|
795b
|
55 lines
/* Copyright (c) 1979 Regents of the University of California */
#ifdef TRACE
#include <stdio.h>
#undef putchar
#endif
printf(fmt, args)
{
_doprnt(fmt, &args, 0);
}
_strout(string, count, adjust, file, fillch)
register char *string;
register int count;
int adjust;
register struct { int a; } *file;
{
while (adjust < 0) {
if (*string=='-' && fillch=='0') {
#ifdef TRACE
if (file)
putc(*string++, file);
else
#endif
putchar(*string++);
count--;
}
#ifdef TRACE
if (file)
putc(fillch, file);
else
#endif
putchar(fillch);
adjust++;
}
while (--count>=0)
#ifdef TRACE
if (file)
putc(*string++, file);
else
#endif
putchar(*string++);
while (adjust) {
#ifdef TRACE
if (file)
putc(fillch, file);
else
#endif
putchar(fillch);
adjust--;
}
}