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