Changeset c9857c6 in mainline for libc/generic/io/io.c


Ignore:
Timestamp:
2006-04-12T10:21:01Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f30e6a0b
Parents:
fcd10af
Message:

Printf support for width and precision modifiers.
Several necessary helping functions added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/io/io.c

    rfcd10af rc9857c6  
    3838        size_t count;
    3939       
     40        if (str == NULL) {
     41                return putnchars("(NULL)",6 );
     42        }
     43       
    4044        for (count = 0; str[count] != 0; count++);
    4145        if (write(1, (void * ) str, count) == count) {
     
    4852
    4953/** Put count chars from buffer to stdout without adding newline
    50  * @param buf Buffer with size at least count bytes
     54 * @param buf Buffer with size at least count bytes - NULL pointer NOT allowed!
    5155 * @param count
    5256 * @return 0 on succes, EOF on fail
     
    8084}
    8185
     86int putchar(int c)
     87{
     88        unsigned char ch = c;
     89        if (write(1, (void *)&ch , 1) == 1) {
     90                        return c;
     91        }
     92       
     93        return EOF;
     94}
     95
    8296ssize_t write(int fd, const void * buf, size_t count)
    8397{
Note: See TracChangeset for help on using the changeset viewer.