Added FORMAT information for our lint; Documented the _format routine
authorceriel <none@none>
Tue, 7 Feb 1989 11:17:22 +0000 (11:17 +0000)
committerceriel <none@none>
Tue, 7 Feb 1989 11:17:22 +0000 (11:17 +0000)
modules/src/print/doprnt.c
modules/src/print/format.c
modules/src/print/fprint.c
modules/src/print/print.3
modules/src/print/print.c
modules/src/print/sprint.c

index dd70922..a30d5c9 100644 (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;
index 34aabbb..392f5f4 100644 (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;
index 027cec1..fe5f593 100644 (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
 {
index d79430a..8688606 100644 (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
index b92c742..1d99a8d 100644 (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
 {
index 51f708e..ba4361b 100644 (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