/* The permission is granted to use the software as is and redistribute it in its original and complete form. If you find this program useful and publish results obtained by it, please cite the program as: Michael Whitbeck, Desert Research Institute, 1991, "REACT - Program to solve kinetic equations for chemical systems". Version 1.00, this code is available from the authors or from Dr. Whitbeck. */ /* check for species in a list */ #include #include "rxn.h" extern float atof(); extern char *strtok(); extern char *malloc(); extern int strcmp(); char *mytok(s1, s2) register unsigned char *s1; register unsigned char *s2; { static unsigned char *cp1; if (s1 != NULL) cp1 = s1; s1 = cp1 + strspn(cp1, s2); if (*s1 == '\0') return(NULL); cp1 = s1 + strcspn(s1, s2); *cp1++ = '\0'; return (char *)s1; } int inlist (s1, s2) char *s1; char *s2; { char *s4; int k; static char *tok=" "; strcpy(altlist,s1); k = 0; s4 = mytok(altlist,tok); while(s4){ k++; if (strcmp(s4,s2) == 0) return k; s4=mytok(NULL,tok); } return 0; }