Rev 1693 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1693 | Rev 3065 | ||
---|---|---|---|
Line 451... | Line 451... | ||
451 | int base = 0; /* base argument to strtol/strtoul */ |
451 | int base = 0; /* base argument to strtol/strtoul */ |
452 | int nbytes = 1; /* number of bytes read from fmt string */ |
452 | int nbytes = 1; /* number of bytes read from fmt string */ |
453 | wchar_t wc; /* wchar to use to read format string */ |
453 | wchar_t wc; /* wchar to use to read format string */ |
454 | wchar_t *wcp; /* handy wide character pointer */ |
454 | wchar_t *wcp; /* handy wide character pointer */ |
455 | size_t mbslen; /* length of converted multibyte sequence */ |
455 | size_t mbslen; /* length of converted multibyte sequence */ |
- | 456 | #ifdef _MB_CAPABLE |
|
456 | mbstate_t state; /* value to keep track of multibyte state */ |
457 | mbstate_t state; /* value to keep track of multibyte state */ |
- | 458 | #endif |
|
Line 457... | Line 459... | ||
457 | 459 | ||
458 | #define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int)) |
460 | #define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int)) |
459 | u_long (*ccfn)CCFN_PARAMS=0; /* conversion function (strtol/strtoul) */ |
461 | u_long (*ccfn)CCFN_PARAMS=0; /* conversion function (strtol/strtoul) */ |
460 | char ccltab[256]; /* character class table for %[...] */ |
462 | char ccltab[256]; /* character class table for %[...] */ |
Line 492... | Line 494... | ||
492 | : va_arg (ap, void *))))) |
494 | : va_arg (ap, void *))))) |
493 | #else |
495 | #else |
494 | # define GET_ARG(n, ap, type) (va_arg (ap, type)) |
496 | # define GET_ARG(n, ap, type) (va_arg (ap, type)) |
495 | #endif |
497 | #endif |
Line 496... | Line -... | ||
496 | - | ||
497 | __sfp_lock_acquire (); |
498 | |
Line 498... | Line 499... | ||
498 | _flockfile (fp); |
499 | _flockfile (fp); |
Line 499... | Line 500... | ||
499 | 500 | ||
Line 793... | Line 794... | ||
793 | /* |
794 | /* |
794 | * Disgusting backwards compatibility hacks. XXX |
795 | * Disgusting backwards compatibility hacks. XXX |
795 | */ |
796 | */ |
796 | case '\0': /* compat */ |
797 | case '\0': /* compat */ |
797 | _funlockfile (fp); |
798 | _funlockfile (fp); |
798 | __sfp_lock_release (); |
- | |
799 | return EOF; |
799 | return EOF; |
Line 800... | Line 800... | ||
800 | 800 | ||
801 | default: /* compat */ |
801 | default: /* compat */ |
802 | if (isupper (c)) |
802 | if (isupper (c)) |
Line 1594... | Line 1594... | ||
1594 | /* On read failure, return EOF failure regardless of matches; errno |
1594 | /* On read failure, return EOF failure regardless of matches; errno |
1595 | should have been set prior to here. On EOF failure (including |
1595 | should have been set prior to here. On EOF failure (including |
1596 | invalid format string), return EOF if no matches yet, else number |
1596 | invalid format string), return EOF if no matches yet, else number |
1597 | of matches made prior to failure. */ |
1597 | of matches made prior to failure. */ |
1598 | _funlockfile (fp); |
1598 | _funlockfile (fp); |
1599 | __sfp_lock_release (); |
- | |
1600 | return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; |
1599 | return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; |
1601 | match_failure: |
1600 | match_failure: |
1602 | all_done: |
1601 | all_done: |
1603 | /* Return number of matches, which can be 0 on match failure. */ |
1602 | /* Return number of matches, which can be 0 on match failure. */ |
1604 | _funlockfile (fp); |
1603 | _funlockfile (fp); |
1605 | __sfp_lock_release (); |
- | |
1606 | return nassigned; |
1604 | return nassigned; |
1607 | } |
1605 | } |
Line 1608... | Line 1606... | ||
1608 | 1606 | ||
1609 | #ifndef _NO_POS_ARGS |
1607 | #ifndef _NO_POS_ARGS |