|
|
1.1 ! root 1: .\" Copyright (c) 1988 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted provided ! 5: .\" that: (1) source distributions retain this entire copyright notice and ! 6: .\" comment, and (2) distributions including binaries display the following ! 7: .\" acknowledgement: ``This product includes software developed by the ! 8: .\" University of California, Berkeley and its contributors'' in the ! 9: .\" documentation or other materials provided with the distribution and in ! 10: .\" all advertising materials mentioning features or use of this software. ! 11: .\" Neither the name of the University nor the names of its contributors may ! 12: .\" be used to endorse or promote products derived from this software without ! 13: .\" specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)strtok.3 5.5 (Berkeley) 6/23/90 ! 19: .\" ! 20: .TH STRTOK 3 "June 23, 1990" ! 21: .UC 3 ! 22: .SH NAME ! 23: strtok, strsep \- string token operations ! 24: .SH SYNOPSIS ! 25: .nf ! 26: .ft B ! 27: #include <string.h> ! 28: ! 29: char * ! 30: strtok(char *str, const char *sep); ! 31: .ft R ! 32: .fi ! 33: .SH DESCRIPTION ! 34: .ft B ! 35: This interface is obsoleted by strsep(3). ! 36: .ft R ! 37: .PP ! 38: .I Strtok ! 39: is used to isolate sequential tokens in a null-terminated string, ! 40: .IR str . ! 41: These tokens are separated in the string by ! 42: .B "one or more" ! 43: of the characters in ! 44: .IR sep . ! 45: The first time that ! 46: .I strtok ! 47: is called, ! 48: .I str ! 49: should be specified; subsequent calls, wishing to obtain further tokens ! 50: from the same string, should pass a null pointer instead. ! 51: The separator string, ! 52: .IR sep , ! 53: must be supplied each time, and may change between calls. ! 54: .PP ! 55: .I Strtok ! 56: returns a pointer to the start of each subsequent token in the string, ! 57: after replacing the token itself with a NUL character. ! 58: When no more tokens remain, a null pointer is returned. ! 59: .SH SEE ALSO ! 60: index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), ! 61: strsep(3), strspn(3), strstr(3) ! 62: .SH STANDARDS ! 63: .B Strtok ! 64: conforms to ANSI X3.159-1989 (``ANSI C''). ! 65: .SH BUGS ! 66: There is no way to get tokens from multiple strings simultaneously. ! 67: .PP ! 68: The System V ! 69: .B strtok ! 70: will, if handed a string containing only delimiter characters, ! 71: not alter the next starting point, so that a call to ! 72: .B strtok ! 73: with a different (or empty) delimiter string ! 74: may return a non-NULL value. ! 75: Since this implementation always alters the next starting point, ! 76: such a sequence of calls would always return NULL.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.