home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19105 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.8 KB

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