improved layout

This commit is contained in:
ceriel 1988-04-25 16:17:29 +00:00
parent 6607dc999e
commit 71dd29ae30
6 changed files with 63 additions and 49 deletions

View file

@ -3,17 +3,18 @@
#include <varargs.h>
fprintf(va_alist)
va_dcl
va_dcl
{
FILE *file;
char *fmt;
va_list ap;
va_start(ap);
file = va_arg(ap, FILE *);
fmt = va_arg(ap, char *);
{
FILE *file = va_arg(ap, FILE *);
char *fmt = va_arg(ap, char *);
_doprnt (fmt, ap, file);
if ( io_testflag(file,IO_PERPRINTF) )
fflush(file);
}
va_end(ap);
}

View file

@ -3,18 +3,20 @@
#include <varargs.h>
int fscanf(va_alist)
va_dcl
va_dcl
{
FILE *fp;
char *format;
va_list ap;
int retval;
va_start(ap);
fp = va_arg(ap, FILE *);
format = va_arg(ap, char *);
{
FILE *fp = va_arg(ap, FILE *);
char *format = va_arg(ap, char *);
retval = _doscanf (fp, format, ap);
}
va_end(ap);
return retval;
}

View file

@ -3,15 +3,17 @@
#include <varargs.h>
printf(va_alist)
va_dcl
va_dcl
{
char *fmt;
va_list ap;
va_start(ap);
fmt = va_arg(ap, char *);
{
char *fmt = va_arg(ap, char *);
_doprnt (fmt, ap, stdout);
if ( io_testflag(stdout,IO_PERPRINTF) )
fflush(stdout);
}
va_end(ap);
}

View file

@ -3,16 +3,19 @@
#include <varargs.h>
int scanf(va_alist)
va_dcl
va_dcl
{
char *format;
va_list ap;
int retval;
va_start(ap);
format = va_arg(ap, char *);
{
char *format = va_arg(ap, char *);
retval = _doscanf (stdin, format, ap);
}
va_end(ap);
return retval;
}

View file

@ -3,15 +3,18 @@
#include <varargs.h>
char *sprintf(va_alist)
va_dcl
va_dcl
{
char *buf, *format;
FILE _tempfile;
va_list ap;
char *retval;
va_start(ap);
buf = va_arg(ap, char *);
format = va_arg(ap, char *);
{
char *buf = va_arg(ap, char *);
char *format = va_arg(ap, char *);
FILE _tempfile;
retval = buf;
_tempfile._fd = -1;
_tempfile._flags = IO_WRITEMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) buf;
@ -20,7 +23,8 @@ va_dcl
_doprnt(format, ap, &_tempfile);
putc('\0',&_tempfile);
}
va_end(ap);
return buf;
return retval;
}

View file

@ -3,17 +3,17 @@
#include <varargs.h>
int sscanf(va_alist)
va_dcl
va_dcl
{
char *string; /* source of data */
char *format; /* control string */
FILE _tempfile;
va_list ap;
int retval;
va_start(ap);
string = va_arg(ap, char *);
format = va_arg(ap, char *);
{
char *string = va_arg(ap, char *);
char *format = va_arg(ap, char *);
FILE _tempfile;
_tempfile._fd = -1;
_tempfile._flags = IO_READMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) string;
@ -21,6 +21,8 @@ va_dcl
_tempfile._count = 32767;
retval = _doscanf (&_tempfile, format, ap);
}
va_end(ap);
return retval;
}