#include "dbinc.h"
/*-----------------------------------------------------------------------------

    FUNCTION:  get_data_list_index

       Given the variable name, it returns the index to that variable
       in the data list.

       Note:  not case-sensitive

    PARAMETER:

       name = pointer to name of variable to search for
                  (not case-sensitive)

    RETURNS:  index (0 to 99) if present in data list
              -1 if not found

*/
#if PROTOTYPE_ALLOWED
int get_data_list_index(char *name)
#else
int get_data_list_index(name)
char *name;
#endif
{
   int i;

   for (i = 0; i < (int)db->block_hdr.data_list_nentries; i++)
      if (!stricmp(name, db->data_list[i].name))
         if (db->data_list[i].access_type == UNUSED) return(-1);
         else return(i);
   return(-1); /* not in data list */
}

