Rev 4338 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4338 | Rev 4348 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | 36 | ||
37 | #include <stdio.h> |
37 | #include <stdio.h> |
38 | #include <sys/types.h> |
38 | #include <sys/types.h> |
39 | #include <io/printf_core.h> |
39 | #include <io/printf_core.h> |
40 | 40 | ||
41 | static int vfprintf_write(const char *s, size_t count, void *f) |
41 | static int vfprintf_str_write(const char *s, size_t size, void *f) |
42 | { |
42 | { |
- | 43 | /* FIXME: Should return number of characters? */ |
|
43 | return fwrite(s, 1, count, (FILE *) f); |
44 | return fwrite(s, 1, size, (FILE *) f); |
- | 45 | } |
|
- | 46 | ||
- | 47 | static int vfprintf_wstr_write(const char *s, size_t size, void *f) |
|
- | 48 | { |
|
- | 49 | /* TODO */ |
|
- | 50 | return size; |
|
44 | } |
51 | } |
45 | 52 | ||
46 | int vfprintf(FILE *f, const char *fmt, va_list ap) |
53 | int vfprintf(FILE *f, const char *fmt, va_list ap) |
47 | { |
54 | { |
48 | struct printf_spec ps = { |
55 | struct printf_spec ps = { |
- | 56 | vfprintf_str_write, |
|
49 | (int (*)(void *, size_t, void *)) vfprintf_write, |
57 | vfprintf_wstr_write, |
50 | (void *) f |
58 | (void *) f |
51 | }; |
59 | }; |
52 | 60 | ||
53 | return printf_core(fmt, &ps, ap); |
61 | return printf_core(fmt, &ps, ap); |
54 | } |
62 | } |