cleanups, add manual page
[unix-history] / usr / src / usr.bin / ex / ovprintf.c
CommitLineData
edf71f48
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
7#ifndef lint
70190965 8static char *sccsid = "@(#)ovprintf.c 1.3 (Berkeley) %G%";
edf71f48 9#endif not lint
473313e2
BJ
10
11/*
12 * This version of printf calls doprnt, and as such is not portable,
13 * since doprnt is written in pdp-11 assembly language. (There is a
14 * vax doprnt which has the first 2 arguments reversed. We don't use it.)
15 * This version is used because it is about 900 bytes smaller than the
16 * portable version, which is also included in case it is needed.
17 */
18#ifdef TRACE
19#include <stdio.h>
20#undef putchar
21#endif
22
23printf(fmt, args)
24char *fmt;
25{
26 _doprnt(fmt, &args, 0);
27}
28
29_strout(string, count, adjust, file, fillch)
30register char *string;
31register count;
32int adjust;
33register struct _iobuf *file;
34{
35 while (adjust < 0) {
36 if (*string=='-' && fillch=='0') {
37 putchar(*string++);
38 count--;
39 }
40 putchar(fillch);
41 adjust++;
42 }
43 while (--count>=0)
44 putchar(*string++);
45 while (adjust) {
46 putchar(fillch);
47 adjust--;
48 }
49}