Subversion Repositories HelenOS

Rev

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

Rev 4296 Rev 4537
Line 44... Line 44...
44
SPINLOCK_INITIALIZE(printf_lock);  /**< vprintf spinlock */
44
SPINLOCK_INITIALIZE(printf_lock);  /**< vprintf spinlock */
45
 
45
 
46
static int vprintf_str_write(const char *str, size_t size, void *data)
46
static int vprintf_str_write(const char *str, size_t size, void *data)
47
{
47
{
48
    size_t offset = 0;
48
    size_t offset = 0;
49
    count_t chars = 0;
49
    size_t chars = 0;
50
   
50
   
51
    while (offset < size) {
51
    while (offset < size) {
52
        putchar(str_decode(str, &offset, size));
52
        putchar(str_decode(str, &offset, size));
53
        chars++;
53
        chars++;
54
    }
54
    }
Line 57... Line 57...
57
}
57
}
58
 
58
 
59
static int vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
59
static int vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
60
{
60
{
61
    size_t offset = 0;
61
    size_t offset = 0;
62
    count_t chars = 0;
62
    size_t chars = 0;
63
   
63
   
64
    while (offset < size) {
64
    while (offset < size) {
65
        putchar(str[chars]);
65
        putchar(str[chars]);
66
        chars++;
66
        chars++;
67
        offset += sizeof(wchar_t);
67
        offset += sizeof(wchar_t);
Line 71... Line 71...
71
}
71
}
72
 
72
 
73
int puts(const char *str)
73
int puts(const char *str)
74
{
74
{
75
    size_t offset = 0;
75
    size_t offset = 0;
76
    count_t chars = 0;
76
    size_t chars = 0;
77
    wchar_t uc;
77
    wchar_t uc;
78
   
78
   
79
    while ((uc = str_decode(str, &offset, STR_NO_LIMIT)) != 0) {
79
    while ((uc = str_decode(str, &offset, STR_NO_LIMIT)) != 0) {
80
        putchar(uc);
80
        putchar(uc);
81
        chars++;
81
        chars++;