strtok.3 (55184) | strtok.3 (55287) |
---|---|
1.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. 2.\" 3.\" strtok_r, from Berkeley strtok 4.\" Oct 13, 1998 by Wes Peters <wes@softweyr.com> 5.\" 6.\" Copyright (c) 1988, 1991, 1993 7.\" The Regents of the University of California. All rights reserved. 8.\" --- 34 unchanged lines hidden (view full) --- 43.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 44.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 45.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 47.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 48.\" SUCH DAMAGE. 49.\" 50.\" @(#)strtok.3 8.2 (Berkeley) 2/3/94 | 1.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. 2.\" 3.\" strtok_r, from Berkeley strtok 4.\" Oct 13, 1998 by Wes Peters <wes@softweyr.com> 5.\" 6.\" Copyright (c) 1988, 1991, 1993 7.\" The Regents of the University of California. All rights reserved. 8.\" --- 34 unchanged lines hidden (view full) --- 43.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 44.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 45.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 47.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 48.\" SUCH DAMAGE. 49.\" 50.\" @(#)strtok.3 8.2 (Berkeley) 2/3/94 |
51.\" $FreeBSD: head/lib/libc/string/strtok.3 55184 1999-12-28 14:47:00Z hoek $ | 51.\" $FreeBSD: head/lib/libc/string/strtok.3 55287 1999-12-31 21:27:02Z hoek $ |
52.\" 53.Dd November 27, 1998 54.Dt STRTOK 3 55.Os FreeBSD 3.0 56.Sh NAME 57.Nm strtok, strtok_r 58.Nd string tokens 59.Sh SYNOPSIS --- 15 unchanged lines hidden (view full) --- 75These tokens are separated in the string by at least one of the 76characters in 77.Fa sep . 78The first time that 79.Fn strtok 80is called, 81.Fa str 82should be specified; subsequent calls, wishing to obtain further tokens | 52.\" 53.Dd November 27, 1998 54.Dt STRTOK 3 55.Os FreeBSD 3.0 56.Sh NAME 57.Nm strtok, strtok_r 58.Nd string tokens 59.Sh SYNOPSIS --- 15 unchanged lines hidden (view full) --- 75These tokens are separated in the string by at least one of the 76characters in 77.Fa sep . 78The first time that 79.Fn strtok 80is called, 81.Fa str 82should be specified; subsequent calls, wishing to obtain further tokens |
83from the same string, should pass the NULL pointer instead. | 83from the same string, should pass a null pointer instead. |
84The separator string, 85.Fa sep , 86must be supplied each time, and may change between calls. 87.Pp 88The 89.Fn strtok_r 90function is a reentrant version of 91.Fn strtok . --- 8 unchanged lines hidden (view full) --- 100.Fn strtok 101and 102.Fn strtok_r 103functions 104return a pointer to the beginning of each subsequent token in the string, 105after replacing the token itself with a 106.Dv NUL 107character. | 84The separator string, 85.Fa sep , 86must be supplied each time, and may change between calls. 87.Pp 88The 89.Fn strtok_r 90function is a reentrant version of 91.Fn strtok . --- 8 unchanged lines hidden (view full) --- 100.Fn strtok 101and 102.Fn strtok_r 103functions 104return a pointer to the beginning of each subsequent token in the string, 105after replacing the token itself with a 106.Dv NUL 107character. |
108When no more tokens remain, the NULL pointer is returned. | 108When no more tokens remain, a null pointer is returned. |
109.Sh EXAMPLE 110The following uses 111.Fn strtok_r 112to parse two strings using separate contexts: 113.Bd -literal 114char test[80], blah[80]; 115char *sep = "\e\e/:;=-"; 116char *word, *phrase, *brkt, *brkb; --- 53 unchanged lines hidden --- | 109.Sh EXAMPLE 110The following uses 111.Fn strtok_r 112to parse two strings using separate contexts: 113.Bd -literal 114char test[80], blah[80]; 115char *sep = "\e\e/:;=-"; 116char *word, *phrase, *brkt, *brkb; --- 53 unchanged lines hidden --- |