#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libant/StrIndex.c $ %D% SwRI" #include /* StrIndex -- returns index of string in array of strings or -1 */ int StrIndex( char **strp, /* array of strings */ char *str) /* string to find */ { const int STRING_NOT_FOUND= -1; int i; if (!str || !strp) return STRING_NOT_FOUND; for (i=0; *strp; strp++,i++) if (!strcmp(*strp,str)) return i; return STRING_NOT_FOUND; }