date and time created 83/02/11 15:45:15 by rrh
[unix-history] / usr / src / usr.bin / ex / ovprintf.c
CommitLineData
473313e2
BJ
1/* Copyright (c) 1979 Regents of the University of California */
2static char *sccsid = "@(#)ovprintf.c 1.1 %G%";
3
4/*
5 * This version of printf calls doprnt, and as such is not portable,
6 * since doprnt is written in pdp-11 assembly language. (There is a
7 * vax doprnt which has the first 2 arguments reversed. We don't use it.)
8 * This version is used because it is about 900 bytes smaller than the
9 * portable version, which is also included in case it is needed.
10 */
11#ifdef TRACE
12#include <stdio.h>
13#undef putchar
14#endif
15
16printf(fmt, args)
17char *fmt;
18{
19 _doprnt(fmt, &args, 0);
20}
21
22_strout(string, count, adjust, file, fillch)
23register char *string;
24register count;
25int adjust;
26register struct _iobuf *file;
27{
28 while (adjust < 0) {
29 if (*string=='-' && fillch=='0') {
30 putchar(*string++);
31 count--;
32 }
33 putchar(fillch);
34 adjust++;
35 }
36 while (--count>=0)
37 putchar(*string++);
38 while (adjust) {
39 putchar(fillch);
40 adjust--;
41 }
42}