aboutsummaryrefslogblamecommitdiffstats
path: root/count_child.h
blob: d3f11d5da97d4b9aa53ceb7ecbb99c44be776643 (plain) (tree)
1
2
3
4
5
6
7
8







                                                                                
static OBJECT ZZCountChild(OBJECT link, int *i)
{
  OBJECT y;
  for(y=pred(link, PARENT), (*i)=1; type(y)==LINK; y = pred(y, PARENT), (*i)++);
  return y;
}

#define CountChild(y, link, i) ((y) = ZZCountChild(link, &(i)))