source:
buchla-68k/libcio/fprintf.c@
bc11fc1
Last change on this file since bc11fc1 was 7258c6a, checked in by , 8 years ago | |
---|---|
|
|
File size: 744 bytes |
Rev | Line | |
---|---|---|
[f40a309] | 1 | /* |
2 | ============================================================================= | |
3 | fprintf.c -- fprintf function | |
4 | Version 2 -- 1987-06-26 -- D.N. Lynx Crowe | |
5 | ============================================================================= | |
6 | */ | |
7 | ||
8 | #include "stdio.h" | |
9 | #include "stddefs.h" | |
[bfc0072] | 10 | #include "stdarg.h" |
[f40a309] | 11 | |
12 | static FILE *Stream; | |
13 | ||
[7258c6a] | 14 | extern int32_t dofmt_(int16_t (*putsub)(), int8_t *format, va_list args); |
15 | extern int16_t aputc(int16_t c, FILE *ptr); | |
[f40a309] | 16 | |
[7258c6a] | 17 | static int16_t fpsub(int16_t c); |
[df097bf] | 18 | |
[7258c6a] | 19 | int16_t fprintf(FILE *stream, int8_t *fmt, ...) |
[f40a309] | 20 | { |
[7258c6a] | 21 | register int16_t count; |
[f40a309] | 22 | va_list aptr; |
23 | ||
24 | Stream = stream; | |
[bfc0072] | 25 | va_start(aptr, fmt); |
[ab83141] | 26 | count = dofmt_(fpsub, fmt, aptr); |
[f40a309] | 27 | va_end(aptr); |
28 | return(count); | |
29 | } | |
30 | ||
[7258c6a] | 31 | static int16_t fpsub(int16_t c) |
[f40a309] | 32 | { |
33 | return(aputc(c, Stream)); | |
34 | } |
Note:
See TracBrowser
for help on using the repository browser.