/*************************************************************************\ * Copyright (c) 2002 The University of Chicago, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * This file is distributed subject to a Software License Agreement found * in the file LICENSE that is included with this distribution. \*************************************************************************/ /* $Log: match_string.c,v $ Revision 1.7 2005/04/07 19:40:41 borland Removed debugging statement. Revision 1.6 2005/04/07 19:33:22 borland Added WILDCARD_MATCH ability to match_string. Used by sddsxref -wildMatch option. Revision 1.5 2002/08/14 16:06:11 soliday Added Open License Revision 1.4 2002/07/24 15:32:16 borland Prototypes for strcmp_case_insensitive() and strncmp_case_insensitive() are now in match_string.h. * Revision 1.3 1995/11/13 16:18:50 borland * Added long cast to strlen() in comparisons to satisfy Solaris compiler. * * Revision 1.2 1995/09/05 21:17:54 saunders * First test release of the SDDS1.5 package. * */ /* routine: match_string() * purpose: return the number in the string array corresponding * to the string given. Various matching modes are available. */ #include "match_string.h" #include "mdb.h" #include long match_string( char *string, /* string to find match for */ char **option, /* strings to match with */ long n_options, /* number of strings to match with */ long mode /* matching mode flags */ ) { register long i, i_match, l; if (string==NULL) return(-1); if (mode&WILDCARD_MATCH) { for (i=0; i