home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
graphics
/
utilities
/
gifmachine_458
/
sources
/
myprintf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-15
|
712b
|
39 lines
#include <proto/dos.h>
#include <stdarg.h>
void RawDoFmt(char *, APTR, void(*)(), APTR);
#pragma syscall RawDoFmt 20a ba9804
void __stdargs MyPrintf(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
VPrintf((UBYTE *)fmt, (LONG *)args);
Flush(Output());
va_end(args);
}
static void __regargs MySPrintfSupp(char);
void __stdargs MySPrintf(char *buf, char *fmt, ...)
{
va_list args;
va_start(args, fmt);
RawDoFmt(fmt, (APTR)args, MySPrintfSupp, (APTR)buf)
va_end(args);
}
extern long __builtin_getreg(int);
extern void __builtin_putreg(int, char *);
static void __regargs MySPrintfSupp(char Char)
{
char *ptr;
ptr = (char *)__builtin_getreg(11);
*ptr++ = Char;
__builtin_putreg(11, ptr);
}