Subversion Repositories HelenOS

Rev

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

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