home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: String function names
- Message-ID: <1993Jan1.032304.14636@organpipe.uug.arizona.edu>
- Date: 1 Jan 93 03:23:04 GMT
- References: <alien.01il@acheron.amigans.gen.nz> <1992Dec31.142013.21895@stsci.edu> <28185@dog.ee.lbl.gov>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 32
- In-Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
-
- In article <28185@dog.ee.lbl.gov>, torek@horse (Chris Torek) writes:
- >>>what on earth are "strcspn()", "strpbrk()", and "strspn()"
- >>>supposed to mean?
-
- >Someone else posted some guesses, but I think mine are closer. :-)
- >
- > strspn: span (extend across) characters in a set, hence
- > `STRing SPaN'
- > strcspn: span characters in the complement of a set, hence
- > `STRing Complement SPaN'
- >
- >Strcoll() comes from `collate' (`assemble and arrange systematically'
- >or `compare'). Strpbrk() is something of a puzzle; the best I can come
- >up with is `point to break character' (from a set of break characters):
- >e.g., one might find white space for token-making using
- >
- > p = strpbrk(str, " \t\n");
-
- It is likely this comes from SNOBOL, which includes two functions
- called SPAN and BREAK. The Green Book(%) says:
-
- # SPAN and BREAK are primitive functions whose values are pattern
- # structures that match runs of characters [...] SPAN matches the
- # longest string [...] consisting soley of characters appearing in
- # the argument [...] BREAK matches the longest string [...] that
- # does not contain a character of the argument.
-
- % The Green Book is _The SNOBOL4 Programming Lanugage_ (2nd edition)
- by Griswold, Poage, and Polonsky. It has a green cover.
-
- --
- What signature?
-