Rev 3022 | Rev 4201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3022 | Rev 4055 | ||
---|---|---|---|
Line 47... | Line 47... | ||
47 | { \ |
47 | { \ |
48 | char buf[256]; \ |
48 | char buf[256]; \ |
49 | int n; \ |
49 | int n; \ |
50 | n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \ |
50 | n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \ |
51 | if (n > 0) \ |
51 | if (n > 0) \ |
52 | (void) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, strlen(buf)); \ |
52 | (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, strlen(buf)); \ |
53 | } |
53 | } |
54 | 54 | ||
- | 55 | typedef struct { |
|
- | 56 | /** Underlying file descriptor. */ |
|
- | 57 | int fd; |
|
- | 58 | ||
- | 59 | /** Error indicator. */ |
|
- | 60 | int error; |
|
- | 61 | ||
- | 62 | /** End-of-file indicator. */ |
|
- | 63 | int eof; |
|
- | 64 | } FILE; |
|
- | 65 | ||
55 | extern int getchar(void); |
66 | extern FILE *stdin, *stdout, *stderr; |
56 | 67 | ||
57 | extern int puts(const char * str); |
- | |
58 | extern int putchar(int c); |
68 | extern int getchar(void); |
59 | 69 | ||
60 | extern int printf(const char *fmt, ...); |
70 | extern int puts(const char *); |
61 | extern int sprintf(char *str, const char *fmt, ...); |
- | |
62 | extern int snprintf(char *str, size_t size, const char *fmt, ...); |
- | |
63 | - | ||
64 | extern int vprintf(const char *fmt, va_list ap); |
71 | extern int putchar(int); |
65 | extern int vsprintf(char *str, const char *fmt, va_list ap); |
- | |
66 | extern int vsnprintf(char *str, size_t size, const char *fmt, va_list ap); |
- | |
67 | 72 | ||
- | 73 | extern int printf(const char *, ...); |
|
- | 74 | extern int asprintf(char **, const char *, ...); |
|
- | 75 | extern int sprintf(char *, const char *, ...); |
|
68 | #define fprintf(f, fmt, ...) printf(fmt, ##__VA_ARGS__) |
76 | extern int snprintf(char *, size_t , const char *, ...); |
- | 77 | ||
- | 78 | extern int vprintf(const char *, va_list); |
|
- | 79 | extern int vsprintf(char *, const char *, va_list); |
|
- | 80 | extern int vsnprintf(char *, size_t, const char *, va_list); |
|
69 | 81 | ||
70 | extern int rename(const char *, const char *); |
82 | extern int rename(const char *, const char *); |
71 | 83 | ||
- | 84 | extern FILE *fopen(const char *, const char *); |
|
- | 85 | extern int fclose(FILE *); |
|
- | 86 | extern size_t fread(void *, size_t, size_t, FILE *); |
|
- | 87 | extern size_t fwrite(const void *, size_t, size_t, FILE *); |
|
- | 88 | extern int feof(FILE *); |
|
- | 89 | extern int ferror(FILE *); |
|
- | 90 | extern void clearerr(FILE *); |
|
- | 91 | ||
- | 92 | extern int fgetc(FILE *); |
|
- | 93 | extern int fputc(int, FILE *); |
|
- | 94 | extern int fputs(const char *, FILE *); |
|
- | 95 | ||
- | 96 | extern int fprintf(FILE *, const char *, ...); |
|
- | 97 | extern int vfprintf(FILE *, const char *, va_list); |
|
- | 98 | ||
- | 99 | #define getc fgetc |
|
- | 100 | #define putc fputc |
|
- | 101 | ||
- | 102 | extern int fseek(FILE *, long, int); |
|
- | 103 | ||
- | 104 | #ifndef SEEK_SET |
|
- | 105 | #define SEEK_SET 0 |
|
- | 106 | #define SEEK_CUR 1 |
|
- | 107 | #define SEEK_END 2 |
|
- | 108 | #endif |
|
- | 109 | ||
72 | #endif |
110 | #endif |
73 | 111 | ||
74 | /** @} |
112 | /** @} |
75 | */ |
113 | */ |