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