Subversion Repositories HelenOS

Rev

Rev 4541 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4541 Rev 4601
Line 35... Line 35...
35
#ifndef LIBC_STDIO_H_
35
#ifndef LIBC_STDIO_H_
36
#define LIBC_STDIO_H_
36
#define LIBC_STDIO_H_
37
 
37
 
38
#include <sys/types.h>
38
#include <sys/types.h>
39
#include <stdarg.h>
39
#include <stdarg.h>
-
 
40
#include <string.h>
40
#include <adt/list.h>
41
#include <adt/list.h>
41
 
42
 
42
#define EOF  (-1)
43
#define EOF  (-1)
43
 
44
 
44
/** Default size for stream I/O buffers */
45
/** Default size for stream I/O buffers */
45
#define BUFSIZ 4096
46
#define BUFSIZ  4096
46
 
47
 
47
#define DEBUG(fmt, ...) \
48
#define DEBUG(fmt, ...) \
48
{ \
49
    { \
49
    char buf[256]; \
50
        char _buf[256]; \
50
    int n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \
51
        int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
51
    if (n > 0) \
52
        if (_n > 0) \
52
        (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, str_size(buf)); \
53
            (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \
53
}
54
    }
54
 
55
 
55
#ifndef SEEK_SET
56
#ifndef SEEK_SET
56
    #define SEEK_SET  0
57
    #define SEEK_SET  0
57
    #define SEEK_CUR  1
58
    #define SEEK_CUR  1
58
    #define SEEK_END  2
59
    #define SEEK_END  2