Subversion Repositories HelenOS

Rev

Rev 2229 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2229 Rev 2230
Line 38... Line 38...
38
#include <unistd.h>
38
#include <unistd.h>
39
#include <stdio.h>
39
#include <stdio.h>
40
#include <io/printf_core.h>
40
#include <io/printf_core.h>
41
#include <ctype.h>
41
#include <ctype.h>
42
#include <string.h>
42
#include <string.h>
43
#include <async.h>  /* for pseudo thread serialization */
-
 
44
 
43
 
45
#define __PRINTF_FLAG_PREFIX        0x00000001  /**< show prefixes 0x or 0*/
44
#define __PRINTF_FLAG_PREFIX        0x00000001  /**< show prefixes 0x or 0*/
46
#define __PRINTF_FLAG_SIGNED        0x00000002  /**< signed / unsigned number */
45
#define __PRINTF_FLAG_SIGNED        0x00000002  /**< signed / unsigned number */
47
#define __PRINTF_FLAG_ZEROPADDED    0x00000004  /**< print leading zeroes */
46
#define __PRINTF_FLAG_ZEROPADDED    0x00000004  /**< print leading zeroes */
48
#define __PRINTF_FLAG_LEFTALIGNED   0x00000010  /**< align to left */
47
#define __PRINTF_FLAG_LEFTALIGNED   0x00000010  /**< align to left */
Line 442... Line 441...
442
    uint64_t number; /* argument value */
441
    uint64_t number; /* argument value */
443
    size_t  size; /* byte size of integer parameter */
442
    size_t  size; /* byte size of integer parameter */
444
    int width, precision;
443
    int width, precision;
445
    uint64_t flags;
444
    uint64_t flags;
446
   
445
   
447
    /* Don't let other pseudo threads interfere. */
-
 
448
    async_serialize_start();
-
 
449
   
-
 
450
    counter = 0;
446
    counter = 0;
451
   
447
   
452
    while ((c = fmt[i])) {
448
    while ((c = fmt[i])) {
453
        /* control character */
449
        /* control character */
454
        if (c == '%' ) {
450
        if (c == '%' ) {
Line 676... Line 672...
676
            goto minus_out;
672
            goto minus_out;
677
        }
673
        }
678
        counter += retval;
674
        counter += retval;
679
    }
675
    }
680
   
676
   
681
    async_serialize_end();
-
 
682
    return counter;
677
    return counter;
683
minus_out:
678
minus_out:
684
    async_serialize_end();
-
 
685
    return -counter;
679
    return -counter;
686
}
680
}
687
 
681
 
688
/** @}
682
/** @}
689
 */
683
 */