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 *);
_doprnt (fmt, ap, file);
if ( io_testflag(file,IO_PERPRINTF) )
fflush(file);
{
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 *);
retval = _doscanf (fp, format, ap);
{
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 *);
_doprnt (fmt, ap, stdout);
if ( io_testflag(stdout,IO_PERPRINTF) )
fflush(stdout);
{
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 *);
retval = _doscanf (stdin, format, ap);
{
char *format = va_arg(ap, char *);
retval = _doscanf (stdin, format, ap);
}
va_end(ap);
return retval;
}

View file

@ -3,24 +3,28 @@
#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 *);
_tempfile._fd = -1;
_tempfile._flags = IO_WRITEMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) buf;
_tempfile._ptr = (unsigned char *) buf;
_tempfile._count = 32767;
{
char *buf = va_arg(ap, char *);
char *format = va_arg(ap, char *);
FILE _tempfile;
_doprnt(format, ap, &_tempfile);
putc('\0',&_tempfile);
retval = buf;
_tempfile._fd = -1;
_tempfile._flags = IO_WRITEMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) buf;
_tempfile._ptr = (unsigned char *) buf;
_tempfile._count = 32767;
_doprnt(format, ap, &_tempfile);
putc('\0',&_tempfile);
}
va_end(ap);
return buf;
return retval;
}

View file

@ -3,24 +3,26 @@
#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 *);
_tempfile._fd = -1;
_tempfile._flags = IO_READMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) string;
_tempfile._ptr = (unsigned char *) string;
_tempfile._count = 32767;
{
char *string = va_arg(ap, char *);
char *format = va_arg(ap, char *);
FILE _tempfile;
retval = _doscanf (&_tempfile, format, ap);
_tempfile._fd = -1;
_tempfile._flags = IO_READMODE + IO_UNBUFF;
_tempfile._buf = (unsigned char *) string;
_tempfile._ptr = (unsigned char *) string;
_tempfile._count = 32767;
retval = _doscanf (&_tempfile, format, ap);
}
va_end(ap);
return retval;
}