Added FORMAT information for our lint; Documented the _format routine

This commit is contained in:
ceriel 1989-02-07 11:17:22 +00:00
parent f3584b3d52
commit c64da88289
6 changed files with 48 additions and 5 deletions

View file

@ -8,6 +8,13 @@
#include <varargs.h>
#include "param.h"
/*FORMAT1 $
%s = char *
%l = long
%c = int
%[uxbo] = unsigned int
%d = int
$ */
doprnt(fp, fmt, argp)
File *fp;
char *fmt;

View file

@ -6,7 +6,7 @@
#include <varargs.h>
char *long2str();
extern char *long2str();
static int
integral(c)
@ -26,6 +26,13 @@ integral(c)
return 0;
}
/*FORMAT1 $
%s = char *
%l = long
%c = int
%[uxbo] = unsigned int
%d = int
$ */
int
_format(buf, fmt, argp)
char *buf, *fmt;

View file

@ -8,7 +8,13 @@
#include <system.h>
#include "param.h"
/*VARARGS*/
/*FORMAT1v $
%s = char *
%l = long
%c = int
%[uxbo] = unsigned int
%d = int
$ */
fprint(va_alist)
va_dcl
{

View file

@ -14,13 +14,18 @@ print, fprint, sprint, doprnt -- very simple formatted-output routines
.B File *filep;
.B char *format;
.PP
.B sprint(s, format [, arg] ... )
.B char *sprint(s, format [, arg] ... )
.B char *s, *format;
.PP
.B doprnt(filep, format, args)
.B File *filep;
.B char *format;
.B va_list args;
.PP
.B int _format(buf, format, args)
.B char *buf;
.B char *format;
.B va_list args;
.fi
.SH DESCRIPTION
.I Print
@ -90,6 +95,12 @@ Padding takes place only if the specified field width exceeds the actual width.
The printing routines build the string to be printed internally and use
.I sys_write
to print it.
.PP
The
.I _format
routine builds the string, but does not null-terminate it. It returns the
length of the string.
.PP
.I Doprnt
takes
.I args

View file

@ -8,7 +8,13 @@
#include <system.h>
#include "param.h"
/*VARARGS*/
/*FORMAT0v $
%s = char *
%l = long
%c = int
%[uxbo] = unsigned int
%d = int
$ */
print(va_alist)
va_dcl
{

View file

@ -8,7 +8,13 @@
#include <system.h>
#include "param.h"
/*VARARGS*/
/*FORMAT1v $
%s = char *
%l = long
%c = int
%[uxbo] = unsigned int
%d = int
$ */
char *
sprint(va_alist)
va_dcl