home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / src / stindex.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-27  |  453 b   |  20 lines

  1. #include "plplot.h"
  2.  
  3. PLINT stindex(str1,str2)
  4. char *str1,*str2;
  5. {
  6.     PLINT base;
  7.     PLINT str1ind;
  8.     PLINT str2ind;
  9.  
  10.     for(base=0; *(str1+base)!='\0'; base++) {
  11.         for(str1ind=base, str2ind=0; *(str2+str2ind)!='\0' &&
  12.             *(str2+str2ind) == *(str1+str1ind); str1ind++, str2ind++)
  13.             ;   /* no body */
  14.  
  15.         if(*(str2+str2ind) == '\0')
  16.             return((PLINT)base);
  17.     }
  18.     return((PLINT)-1);    /* search failed */
  19. }
  20.