diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/stdlib/imaxabs.3 (renamed from src/lib/libc/string/index.3) | 79 |
1 files changed, 31 insertions, 48 deletions
diff --git a/src/lib/libc/string/index.3 b/src/lib/libc/stdlib/imaxabs.3 index 847b03628b..10933e0a66 100644 --- a/src/lib/libc/string/index.3 +++ b/src/lib/libc/stdlib/imaxabs.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 | .\" the American National Standards Committee X3, on Information |
| 6 | .\" 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,53 +29,38 @@ | |||
| 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: @(#)index.3 5.3 (Berkeley) 4/19/91 | 32 | .\" $OpenBSD: imaxabs.3,v 1.3 2007/05/31 19:19:31 jmc Exp $ |
| 35 | .\" $Id: index.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 INDEX 3 | 35 | .Dt IMAXABS 3 |
| 39 | .Os | 36 | .Os |
| 40 | .Sh NAME | 37 | .Sh NAME |
| 41 | .Nm index | 38 | .Nm imaxabs |
| 42 | .Nd locate character in string | 39 | .Nd integer absolute value function |
| 43 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
| 44 | .Fd #include <string.h> | 41 | .Fd #include <inttypes.h> |
| 45 | .Ft char * | 42 | .Ft intmax_t |
| 46 | .Fn index "const char *s" "int c" | 43 | .Fn imaxabs "intmax_t j" |
| 47 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
| 48 | The | 45 | The |
| 49 | .Fn index | 46 | .Fn imaxabs |
| 50 | function | 47 | function computes the absolute value of the intmax_t variable |
| 51 | locates the first character matching | 48 | .Fa j . |
| 52 | .Fa c | ||
| 53 | (converted to a | ||
| 54 | .Em char ) | ||
| 55 | in the null-terminated string | ||
| 56 | .Fa s . | ||
| 57 | .Sh RETURN VALUES | 49 | .Sh RETURN VALUES |
| 58 | The character | 50 | The |
| 59 | .Fa c | 51 | .Fn imaxabs |
| 60 | is returned if it is found; otherwise | 52 | function returns the absolute value. |
| 61 | .Dv NULL | ||
| 62 | is returned. | ||
| 63 | If | ||
| 64 | .Fa c | ||
| 65 | is '\e0', | ||
| 66 | .Fn index | ||
| 67 | locates the terminating '\e0'. | ||
| 68 | .Sh SEE ALSO | 53 | .Sh SEE ALSO |
| 69 | .Xr memchr 3 , | 54 | .Xr abs 3 , |
| 70 | .Xr rindex 3 , | 55 | .Xr cabs 3 , |
| 71 | .Xr strchr 3 , | 56 | .Xr floor 3 , |
| 72 | .Xr strcspn 3 , | 57 | .Xr hypot 3 , |
| 73 | .Xr strpbrk 3 , | 58 | .Xr labs 3 , |
| 74 | .Xr strrchr 3 , | 59 | .Xr math 3 |
| 75 | .Xr strsep 3 , | 60 | .Sh STANDARDS |
| 76 | .Xr strspn 3 , | 61 | The |
| 77 | .Xr strstr 3 , | 62 | .Fn abs |
| 78 | .Xr strtok 3 | 63 | function conforms to |
| 79 | .Sh HISTORY | 64 | .St -ansiC-99 . |
| 80 | A | 65 | .Sh BUGS |
| 81 | .Fn index | 66 | The absolute value of the most negative integer remains negative. |
| 82 | function appeared in | ||
| 83 | .At v6 . | ||
