Lines Matching +full:3 +full:base +full:- +full:x

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
18 * 3. Neither the name of the University nor the names of its contributors
70 #define SIGNOK 0x40 /* +/- is (still) legal */
74 #define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
76 #define PFXOK 0x100 /* 0x prefix is (still) legal */
85 #define CT_INT 3 /* integer, i.e., strtoq or strtouq */
116 int base; /* base argument to strtoq/strtouq */ in vsscanf() local
123 { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; in vsscanf()
130 base = 0; /* XXX just to keep gcc happy */ in vsscanf()
138 nread++, inr--, inp++; in vsscanf()
157 inr--, inp++; in vsscanf()
193 case '0': case '1': case '2': case '3': case '4': in vsscanf()
195 width = width * 10 + c - '0'; in vsscanf()
205 base = 10; in vsscanf()
211 base = 0; in vsscanf()
217 base = 8; in vsscanf()
223 base = 10; in vsscanf()
226 case 'x': in vsscanf()
227 flags |= PFXOK; /* enable 0x prefixing */ in vsscanf()
230 base = 16; in vsscanf()
252 base = 16; in vsscanf()
291 if (--inr > 0) in vsscanf()
316 width -= n; in vsscanf()
323 inr -= width; in vsscanf()
331 inr -= width; in vsscanf()
347 n++, inr--, inp++; in vsscanf()
348 if (--width == 0) in vsscanf()
361 inr--; in vsscanf()
363 if (--width == 0) in vsscanf()
371 n = p - p0; in vsscanf()
382 /* like CCL, but zero-length string OK, & no NOSKIP */ in vsscanf()
388 n++, inr--, inp++; in vsscanf()
389 if (--width == 0) in vsscanf()
398 inr--; in vsscanf()
400 if (--width == 0) in vsscanf()
406 nread += p - p0; in vsscanf()
415 if (width == 0 || width > sizeof(buf) - 1) in vsscanf()
416 width = sizeof(buf) - 1; in vsscanf()
419 if (--width > sizeof(buf) - 2) in vsscanf()
420 width = sizeof(buf) - 2; in vsscanf()
424 for (p = buf; width; width--) { in vsscanf()
436 * base==0. In that case, we should set in vsscanf()
437 * it to 8 and enable 0x prefixing. in vsscanf()
444 if (base == 0) { in vsscanf()
445 base = 8; in vsscanf()
455 case '1': case '2': case '3': in vsscanf()
457 base = basefix[base]; in vsscanf()
463 base = basefix[base]; in vsscanf()
464 if (base <= 8) in vsscanf()
474 /* no need to fix base here */ in vsscanf()
475 if (base <= 10) in vsscanf()
481 case '+': case '-': in vsscanf()
488 /* x ok iff flag still set & 2nd char */ in vsscanf()
489 case 'x': case 'X': in vsscanf()
491 base = 16; /* if %i */ in vsscanf()
508 if (--inr > 0) in vsscanf()
515 * back the sign. If the number ends in `x', in vsscanf()
516 * it was [sign] '0' 'x', so push back the x in vsscanf()
521 inp--; in vsscanf()
526 c = ((u_char *)p)[-1]; in vsscanf()
527 if (c == 'x' || c == 'X') { in vsscanf()
528 --p; in vsscanf()
529 inp--; in vsscanf()
536 res = (*ccfn)(buf, (char **)NULL, base); in vsscanf()
558 nread += p - buf; in vsscanf()
564 return (nconversions != 0 ? nassigned : -1); in vsscanf()
593 return (fmt - 1);/* format ended before closing ] */ in __sccl()
599 * The first character may be ']' (or '-') without being special; in __sccl()
600 * the last character may be '-'. in __sccl()
602 v = 1 - v; in __sccl()
609 return (fmt - 1); in __sccl()
611 case '-': in __sccl()
614 * [01+-] in __sccl()
616 * the character +, the character -', but in __sccl()
618 * [a-zA-Z0-9] in __sccl()
620 * scanf treats `a-z' as `the letters a through in __sccl()
621 * z', but treats `a-a' as `the letter a, the in __sccl()
622 * character -, and the letter a'. in __sccl()
624 * For compatibility, the `-' is not considered in __sccl()
632 c = '-'; in __sccl()
643 * such as [a-c-e] as `the letters a through e'. in __sccl()