#include "fsm.h"
#include "converter.h"
/*==========================================================================
Function: FindLabel();
Comments: This function ensures that only distinct labels are inserted in
	  tran_label list and that there is no duplication.
Input: 	  label_list - list of events
	  label - a particular label
Output:	  TRUE if a match is found, FALSE otherwise.
Author:   Sudhir Nelvagal
Advisor:  Dr. Ratnesh Kumar
===========================================================================*/
int FindLabel(char *label_list[MAX_LENGTH],char *label)
{

	int i,count=0;

	if(label_list[0]==NULL) {
		return(0);
	}
	else {
		for(i=0;*label_list[i]!='\0';i++) {
			if(strcmp(label, label_list[i])==0) {
				/*the tran label is already present */
				return(TRUE);
			}
			else {
				++count;
			}
		}
	}
	if(count == i) {
		/* no match has been found */
		return(FALSE);
	}
			

} /* FindLabel ends */
