/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* UNIX shell
*
*/
#include "defs.h"
#include <locale.h>
#include <wctype.h> /* iswprint() */
static int index = 0;
void prc_buff(unsigned char c);
void prs_buff(unsigned char *s);
void prn_buff(int n);
void prs_cntl(unsigned char *s);
void itos(int n);
/*
* printing and io conversion
*/
void
prp()
{
}
}
void
{
if (as) {
}
}
void
prc(unsigned char c)
{
if (c) {
}
}
void
{
int len;
if (c == 0) {
return;
}
mb[0] = (unsigned char)c;
len = 1;
}
}
void
prt(long t)
{
t += HZ / 2;
t /= HZ;
sec = t % 60;
t /= 60;
min = t % 60;
if ((hr = t / 60) != 0) {
prc_buff('h');
}
prc_buff('m');
prc_buff('s');
}
void
prn(int n)
{
itos(n);
}
void
itos(int n)
{
int d;
*--abuf = (unsigned char)'\0';
do {
} while ((n = d) != 0);
}
int
{
int r = 0;
unsigned char c;
r = r * 10 + c - '0';
cp++;
}
/* NOTREACHED */
} else {
return (r);
}
}
int
ltos(long n)
{
int i;
for (i = 19; i >= 0; i--) {
if ((n /= 10) == 0) {
break;
}
}
return (i);
}
static int
{
int i;
/* The max unsigned long long is 20 characters (+1 for '\0') */
for (i = 19; i >= 0; i--) {
if ((n /= 10) == 0) {
break;
}
}
return (i);
}
void
flushb()
{
if (index) {
index = 0;
}
}
void
prc_buff(unsigned char c)
{
if (c) {
flushb();
}
} else {
flushb();
}
}
void
prs_buff(unsigned char *s)
{
flushb();
}
} else {
}
}
static unsigned char *
{
*ptr++ = '\\';
return (ptr);
}
void
prs_cntl(unsigned char *s)
{
int n;
unsigned char *olds = s;
wchar_t c;
n = 0;
}
while (n != 0) {
if (n < 0) {
} else {
c = wc;
s += n;
if (!iswprint(c)) {
if (c < '\040' && c > 0) {
/*
* assumes ASCII char
* translate a control character
* into a printable sequence
*/
*ptr++ = '^';
*ptr++ = (c + 0100);
} else if (c == 0177) {
/* '\0177' does not work */
*ptr++ = '^';
*ptr++ = '?';
} else {
/*
* unprintable 8-bit byte sequence
* assumes all legal multibyte
* sequences are
* printable
*/
}
} else {
while (n--) {
}
}
}
*ptr = '\0';
}
olds = s;
n = 0;
}
}
*ptr = '\0';
}
void
{
}
void
prn_buff(int n)
{
itos(n);
}
int
{
int ofd;
}
}
} else {
flushb();
}
} else {
}
index = 0;
return (ofd);
}