Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man3c/strchr.3c
Real path: /usr/share/man/man3c/strchr.3c
Zurück
'\" te .\" Portions Copyright (c) 2008, 2022, Oracle and/or its affiliates. .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Portions Copyright (c) 1994, Man-cgi 1.15, Panagiotis Christias (christia@softlab.ntua.gr) .\" Portions Copyright (c) 1996, 2008, Modified for NetBSD by Kimmo Suominen (kimmo@suominen.com) .\" Portions Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .\" Portions of this manual page were derived from Linux documentation obtained from http://linux.die.net. .TH strchr 3C "28 Feb 2022" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME strchr, strrchr, strchrnul, strcspn, strspn, strpbrk, strstr, strnstr, strcasestr \- string search operations .SH SYNOPSIS .LP .nf #include <string.h> \fBchar *\fR\fBstrchr\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBchar *\fR\fBstrrchr\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBchar *\fR\fBstrchrnul\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBsize_t\fR \fBstrcspn\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBsize_t\fR \fBstrspn\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBchar *\fR\fBstrpbrk\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBchar *\fR\fBstrstr\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBchar *\fR\fBstrnstr\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR, \fBsize_t\fR \fIn\fR); .fi .LP .nf \fBchar *\fR\fBstrcasestr\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .SS "ISO C++" .LP .nf #include <string.h> \fBconst char *\fR\fBstrchr\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBconst char *\fR\fBstrpbrk\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBconst char *\fR\fBstrrchr\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBconst char *\fR\fBstrstr\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf #include <cstring> \fBchar *std::\fR\fBstrchr\fR(\fBchar *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBchar *std::\fR\fBstrpbrk\fR(\fBchar *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP .nf \fBchar *std::\fR\fBstrrchr\fR(\fBchar *\fR\fIs\fR, \fBint\fR \fIc\fR); .fi .LP .nf \fBchar *std::\fR\fBstrstr\fR(\fBchar *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .SH DESCRIPTION .sp .LP These functions perform various operations on strings (arrays of characters), which are given as arguments \fIs\fR, \fIs1\fR, and \fIs2\fR that point to strings. Depending on the function, strings may be either terminated by a null character or consist of a length of \fIn\fR bytes. They are designed for use with encodings representing each character as a single byte, and all character counts are measured in individual bytes, even if a string with multibyte characters is used. They do not check for null pointers, and programs may crash if passing null or otherwise invalid pointers to these functions, or specifying sizes larger than the memory allocation in use for the string. Use of \fBadi\fR(7) may help in detecting out-of-bounds access or invalid pointer usage in code. .SS "\fBstrchr()\fR, \fBstrrchr()\fR, \fBstrchrnul()\fR" .sp .LP The \fBstrchr()\fR function returns a pointer to the first occurrence of \fIc\fR (converted to a \fBchar\fR) in string \fIs\fR, or a null pointer if \fIc\fR does not occur in the string. .sp .LP The \fBstrrchr()\fR function returns a pointer to the last occurrence of \fIc\fR (converted to a \fBchar\fR) in string \fIs\fR, or a null pointer if \fIc\fR does not occur in the string. .sp .LP The null character terminating a string is considered to be part of the string, and a pointer to it will be returned if \fIc\fR is \fB0\fR. .sp .LP The \fBstrchrnul()\fR function is similar to \fBstrchr()\fR except that if \fIc\fR is not found in \fIs\fR, it returns a pointer to the null byte at the end of \fIs\fR, rather than \fINULL\fR. .sp .LP These functions only work with single byte characters. .SS "\fBstrcspn()\fR, \fBstrspn()\fR" .sp .LP The \fBstrcspn()\fR function returns the length of the initial segment of string \fIs1\fR that consists entirely of bytes not from string \fIs2\fR. The \fBstrspn()\fR function returns the length of the initial segment of string \fIs1\fR that consists entirely of bytes from string \fIs2\fR. .SS "\fBstrpbrk()\fR" .sp .LP The \fBstrpbrk()\fR function returns a pointer to the first occurrence in string \fIs1\fR of any byte from string \fIs2\fR, or a null pointer if no byte from \fIs2\fR exists in \fIs1\fR. .SS "\fBstrstr()\fR, \fBstrnstr()\fR, \fBstrcasestr()\fR" .sp .LP The \fBstrstr()\fR function locates the first occurrence of the string \fIs2\fR (excluding the terminating null character) in string \fIs1\fR and returns a pointer to the located string, or a null pointer if the string is not found. If \fIs2\fR points to a string with zero length (that is, the string \fB""\fR), the function returns \fIs1\fR. .sp .LP The \fBstrnstr()\fR function locates the first occurrence of the null-terminated string \fIs2\fR in the string \fIs1\fR, where not more than \fIn\fR bytes are searched. Characters that appear after a '\e0' character are not searched. .sp .LP The \fBstrcasestr()\fR function is similar to \fBstrstr()\fR, but ignores differences in case when comparing lowercase and uppercase characters, using the current locale of the process to determine the case of the characters. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level Async-Signal-Safe _ Standard See below .TE .sp .SS "Standard" .sp .LP See \fBstandards\fR(7) for descriptions of the following standards: .sp .TS tab( ) box; cw(2.44i) |cw(3.06i) lw(2.44i) |lw(3.06i) . INTERFACES APPLICABLE STANDARDS _ T{ \%\fBstrchr()\fR, \%\fBstrcspn()\fR, \%\fBstrpbrk()\fR, \%\fBstrrchr()\fR, \%\fBstrspn()\fR, \%\fBstrstr()\fR T} T{ .br .in +2 C89 through C11, .in -2 .br .in +2 POSIX.1-1990 through 2008, .in -2 .br .in +2 SUS through SUSv4, .in -2 .br .in +2 XPG1 through XPG7 .in -2 T} _ T{ \%\fBstrcasestr()\fR, \%\fBstrchrnul()\fR, \%\fBstrnstr()\fR T} None .TE .sp .SH SEE ALSO .sp .LP \fBmemchr\fR(3C), \fBsetlocale\fR(3C), \fBstring\fR(3C), \fBstrtok\fR(3C), \fBwcschr\fR(3C), \fBwmemchr\fR(3C), \fBattributes\fR(7), \fBstandards\fR(7) .SH HISTORY .sp .LP The \%\fBstrcasestr()\fR, \%\fBstrchrnul()\fR, and \%\fBstrnstr()\fR functions were added to Oracle Solaris in the Solaris 11.0.0 release. .sp .LP The \%\fBstrchr()\fR, \%\fBstrcspn()\fR, \%\fBstrpbrk()\fR, \%\fBstrrchr()\fR, \%\fBstrspn()\fR, and \%\fBstrstr()\fR functions have been included in all Sun and Oracle releases of Solaris.