home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / tasm / GREP / C / comline next >
Encoding:
Text File  |  1992-03-04  |  553 b   |  32 lines

  1. /*
  2. COMLINE.C   Command line parameter parser.
  3. R.J.P.    9-5/90
  4. */
  5.  
  6. #include       <stdio.h>
  7. #include       <string.h>
  8. #include       <stdlib.h>
  9. #include       <ctype.h>
  10. #include       "grep.h"
  11.  
  12. void strupper(char *s)
  13. {  while( *s) { *s = toupper(*s) ;  ++s ; } }
  14.  
  15.  
  16. char *comline( int ac , char **av, char *tag)
  17. {
  18.   int  sl  = strlen(tag) ;
  19.   char *cp ;
  20.  
  21.   while( --ac)
  22.   {
  23.     cp  =   *++av ;                         
  24.     if(( *cp != '/') && ( *cp != '-' ))   continue ;
  25.  
  26.     if( !strncmp( ++cp , tag , sl) )   return( cp + sl) ;
  27.   }
  28.   return  0  ;
  29. }
  30.  
  31.  
  32.