third_party/inchi/INCHI_BASE/src/strutil.c
int bIsMetalToDisconnect( inp_ATOM *at, int i, int bCheckMetalValence )
{
    int type, at_valence, num_H;

    /*
    if ( !at[i].valence )
    */

    if (!( type = get_el_type( at[i].el_number ) ) ||
         !( type & IS_METAL ))
    {
        return 0;
    }

    num_H = NUMH( at, i );
    at_valence = num_H + at[i].chem_bonds_valence;

    if (!at_valence)
    {
        return 0; /* nothing to disconnect */
    }

    if (bCheckMetalValence)
    {
        if (abs( at[i].charge ) > 1)
        {
            return 1; /* multiple charges */
        }

        for (i = 0; i < 2 && ( i & type ); i++)
        {
            if (at_valence == get_el_valence( at[i].el_number, at[i].charge, i ))
            {
                return 2; /* atom has normal valence */
            }
        }
    }

    return 1;
}
/*****************************************************************************/
/* Important: Salt disconnection is independent from coord. disconnection:   */
/* because different atoms are disconnected.                                 */
/* However, sal disconnection may need to be rerun after metal disconnection */
/* because metal disconnection may make certain atoms be eligible for salt   */
/* disconnection                                                             */
/*****************************************************************************/
Salt disconnection is independent from coord. disconnection:
because different atoms are disconnected.
However, sal disconnection may need to be rerun after metal disconnection
because metal disconnection may make certain atoms be eligible for salt
disconnection
Salt disconnection is independent from coord . disconnection : because different atoms are disconnected . However sal disconnection may need to be rerun after metal disconnection because metal disconnection may make certain atoms be eligible for salt disconnection
int bIsMetalToDisconnect( inp_ATOM *at, int i, int bCheckMetalValence )
{
    int type, at_valence, num_H;
    if (!( type = get_el_type( at[i].el_number ) ) ||
         !( type & IS_METAL ))
    {
        return 0;
    }
    num_H = NUMH( at, i );
    at_valence = num_H + at[i].chem_bonds_valence;
    if (!at_valence)
    {
        return 0; 
    }
    if (bCheckMetalValence)
    {
        if (abs( at[i].charge ) > 1)
        {
            return 1; 
        }
        for (i = 0; i < 2 && ( i & type ); i++)
        {
            if (at_valence == get_el_valence( at[i].el_number, at[i].charge, i ))
            {
                return 2; 
            }
        }
    }
    return 1;
}
int bIsMetalToDisconnect ( inp_ATOM * at , int i , int bCheckMetalValence ) { int type , at_valence , num_H ; if ( ! ( type = get_el_type ( at [ i ] . el_number ) ) || ! ( type & IS_METAL ) ) { return 0 ; } num_H = NUMH ( at , i ) ; at_valence = num_H + at [ i ] . chem_bonds_valence ; if ( ! at_valence ) { return 0 ; } if ( bCheckMetalValence ) { if ( abs ( at [ i ] . charge ) > 1 ) { return 1 ; } for ( i = 0 ; i < 2 && ( i & type ) ; i ++ ) { if ( at_valence == get_el_valence ( at [ i ] . el_number , at [ i ] . charge , i ) ) { return 2 ; } } } return 1 ; }
Important: Salt disconnection is independent from coord.
Important : Salt disconnection is independent from coord .
/*
    if ( !at[i].valence )
    */ /* nothing to disconnect */ /* multiple charges */ /* atom has normal valence */