third_party/inchi/INCHI_BASE/src/ichinorm.c
int mark_atoms_ap( inp_ATOM *at,
                   AT_NUMB start,
                   R2C_ATPAIR *ap,
                   int num_ap, int num,
                   AT_NUMB cFlags )
{
    if (!at[start].at_type)
    {
        int i;
        AT_NUMB neigh;
        at[start].at_type = cFlags;
        num++;

        for (i = 0; i < at[start].valence; i++)
        {
            neigh = at[start].neighbor[i];
            if (has_atom_pair_seq( ap, num_ap, start, neigh ))
            {
                continue;
            }
            num = mark_atoms_ap( at, neigh, ap, num_ap, num, cFlags );
        }
    }

    return num; /* number of atoms traversed forward from at[start] */
}
/****************************************************************************
DFS search for atoms that do not have a flag
****************************************************************************/
DFS search for atoms that do not have a flag
DFS search for atoms that do not have a flag
int mark_atoms_ap( inp_ATOM *at,
                   AT_NUMB start,
                   R2C_ATPAIR *ap,
                   int num_ap, int num,
                   AT_NUMB cFlags )
{
    if (!at[start].at_type)
    {
        int i;
        AT_NUMB neigh;
        at[start].at_type = cFlags;
        num++;
        for (i = 0; i < at[start].valence; i++)
        {
            neigh = at[start].neighbor[i];
            if (has_atom_pair_seq( ap, num_ap, start, neigh ))
            {
                continue;
            }
            num = mark_atoms_ap( at, neigh, ap, num_ap, num, cFlags );
        }
    }
    return num; 
}
int mark_atoms_ap ( inp_ATOM * at , AT_NUMB start , R2C_ATPAIR * ap , int num_ap , int num , AT_NUMB cFlags ) { if ( ! at [ start ] . at_type ) { int i ; AT_NUMB neigh ; at [ start ] . at_type = cFlags ; num ++ ; for ( i = 0 ; i < at [ start ] . valence ; i ++ ) { neigh = at [ start ] . neighbor [ i ] ; if ( has_atom_pair_seq ( ap , num_ap , start , neigh ) ) { continue ; } num = mark_atoms_ap ( at , neigh , ap , num_ap , num , cFlags ) ; } } return num ; }
DFS search for atoms that do not have a flag
DFS search for atoms that do not have a flag
/* number of atoms traversed forward from at[start] */