/* @(#)doscan.c 4.1 (Berkeley) 12/21/80 */
int **ptr
, fileended
, size
;
for (;;) switch (ch
= *fmt
++) {
if ((ch
= *fmt
++) == '%')
if (_innum(ptr
, ch
, len
, size
, iop
, &fileended
) && ptr
)
return(nmatch
? nmatch
: -1);
while ((ch1
= getc(iop
))==' ' || ch1
=='\t' || ch1
=='\n')
_innum(ptr
, type
, len
, size
, iop
, eofptr
)
int expseen
, scale
, negflg
, c1
, ndigit
;
if (type
=='c' || type
=='s' || type
=='[')
return(_instr(ptr
? *(char **)ptr
: (char *)NULL
, type
, len
, iop
, eofptr
));
if (type
=='e'||type
=='f')
while ((c
= getc(iop
))==' ' || c
=='\t' || c
=='\n');
for ( ; --len
>=0; *np
++ = c
, c
= getc(iop
)) {
|| base
==16 && ('a'<=c
&& c
<='f' || 'A'<=c
&& c
<='F')) {
lcval
= ((lcval
<<2) + lcval
)<<1;
else if ('a'<=c
&& c
<='f')
if (base
!=10 || scale
==INT
)
} else if ((c
=='e'||c
=='E') && expseen
==0) {
if (base
!=10 || scale
==INT
|| ndigit
==0)
if (c
!='+'&&c
!='-'&&('0'>c
||c
>'9'))
if (ptr
==NULL
|| np
==numbuf
)
switch((scale
<<4) | size
) {
case (FLOAT
<<4) | REGULAR
:
**(float **)ptr
= atof(numbuf
);
**(double **)ptr
= atof(numbuf
);
_instr(ptr
, type
, len
, iop
, eofptr
)
register struct _iobuf
*iop
;
if (type
=='c' && len
==30000)
while (_sctab
[ch
= getc(iop
)] & ignstp
)
while (ch
!=EOF
&& (_sctab
[ch
]&ignstp
)==0) {
for (c
= 0; c
< 128; c
++)
while (((c
= *s
++)&0177) != ']') {