summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/imaxdiv.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libc/stdlib/imaxdiv.3 (renamed from src/lib/libc/string/rindex.3)80
1 files changed, 33 insertions, 47 deletions
diff --git a/src/lib/libc/string/rindex.3 b/src/lib/libc/stdlib/imaxdiv.3
index b13b3513e0..c4dee627aa 100644
--- a/src/lib/libc/string/rindex.3
+++ b/src/lib/libc/stdlib/imaxdiv.3
@@ -2,7 +2,9 @@
2.\" All rights reserved. 2.\" All rights reserved.
3.\" 3.\"
4.\" This code is derived from software contributed to Berkeley by 4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek. 5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
6.\" Redistribution and use in source and binary forms, with or without 8.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 9.\" modification, are permitted provided that the following conditions
8.\" are met: 10.\" are met:
@@ -11,11 +13,7 @@
11.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 15.\" documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software 16.\" 3. Neither the name of the University nor the names of its contributors
15.\" must display the following acknowledgement:
16.\" This product includes software developed by the University of
17.\" California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\" may be used to endorse or promote products derived from this software 17.\" may be used to endorse or promote products derived from this software
20.\" without specific prior written permission. 18.\" without specific prior written permission.
21.\" 19.\"
@@ -31,51 +29,39 @@
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
33.\" 31.\"
34.\" from: @(#)rindex.3 5.2 (Berkeley) 4/19/91 32.\" $OpenBSD: imaxdiv.3,v 1.3 2007/05/31 19:19:31 jmc Exp $
35.\" $Id: rindex.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $
36.\" 33.\"
37.Dd April 19, 1991 34.Dd $Mdocdate: May 31 2007 $
38.Dt RINDEX 3 35.Dt IMAXDIV 3
39.Os 36.Os
40.Sh NAME 37.Sh NAME
41.Nm rindex 38.Nm imaxdiv
42.Nd locate character in string 39.Nd return quotient and remainder from division
43.Sh SYNOPSIS 40.Sh SYNOPSIS
44.Fd #include <string.h> 41.Fd #include <inttypes.h>
45.Ft char * 42.Ft imaxdiv_t
46.Fn rindex "const char *s" "int c" 43.Fn imaxdiv "intmax_t num" "intmax_t denom"
47.Sh DESCRIPTION 44.Sh DESCRIPTION
48The 45The
49.Fn rindex 46.Fn imaxdiv
50function 47function computes the value
51locates the last character 48.Fa num Ns / Ns Fa denom
52matching 49and returns the quotient and remainder in a structure named
53.Fa c 50.Li imaxdiv_t
54(converted to a 51that contains two
55.Em char ) 52.Li intmax_t
56in the null-terminated string 53members named
57.Fa s . 54.Fa quot
58The character c is returned if it is found; otherwise NULL is returned. 55and
59If 56.Fa rem .
60.Fa c
61is
62.Ql \e0 ,
63.Fn rindex
64locates the terminating
65.Ql \e0 .
66.Sh SEE ALSO 57.Sh SEE ALSO
67.Xr index 3 , 58.Xr div 3 ,
68.Xr memchr 3 , 59.Xr ldiv 3 ,
69.Xr strchr 3 , 60.Xr lldiv 3 ,
70.Xr strcspn 3 , 61.Xr math 3 ,
71.Xr strpbrk 3 , 62.Xr qdiv 3
72.Xr strrchr 3 , 63.Sh STANDARDS
73.Xr strsep 3 , 64The
74.Xr strspn 3 , 65.Fn imaxdiv
75.Xr strstr 3 , 66function conforms to
76.Xr strtok 3 67.St -ansiC-99 .
77.Sh HISTORY
78A
79.Fn rindex
80function appeared in
81.At v6 .