Exemplo n.º 1
0
int modname_match(const char *name)
{
    int retval = 0; 

    if (comparestring(cond_modulename, name) == 0)
	retval = 1; 

    return retval;
}
Exemplo n.º 2
0
//===============================================================================================
void percolateUp(int arrpos) 
{

    if (arrpos > 1) 
    {
        if ( comparestring(h[arrpos/2].first,h[arrpos].first,h[arrpos/2].last,h[arrpos].last) > 0) 
        {
            interchange(arrpos, arrpos/2);
            percolateUp(arrpos/2);
        }
    }
}
Exemplo n.º 3
0
void percolateDown(int arrpos) {

    int min;
    if ((2*arrpos+1) <= hsize) 
    {
        if( comparestring( h[2*arrpos].first,h[2*arrpos+1].first,h[2*arrpos].last,h[2*arrpos+1].last) < 0 )
        min = 2*arrpos;
        else
        min = 2*arrpos+1;
        
        if (comparestring( h[arrpos].first,h[min].first,h[arrpos].last,h[min].last) > 0) 
        {
            interchange(arrpos, min);
            percolateDown(min);
        }
    }
    
    else if (hsize == 2*arrpos) 
    {
         
        if (comparestring(h[arrpos].first,h[2*arrpos].first,h[arrpos].last,h[2*arrpos].last) > 0) 
            interchange(arrpos, 2*arrpos);
    }
}