third_party/inchi/INCHI_BASE/src/ichinorm.c
int unmark_atoms_cFlags( inp_ATOM *at,
                         int start,
                         int num,
                         char cFlags,
                         char cInvFlags )
{
    if (at[start].cFlags & cFlags)
    {
        int i;
        at[start].cFlags &= cInvFlags;
        num++;
        for (i = 0; i < at[start].valence; i++)
        {
            num = unmark_atoms_cFlags( at, at[start].neighbor[i], num, cFlags, cInvFlags );
        }
    }

    return num; /* number of atoms traversed forward from at[start] */
}
/****************************************************************************
DFS search for atoms that do have a flag
****************************************************************************/
DFS search for atoms that do have a flag
DFS search for atoms that do have a flag
int unmark_atoms_cFlags( inp_ATOM *at,
                         int start,
                         int num,
                         char cFlags,
                         char cInvFlags )
{
    if (at[start].cFlags & cFlags)
    {
        int i;
        at[start].cFlags &= cInvFlags;
        num++;
        for (i = 0; i < at[start].valence; i++)
        {
            num = unmark_atoms_cFlags( at, at[start].neighbor[i], num, cFlags, cInvFlags );
        }
    }
    return num; 
}
int unmark_atoms_cFlags ( inp_ATOM * at , int start , int num , char cFlags , char cInvFlags ) { if ( at [ start ] . cFlags & cFlags ) { int i ; at [ start ] . cFlags &= cInvFlags ; num ++ ; for ( i = 0 ; i < at [ start ] . valence ; i ++ ) { num = unmark_atoms_cFlags ( at , at [ start ] . neighbor [ i ] , num , cFlags , cInvFlags ) ; } } return num ; }
DFS search for atoms that do have a flag
DFS search for atoms that do have a flag
/* number of atoms traversed forward from at[start] */