Changeset 6fa9a99d in mainline for uspace/lib/c


Ignore:
Timestamp:
2014-01-05T17:50:01Z (12 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91db0280
Parents:
208b5f5
Message:

Rename klog to kio

Location:
uspace/lib/c
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r208b5f5 r6fa9a99d  
    107107        generic/io/log.c \
    108108        generic/io/logctl.c \
    109         generic/io/klog.c \
     109        generic/io/kio.c \
    110110        generic/io/snprintf.c \
    111111        generic/io/vprintf.c \
  • uspace/lib/c/generic/assert.c

    r208b5f5 r6fa9a99d  
    3333#include <assert.h>
    3434#include <stdio.h>
    35 #include <io/klog.h>
     35#include <io/kio.h>
    3636#include <stdlib.h>
    3737#include <atomic.h>
     
    4444{
    4545        /*
    46          * Send the message safely to klog. Nested asserts should not occur.
     46         * Send the message safely to kio. Nested asserts should not occur.
    4747         */
    48         klog_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
     48        kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
    4949            cond, file, line);
    5050       
  • uspace/lib/c/generic/io/io.c

    r208b5f5 r6fa9a99d  
    4242#include <malloc.h>
    4343#include <async.h>
    44 #include <io/klog.h>
     44#include <io/kio.h>
    4545#include <vfs/vfs.h>
    4646#include <vfs/vfs_sess.h>
     
    5757        .error = true,
    5858        .eof = true,
    59         .klog = false,
     59        .kio = false,
    6060        .sess = NULL,
    6161        .btype = _IONBF,
     
    6767};
    6868
    69 static FILE stdout_klog = {
     69static FILE stdout_kio = {
    7070        .fd = -1,
    7171        .error = false,
    7272        .eof = false,
    73         .klog = true,
     73        .kio = true,
    7474        .sess = NULL,
    7575        .btype = _IOLBF,
     
    8181};
    8282
    83 static FILE stderr_klog = {
     83static FILE stderr_kio = {
    8484        .fd = -1,
    8585        .error = false,
    8686        .eof = false,
    87         .klog = true,
     87        .kio = true,
    8888        .sess = NULL,
    8989        .btype = _IONBF,
     
    113113                stdout = fdopen(1, "w");
    114114        } else {
    115                 stdout = &stdout_klog;
     115                stdout = &stdout_kio;
    116116                list_append(&stdout->link, &files);
    117117        }
     
    120120                stderr = fdopen(2, "w");
    121121        } else {
    122                 stderr = &stderr_klog;
     122                stderr = &stderr_kio;
    123123                list_append(&stderr->link, &files);
    124124        }
     
    267267        stream->error = false;
    268268        stream->eof = false;
    269         stream->klog = false;
     269        stream->kio = false;
    270270        stream->sess = NULL;
    271271        stream->need_sync = false;
     
    289289        stream->error = false;
    290290        stream->eof = false;
    291         stream->klog = false;
     291        stream->kio = false;
    292292        stream->sess = NULL;
    293293        stream->need_sync = false;
     
    314314       
    315315        if ((stream != &stdin_null)
    316             && (stream != &stdout_klog)
    317             && (stream != &stderr_klog))
     316            && (stream != &stdout_kio)
     317            && (stream != &stderr_kio))
    318318                free(stream);
    319319       
     
    382382                ssize_t wr;
    383383               
    384                 if (stream->klog)
    385                         wr = klog_write(buf + done, left);
     384                if (stream->kio)
     385                        wr = kio_write(buf + done, left);
    386386                else
    387387                        wr = write(stream->fd, buf + done, left);
     
    705705        _fflushbuf(stream);
    706706       
    707         if (stream->klog) {
    708                 klog_update();
     707        if (stream->kio) {
     708                kio_update();
    709709                return EOK;
    710710        }
     
    740740int fileno(FILE *stream)
    741741{
    742         if (stream->klog) {
     742        if (stream->kio) {
    743743                errno = EBADF;
    744744                return -1;
  • uspace/lib/c/generic/io/kio.c

    r208b5f5 r6fa9a99d  
    3939#include <unistd.h>
    4040#include <errno.h>
    41 #include <abi/klog.h>
    42 #include <io/klog.h>
     41#include <abi/kio.h>
     42#include <io/kio.h>
    4343#include <io/printf_core.h>
    4444
    45 size_t klog_write(const void *buf, size_t size)
     45size_t kio_write(const void *buf, size_t size)
    4646{
    47         ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, size);
     47        ssize_t ret = (ssize_t) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size);
    4848       
    4949        if (ret >= 0)
     
    5353}
    5454
    55 void klog_update(void)
     55void kio_update(void)
    5656{
    57         (void) __SYSCALL3(SYS_KLOG, KLOG_UPDATE, (uintptr_t) NULL, 0);
     57        (void) __SYSCALL3(SYS_KIO, KIO_UPDATE, (uintptr_t) NULL, 0);
    5858}
    5959
    60 void klog_command(const void *buf, size_t size)
     60void kio_command(const void *buf, size_t size)
    6161{
    62         (void) __SYSCALL3(SYS_KLOG, KLOG_COMMAND, (sysarg_t) buf, (sysarg_t) size);
     62        (void) __SYSCALL3(SYS_KIO, KIO_COMMAND, (sysarg_t) buf, (sysarg_t) size);
    6363}
    6464
    65 /** Print formatted text to klog.
     65/** Print formatted text to kio.
    6666 *
    6767 * @param fmt Format string
     
    7070 *
    7171 */
    72 int klog_printf(const char *fmt, ...)
     72int kio_printf(const char *fmt, ...)
    7373{
    7474        va_list args;
    7575        va_start(args, fmt);
    7676       
    77         int ret = klog_vprintf(fmt, args);
     77        int ret = kio_vprintf(fmt, args);
    7878       
    7979        va_end(args);
     
    8282}
    8383
    84 static int klog_vprintf_str_write(const char *str, size_t size, void *data)
     84static int kio_vprintf_str_write(const char *str, size_t size, void *data)
    8585{
    86         size_t wr = klog_write(str, size);
     86        size_t wr = kio_write(str, size);
    8787        return str_nlength(str, wr);
    8888}
    8989
    90 static int klog_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
     90static int kio_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
    9191{
    9292        size_t offset = 0;
     
    9898               
    9999                if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK)
    100                         klog_write(buf, sz);
     100                        kio_write(buf, sz);
    101101               
    102102                chars++;
     
    107107}
    108108
    109 /** Print formatted text to klog.
     109/** Print formatted text to kio.
    110110 *
    111111 * @param fmt Format string
     
    115115 *
    116116 */
    117 int klog_vprintf(const char *fmt, va_list ap)
     117int kio_vprintf(const char *fmt, va_list ap)
    118118{
    119119        printf_spec_t ps = {
    120                 klog_vprintf_str_write,
    121                 klog_vprintf_wstr_write,
     120                kio_vprintf_str_write,
     121                kio_vprintf_wstr_write,
    122122                NULL
    123123        };
  • uspace/lib/c/generic/private/stdio.h

    r208b5f5 r6fa9a99d  
    5353        int eof;
    5454       
    55         /** Klog indicator */
    56         int klog;
     55        /** KIO indicator */
     56        int kio;
    5757       
    5858        /** Session to the file provider */
  • uspace/lib/c/include/io/kio.h

    r208b5f5 r6fa9a99d  
    3333 */
    3434
    35 #ifndef LIBC_IO_KLOG_H_
    36 #define LIBC_IO_KLOG_H_
     35#ifndef LIBC_IO_KIO_H_
     36#define LIBC_IO_KIO_H_
    3737
    3838#include <sys/types.h>
     
    4040#include <io/verify.h>
    4141
    42 extern size_t klog_write(const void *, size_t);
    43 extern void klog_update(void);
    44 extern void klog_command(const void *, size_t);
    45 extern int klog_printf(const char *, ...)
     42extern size_t kio_write(const void *, size_t);
     43extern void kio_update(void);
     44extern void kio_command(const void *, size_t);
     45extern int kio_printf(const char *, ...)
    4646    PRINTF_ATTRIBUTE(1, 2);
    47 extern int klog_vprintf(const char *, va_list);
     47extern int kio_vprintf(const char *, va_list);
    4848
    4949#endif
  • uspace/lib/c/include/stdio.h

    r208b5f5 r6fa9a99d  
    4040#include <str.h>
    4141#include <io/verify.h>
    42 #include <abi/klog.h>
     42#include <abi/kio.h>
    4343
    4444#define EOF  (-1)
     
    5252                int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
    5353                if (_n > 0) \
    54                         (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \
     54                        (void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \
    5555        }
    5656
Note: See TracChangeset for help on using the changeset viewer.