/*
 * $RCSfile: blast_util.c,v $
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 *
 * $Log: blast_util.c,v $
 * Revision 1.2  1996/02/02 15:51:03  slm
 * Updated copyright and version.
 *
 * Revision 1.1  1995/07/28  22:08:26  slm
 * Initial revision
 *
 * Revision 1.9.3.1  1994/11/23  17:29:17  hkaram
 * New branch
 *
 * Revision 1.9  1993/12/16  01:25:27  menze
 * Fixed mask references to compile with strict ANSI restrictions
 */

#include "blast_internal.h"
 
/* 
 * Returns the index of the first set bit in the mask
 */
int
blast_mask_to_i(mask)
     BLAST_MASK_PROTOTYPE mask;
{
    int i;
    xTrace1(blastp, TR_FUNCTIONAL_TRACE, "mask_to_i: called mask =  %s",
	    blastShowMask(mask));
    
    for (i=1; i <= BLAST_MAX_FRAGS; i++) {
	if ( BLAST_MASK_IS_BIT_SET(&mask, 1) ) {
	    xTrace1(blastp, TR_DETAILED, "mask_to_i: returns i =  %d", i);
	    return i;
	}
	BLAST_MASK_SHIFT_RIGHT(mask, 1);
    }
    xTrace0(blastp, TR_DETAILED, "mask_to_i: returns 0");
    return 0;
}
    

void
blast_mapFlush(m)
    Map m;
{
  /* should remove all entries from map but. noop for now */
}

