home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / actlib12.zip / STRINGS.ZIP / IS_ALNUM.C < prev    next >
C/C++ Source or Header  |  1993-02-25  |  603b  |  27 lines

  1. /*  Copyright (C) 1993   Marc Stern  (internet: stern@mble.philips.be)  */
  2.  
  3. #include "strings.h"
  4. #include <ctype.h>
  5.  
  6. /***
  7.  *  Function    :  stris_alnum
  8.  *
  9.  *  Description :  Tests if a string contains only alphanumerical characters or '_'.
  10.  *
  11.  *  Parameters  :  in   char   *string
  12.  *
  13.  *  Return      :  1 if string contains only alphanumerical characters or '_'.
  14.  *                 0 otherwise
  15.  *
  16.  *  OS/Compiler :  All
  17.  ***/
  18.  
  19. int stris_alnum( const char *string )
  20.  
  21. {
  22.   for (; *string; string ++ )
  23.       if ( ! isalnum(*string) && (*string != '_') ) return 0;
  24.  
  25.   return 1;
  26. }
  27.