3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 fmt \- string formatting routines
47 char* fmtbase(long \fInumber\fP, int \fIbase\fP, int \fIprefix\fP);
48 char* fmtdev(struct stat* \fIst\fP);
49 char* fmtelapsed(unsigned long \fIcount\fP, int \fIpersec\fP)
50 char* fmterror(int \fIerrno\fP);
51 char* fmtesc(const char* \fIstring\fP);
52 char* fmtfs(struct stat* \fIst\fP);
53 char* fmtgid(int \fIgid\fP);
54 char* fmtmatch(const char* \fIre\fP);
55 char* fmtmode(int \fImode\fP, int \fIexternal\fP);
56 char* fmtperm(int \fIperm\fP);
57 char* fmtre(const char* \fIpattern\fP);
58 char* fmtsignal(int \fIsig\fP);
59 char* fmttime(const char* \fIformat\fP, time_t \fItm\fP);
60 char* fmtuid(int \fIuid\fP);
63 These routines return a pointer to a formatted string for various numeric
65 Some routines may cache information to speed up the next call.
66 Most of the routines return a pointer to a private buffer, the
67 contents of which are overwritten on the next call to that routine.
70 routines have a corresponding
72 routine that converts in the other direction.
73 There is nothing spectacular about this collection other than that
74 it provides a single place where the exact format is spelled out.
83 then the base prefix is included in the formatted string.
88 then the output is signed base 10.
91 returns the device handle name specified by the
95 This is the device information displayed by
99 formats the elapsed time for
102 The two largest time units are used, limiting the return value length
103 to at most 6 characters.
131 returns the system error message text for the error number
135 formats non-ASCII characters in
140 These sequences are understood by
146 returns the file system type name corresponding to the
152 returns the group name for
158 equivalent pattern for the regular expression pattern
160 0 is returned for invalid
166 mode string for the file mode bits in
179 permission string for the permission bits in
183 returns the regular expression
184 equivalent pattern for the
188 0 is returned for invalid
192 returns the signal name, sans
194 for the signal number
198 then the description text for
203 returns the results of
204 .I "tmfmt(buf,sizeof(buf),format,tm)"
205 in the private buffer
209 returns the user name for