doprnt.c revision 762f6727ac618cdd12d0d2ebfd0bbe150d666e01
1389N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1389N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
if (sflag) {
if (n > len) {
return (EOF);
return (EOF);
return (EOF);
#ifdef _WIDE
#ifdef _WIDE
#ifdef _WIDE
int sflag = 0;
int snflag = 0;
unsigned char *bufptr;
unsigned char *bufferend;
#ifdef _WIDE
int count = 0;
#ifdef _WIDE
wchar_t *p;
char *cbp;
char *cp;
char *bp;
int prec = 0;
char wflag;
char lflag;
int retcode;
#ifdef _WIDE
char fcode;
#ifdef _WIDE
char *prefix;
char *suffix;
int exp;
#ifdef _WIDE
const char *tab;
int inf_nan = 0;
int inf_nan_mixed_case = 0;
#ifdef _WIDE
* stdarg.h. (Remember that if va_list is an array, in_args will
#ifdef _WIDE
if (!sflag) {
return (EOF);
#ifdef _WIDE
#ifdef _WIDE
if (sflag) {
maxcount);
ssize_t n;
#ifdef _WIDE
format++;
#ifdef _WIDE
if (sflag) {
& _IOREAD))
#ifdef _WIDE
format++;
wflag = 0;
lflag = 0;
sec_display = 0;
quote = 0;
goto charswitch;
goto charswitch;
goto charswitch;
quote++;
goto charswitch;
goto charswitch;
prec = 0;
goto charswitch;
goto charswitch;
if (width < 0) {
if (prec < 0) {
prec = 0;
goto charswitch;
if (fpos) {
#ifdef _WIDE
fpos = 0;
prec = 0;
width = 0;
if (position <= 0) {
format--;
#ifdef _WIDE
if (!starflg)
starflg = 0;
if (prec < 0) {
prec = 0;
if (width < 0) {
goto charswitch;
format++;
goto charswitch;
if (lflag) {
lflag++;
goto charswitch;
goto charswitch;
goto charswitch;
#ifndef _LP64
#ifndef _LP64
goto charswitch;
goto charswitch;
goto charswitch;
if (ll < 0) {
if (val < 0) {
long long tll;
#ifdef _WIDE
#ifdef _WIDE
*--bp = (char) \
#ifdef _WIDE
#ifdef _WIDE
n = qval;
#ifdef _WIDE
*--bp = (char) \
#ifdef _WIDE
if (quote) {
if (leadzeroes > 0) {
goto decimal;
prec == 0)
goto fixed;
#ifdef _WIDE
>> lradix;
if (qval == 0) {
>> lradix;
} while (qval != 0);
if (leadzeroes > 0) {
switch (fcode) {
#if defined(__sparc)
cvtbuf);
cvtbuf);
if (sign) {
p = &buf[0];
*p++ = decimal_point;
bp++;
*p++ = *bp++;
if (rz > 0) {
int nn;
if (nn < 0)
cvtbuf);
cvtbuf);
if (sign) {
p = &buf[0];
*p++ = decimal_point;
*p++ = *bp++;
if (rz > 0) {
if (nn < 0)
- suffix);
if (*bp == 0) {
goto e_merge;
if (sign) {
p = &buf[0];
} while (--nn > 0);
if (quote)
*p++ = decimal_point;
while (--nn >= 0)
else if (prec == 0)
#ifdef _WIDE
if (n < kk)
kk = (int)n;
--kk;
goto e_merge;
goto f_merge;
goto c_merge;
#ifndef _WIDE
goto charswitch;
#ifdef _WIDE
if (temp) {
buf[0] = 0;
if (temp) {
return (EOF);
buf[0] = 0;
if (lflag) {
goto wide_C;
#ifndef _WIDE
if (wflag) {
if (temp) {
buf[0] = 0;
long long temp;
#ifdef _WIDE
#ifdef _WIDE
#ifndef _WIDE
#ifdef _WIDE
if (!lflag) {
lflag++;
wcount = 0;
while (*wp) {
wcount++;
wp++;
p = wp;
if (!wflag)
wflag++;
wcount = 0;
while (*wp) {
int nbytes;
if (nbytes < 0) {
return (EOF);
wp++;
p = (char *)wp;
if (lflag) {
goto wide_S;
#ifdef _WIDE
return (EOF);
return (EOF);
return (EOF);
return (EOF);
int len;
return (EOF);
if (wflag) {
goto wide_hand;
goto mbs_err;
if ((nwc =
goto mbs_err;
sizeof (wchar_t);
== NULL) {
return (EOF);
sec_display = \
goto mbs_err;
if (wp)
if (prec == 0) {
p = bp;
if (wflag) {
wcount = 0;
while (*wp &&
if ((retcode =
wcount++;
wp++;
if (*wp)
p = (char *)wp;
ncol = 0;
while (*qp) {
qp++;
if (--prec == 0)
if ((ncol =
if (prec == 0)
if (prec < 0)
p = qp;
char *qp;
p = qp;
long long *svcount;
long *svcount;
short *svcount;
char *svcount;
int *svcount;
format--;
if (inf_nan) {
if (inf_nan_mixed_case) {
int upper;
if (sign) {
inf_nan = 0;
inf_nan_mixed_case = 0;
#ifdef _WIDE
k = sec_display;
#ifdef _WIDE
if (wflag) {
count += n;
if (wflag)
count += n;
if (width > k) {
if (prefixlength != 0)
#ifdef _WIDE
if (bp)
int cnt;
char *bufp;
long printn;
while (printn > 0) {
wp++;
printn--;
#ifdef _WIDE
#ifdef _WIDE
#ifdef _WIDE
ssize_t n;
curargno = 0;
if (curargno < 0)
flags = 0;
again:;
switch (*fmt++) {
goto again;
#ifndef _LP64
#ifndef _LP64
goto again;
goto again;
goto again;
goto again;
#ifdef _WIDE
int targno;
goto again;
goto again;
for (n = 0; n <= maxnum; n++) {
if (typelst[n] == 0)
switch (typelst[n]) {
case INT:
case LONG:
case CHAR_PTR:
case DOUBLE:
case LONG_DOUBLE:
case VOID_PTR:
case LONG_PTR:
case INT_PTR:
case LONG_LONG:
case LONG_LONG_PTR:
#ifdef _WIDE
#ifdef _WIDE
ssize_t n;
i = MAXARGS;
while (found) {
found = 0;
if (curargno <= 0)
if (i != curargno) {
curargno++;
flags = 0;
again:;
switch (*fmt++) {
goto again;
#ifndef _LP64
#ifndef _LP64
goto again;
goto again;
goto again;
goto again;
goto again;
goto again;
curargno = i;
#ifdef _WIDE
static wchar_t *
char thousep;
#ifdef _WIDE
char *grp_ptr;
return (ep);
for (i = 0; i < buf_index--; i++)
if (buf_index > 0) {
#ifdef _WIDE
ep++;
++grp_ptr;
--bufptr;
return (ep);
int col;
col = 0;
while (*wp && (n-- > 0)) {
col += i;
return (col);