/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright (c) 1987, 1988, 1989, 1990 by Sun Microsystems, Inc.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* Subroutines for the 4.0 compatibility run-time link editor.
*/
#include <varargs.h>
/*
* Local "printf" & stdio facilities.
*/
static char *printn();
static void prf();
static void doprf();
static int _write();
/*
* printf
*/
/*VARARGS1*/
char *fmt;
{
}
/*
* fprintf
*/
/*VARARGS2*/
int fd;
char *fmt;
{
}
/*
* panic
*/
/*VARARGS2*/
char *fmt;
{
extern char *program_name;
_exit(127);
/* NOTREACHED */
}
/*
* sprintf
*/
/*VARARGS2*/
char *cp;
char *fmt;
{
}
/*
* printf worker functions
*/
static void
int fd;
char *fmt;
{
}
static void
int fd;
register char *fmt;
char *linebuf;
{
register int c; /* Character temporary */
register char *s; /* %s temporary */
int i; /* General integer temporary */
int b; /* Conversion base */
#define PUTCHAR(c) { \
} \
*lbp++ = (c); \
}
loop:
while ((c = *fmt++) != '%') {
if (c == '\0') {
return;
}
PUTCHAR(c);
}
c = *fmt++;
/* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */
switch (c) {
case 'x': case 'X':
b = 16;
goto number;
case 'd': case 'D':
case 'u': /* what a joke */
b = 10;
goto number;
case 'o': case 'O':
b = 8;
&linebuf[128]);
break;
case 'c':
for (i = 24; i >= 0; i -= 8)
if (c = (b >> i) & 0x7f) {
PUTCHAR(c);
}
break;
case 's':
while (c = *s++) {
PUTCHAR(c);
}
break;
case '%':
PUTCHAR('%');
break;
}
goto loop;
}
/*
* Printn prints a number n in base b.
*/
static char *
int fd; /* File descriptor to get output */
u_long n; /* Number */
int b; /* Base */
char *linebufp; /* Buffer location */
register char *lbp; /* Current offset in buffer */
char *linebufend; /* Where buffer ends */
{
register char *cp;
#define PUTCHAR(c) { \
if (lbp >= linebufend) { \
} \
*lbp++ = (c); \
}
if (b == 10 && (int)n < 0) {
PUTCHAR('-');
n = (unsigned)(-(int)n);
}
do {
*cp++ = "0123456789abcdef"[n%b];
n /= b;
} while (n);
do {
return (lbp);
}
static int
int fd;
char *buf;
int len;
{
if (fd == -1) {
return (0);
}
}