Category : C Source Code
Archive   : CSRC2.ZIP
Filename : ANY.C

 
Output of file : ANY.C contained in archive : CSRC2.ZIP
/*
* a n y . c
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title any Pattern Match -- Match Member of a Character Set
index Pattern match -- match member of a character set

synopsis

#ifdef vms
#include "c:cset.h"
#else
#include
#endif

char *
any(s,cs)
char s[];
CSET *cs;

description

Any() matches, returning a pointer to the second character of s, if
the first character of s is a member of cs. Otherwise, it returns
NULL.

The null that terminates s is never considered to be a member of the
cset, and is never matched; NULL is returned.

Those familiar with SNOBOL should note that there is no notany() -
the same effect can be obtained by using any() with cscomp(cs).

bugs

author

Jerry Leichter

#endif

/*
)EDITLEVEL=02
* Edit history
* 0.0 19-Jul-82 JSL Invention
*/

#ifdef vms
#include "c:cset.h"
#else
#include
#endif

#define NULL 0

char *
any(s,cs)
register char *s;
CSET *cs;
{
if (*s && csmember(cs,*s))
return(s+1);
else
return(NULL);
}


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : ANY.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/