aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-12-19 07:19:23 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-12-19 07:19:23 +0000
commita6e2f12821cc5cf9fb0edfabba3088b460990402 (patch)
tree88b0751fd5d6bb39fc37b84abc29c4b61b556953 /man3
parent088a639be38030f6b6bfd344fb30636a85b207a4 (diff)
downloadman-pages-a6e2f12821cc5cf9fb0edfabba3088b460990402.tar.gz
Make the standard indent for code samples, shell session
logs, etc. to be ".in +4n".
Diffstat (limited to 'man3')
-rw-r--r--man3/basename.34
-rw-r--r--man3/bsearch.37
-rw-r--r--man3/dlopen.38
-rw-r--r--man3/errno.38
-rw-r--r--man3/getsubopt.34
-rw-r--r--man3/mbrtowc.34
-rw-r--r--man3/printf.34
-rw-r--r--man3/rand.331
-rw-r--r--man3/realpath.34
-rw-r--r--man3/setaliasent.34
-rw-r--r--man3/setbuf.38
-rw-r--r--man3/stdarg.328
-rw-r--r--man3/strfmon.312
-rw-r--r--man3/termios.34
-rw-r--r--man3/timegm.34
-rw-r--r--man3/usleep.34
16 files changed, 69 insertions, 69 deletions
diff --git a/man3/basename.3 b/man3/basename.3
index e35edf2d55..e24201266c 100644
--- a/man3/basename.3
+++ b/man3/basename.3
@@ -154,7 +154,7 @@ Before glibc 2.2.1, the glibc version of
did not correctly handle pathnames with trailing '/' characters,
and generated a segfault if given a NULL argument.
.SH EXAMPLE
-.RS
+.in +4n
.nf
char *dirc, *basec, *bname, *dname;
char *path = "/etc/passwd";
@@ -165,7 +165,7 @@ dname = dirname(dirc);
bname = basename(basec);
printf("dirname=%s, basename=%s\\n", dname, bname);
.fi
-.RE
+.in
.SH "SEE ALSO"
.BR basename (1),
.BR dirname (1),
diff --git a/man3/bsearch.3 b/man3/bsearch.3
index d3b24aa785..924f910c71 100644
--- a/man3/bsearch.3
+++ b/man3/bsearch.3
@@ -33,10 +33,9 @@ bsearch \- binary search of a sorted array
.nf
.B #include <stdlib.h>
.sp
-.BI "void *bsearch(const void *" key ", const void *" base ", size_t " nmemb ,
-.RS
-.BI "size_t " size ", int (*" compar ")(const void *, const void *));"
-.RE
+.BI "void *bsearch(const void *" key ", const void *" base ,
+.BI " size_t " nmemb ", size_t " size ,
+.BI " int (*" compar ")(const void *, const void *));"
.fi
.SH DESCRIPTION
The
diff --git a/man3/dlopen.3 b/man3/dlopen.3
index 68f55dcc3e..cec5767fdf 100644
--- a/man3/dlopen.3
+++ b/man3/dlopen.3
@@ -447,10 +447,10 @@ main(int argc, char **argv)
.PP
If this program were in a file named "foo.c", you would build the program
with the following command:
-.RS
+.in +4n
.LP
gcc \-rdynamic \-o foo foo.c \-ldl
-.RE
+.in
.PP
Libraries exporting
.BR _init ()
@@ -458,10 +458,10 @@ and
.BR _fini ()
will want to be compiled as
follows, using \fIbar.c\fP as the example name:
-.RS
+.in +4n
.LP
gcc \-shared \-nostartfiles \-o bar bar.c
-.RE
+.in
.SH "SEE ALSO"
.BR ld (1),
.BR ldd (1),
diff --git a/man3/errno.3 b/man3/errno.3
index 6013c923e4..688f867cdc 100644
--- a/man3/errno.3
+++ b/man3/errno.3
@@ -471,7 +471,7 @@ Improper link (POSIX.1)
Exchange full
.SH NOTES
A common mistake is to do
-.RS
+.in +4n
.nf
if (somecall() == \-1) {
@@ -480,7 +480,7 @@ if (somecall() == \-1) {
}
.fi
-.RE
+.in
where
.I errno
no longer needs to have the value it had upon return from
@@ -490,7 +490,7 @@ no longer needs to have the value it had upon return from
If the value of
.I errno
should be preserved across a library call, it must be saved:
-.RS
+.in +4n
.nf
if (somecall() == \-1) {
@@ -499,7 +499,7 @@ if (somecall() == \-1) {
if (errsv == ...) { ... }
}
.fi
-.RE
+.in
.PP
It was common in traditional C to declare
.I errno
diff --git a/man3/getsubopt.3 b/man3/getsubopt.3
index e831569dfc..69b391c660 100644
--- a/man3/getsubopt.3
+++ b/man3/getsubopt.3
@@ -49,9 +49,9 @@ The following is an example of the kind of string
that might be passed in
.IR optionp :
.sp
-.RS
+.in +4n
.B ro,name=xyz
-.RE
+.in
The
.I tokens
diff --git a/man3/mbrtowc.3 b/man3/mbrtowc.3
index 7be4d78375..7ac378d797 100644
--- a/man3/mbrtowc.3
+++ b/man3/mbrtowc.3
@@ -80,9 +80,9 @@ Otherwise, \fI*ps\fP must be a valid \fImbstate_t\fP object.
An \fImbstate_t\fP object \fIa\fP can be initialized to the initial state
by zeroing it, for example using
.sp
-.RS
+.in +4n
memset(&a, 0, sizeof(a));
-.RE
+.in
.SH "RETURN VALUE"
The
.BR mbrtowc ()
diff --git a/man3/printf.3 b/man3/printf.3
index 6d6f38d0c4..81da06a1ce 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -225,11 +225,11 @@ part of the locale.
The POSIX locale
uses `.' as radix character, and does not have a grouping character.
Thus,
-.RS
+.in +4n
.nf
printf("%'.2f", 1234567.89);
.fi
-.RE
+.in
results in `1234567.89' in the POSIX locale, in `1234567,89' in the
nl_NL locale, and in `1.234.567,89' in the da_DK locale.
.SS "The flag characters"
diff --git a/man3/rand.3 b/man3/rand.3
index 12c0792ddb..3d6e8cf534 100644
--- a/man3/rand.3
+++ b/man3/rand.3
@@ -140,20 +140,21 @@ In
(William H. Press, Brian P. Flannery, Saul A. Teukolsky, William
T. Vetterling; New York: Cambridge University Press, 1992 (2nd ed.,
p. 277)), the following comments are made:
-.RS
+.PP
+.RS 4
"If you want to generate a random integer between 1 and 10, you should
always do it by using high-order bits, as in
-.RS
+.in +4n
.sp
j = 1 + (int) (10.0 * (rand() / (RAND_MAX + 1.0)));
.sp
-.RE
+.in
and never by anything resembling
-.RS
+.in +4n
.sp
j = 1 + (rand() % 10);
.sp
-.RE
+.in
(which uses lower-order bits)."
.RE
.PP
@@ -176,19 +177,21 @@ and
.BR srand (),
possibly useful when one needs the same sequence on two different machines.
.sp
+.in +4n
.nf
- static unsigned long next = 1;
+static unsigned long next = 1;
- /* RAND_MAX assumed to be 32767 */
- int myrand(void) {
- next = next * 1103515245 + 12345;
- return((unsigned)(next/65536) % 32768);
- }
+/* RAND_MAX assumed to be 32767 */
+int myrand(void) {
+ next = next * 1103515245 + 12345;
+ return((unsigned)(next/65536) % 32768);
+}
- void mysrand(unsigned seed) {
- next = seed;
- }
+void mysrand(unsigned seed) {
+ next = seed;
+}
.fi
+.in
.SH "SEE ALSO"
.BR drand48 (3),
.BR random (3)
diff --git a/man3/realpath.3 b/man3/realpath.3
index 358849a947..16ce6b6fc6 100644
--- a/man3/realpath.3
+++ b/man3/realpath.3
@@ -120,7 +120,7 @@ as found in \fI<limits.h>\fP or provided by the
function.
A typical source fragment would be
.LP
-.RS
+.in +4n
.nf
#ifdef PATH_MAX
path_max = PATH_MAX;
@@ -130,7 +130,7 @@ A typical source fragment would be
path_max = 4096;
#endif
.fi
-.RE
+.in
(But see the BUGS section.)
.LP
The 4.4BSD, Linux and SUSv2 versions always return an absolute
diff --git a/man3/setaliasent.3 b/man3/setaliasent.3
index 21186362cf..0b5da31b95 100644
--- a/man3/setaliasent.3
+++ b/man3/setaliasent.3
@@ -97,7 +97,7 @@ file.
.SH "CONFORMING TO"
These routines are glibc-specific.
The NeXT has similar routines:
-.RS
+.in +4n
.nf
#include <aliasdb.h>
@@ -107,7 +107,7 @@ void alias_endent(void);
alias_ent *alias_getent(void);
alias_ent *alias_getbyname(char *name);
.fi
-.RE
+.in
.SH EXAMPLE
The following example compiles with
.IR "gcc example.c \-o example" .
diff --git a/man3/setbuf.3 b/man3/setbuf.3
index a80ce3773b..c97b0af755 100644
--- a/man3/setbuf.3
+++ b/man3/setbuf.3
@@ -131,9 +131,9 @@ The
.BR setbuf ()
function is exactly equivalent to the call
.PP
-.RS
+.in +4n
setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
-.RE
+.in
.PP
The
.BR setbuffer ()
@@ -144,9 +144,9 @@ The
.BR setlinebuf ()
function is exactly equivalent to the call:
.PP
-.RS
+.in +4n
setvbuf(stream, (char *) NULL, _IOLBF, 0);
-.RE
+.in
.SH "RETURN VALUE"
The function
.BR setvbuf ()
diff --git a/man3/stdarg.3 b/man3/stdarg.3
index fd9e32a5e5..08245eb8b6 100644
--- a/man3/stdarg.3
+++ b/man3/stdarg.3
@@ -157,23 +157,23 @@ An obvious implementation would have a
be a pointer to the stack frame of the variadic function.
In such a setup (by far the most common) there seems
nothing against an assignment
-.RS
+.in +4n
.nf
- va_list aq = ap;
+va_list aq = ap;
.fi
-.RE
+.in
Unfortunately, there are also systems that make it an
array of pointers (of length 1), and there one needs
-.RS
+.in +4n
.nf
- va_list aq;
- *aq = *ap;
+va_list aq;
+*aq = *ap;
.fi
-.RE
+.in
Finally, on systems where parameters are passed in registers,
it may be necessary for
.BR va_start ()
@@ -187,16 +187,16 @@ can free the allocated memory again.
To accommodate this situation, C99 adds a macro
.BR va_copy (),
so that the above assignment can be replaced by
-.RS
+.in +4n
.nf
- va_list aq;
- va_copy(aq, ap);
- ...
- va_end(aq);
+va_list aq;
+va_copy(aq, ap);
+...
+va_end(aq);
.fi
-.RE
+.in
Each invocation of
.BR va_copy ()
must be matched by a corresponding invocation of
@@ -274,7 +274,6 @@ The function
.I foo
takes a string of format characters and prints out the argument associated
with each format character based on the type.
-.RS
.nf
#include <stdio.h>
@@ -308,4 +307,3 @@ foo(char *fmt, ...)
va_end(ap);
}
.fi
-.RE
diff --git a/man3/strfmon.3 b/man3/strfmon.3
index ad17ea5c9a..e580d436f9 100644
--- a/man3/strfmon.3
+++ b/man3/strfmon.3
@@ -129,20 +129,20 @@ Not in POSIX.1-2001.
Present on several other systems.
.SH EXAMPLE
The call
-.RS
+.in +4n
.nf
strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]",
1234.567, 1234.567);
.fi
-.RE
+.in
outputs
-.RS
+.in +4n
[ fl **1234,57] [ NLG **1 234,57]
-.RE
+.in
in the Dutch locale (with fl for "florijnen" and NLG for Netherlands Guilders).
The grouping character is very ugly because it takes as much space
as a digit, while it should not take more than half that,
@@ -152,7 +152,7 @@ and "NLG" is preceded by one and followed by two spaces.
This may be a bug in the locale files.
The Italian, Australian, Swiss
and Portuguese locales yield
-.RS
+.in +4n
[ L. **1235] [ ITL **1.235]
.br
@@ -161,7 +161,7 @@ and Portuguese locales yield
[Fr. **1234,57] [CHF **1.234,57]
.br
[ **1234$57Esc] [ **1.234$57PTE ]
-.RE
+.in
.SH "SEE ALSO"
.BR setlocale (3),
.BR sprintf (3),
diff --git a/man3/termios.3 b/man3/termios.3
index 6be37570e8..d72bd975f3 100644
--- a/man3/termios.3
+++ b/man3/termios.3
@@ -93,7 +93,7 @@ that is a pointer to a \fItermios\fP structure.
This structure contains at least the following members:
.ne 9
.sp
-.RS
+.in +4n
.nf
tcflag_t \fIc_iflag\fP; /* input modes */
tcflag_t \fIc_oflag\fP; /* output modes */
@@ -101,7 +101,7 @@ tcflag_t \fIc_cflag\fP; /* control modes */
tcflag_t \fIc_lflag\fP; /* local modes */
cc_t \fIc_cc\fP[\fBNCCS\fP]; /* control chars */
.fi
-.RE
+.in
.PP
The values that may be assigned to these fields are described below.
In the case of the first four bit-mask fields,
diff --git a/man3/timegm.3 b/man3/timegm.3
index c74c6f703c..05ae80eeb9 100644
--- a/man3/timegm.3
+++ b/man3/timegm.3
@@ -70,7 +70,7 @@ and restore the value of
.BR TZ .
Something like
-.RS
+.in +4n
.nf
#include <time.h>
#include <stdlib.h>
@@ -93,7 +93,7 @@ my_timegm(struct tm *tm)
return ret;
}
.fi
-.RE
+.in
.SH "SEE ALSO"
.BR gmtime (3),
.BR localtime (3),
diff --git a/man3/usleep.3 b/man3/usleep.3
index e739a621ec..ef95fe08f7 100644
--- a/man3/usleep.3
+++ b/man3/usleep.3
@@ -87,7 +87,7 @@ in the range [0,1000000].
Programs will be more portable
if they never mention this type explicitly.
Use
-.RS
+.in +4n
.nf
.ta 8
.sp
@@ -97,7 +97,7 @@ Use
\&...
usleep(usecs);
.fi
-.RE
+.in
.LP
The interaction of this function with the
.B SIGALRM