示例#1
0
文件: util.c 项目: lopesivan/tdl
/*}}}*/
void mark_all_descendents(struct node *n)/*{{{*/
{
  struct node *y;
  for (y = n->kids.next; y != (struct node *) &n->kids; y = y->chain.next) {
    y->flag = 1;
    if (has_kids(y)) {
      mark_all_descendents(y);
    }
  }
}
示例#2
0
文件: done.c 项目: T-J-Teru/tdl
/*}}}*/
static int internal_done(time_t when, char **x)/*{{{*/
{
  struct node *n;
  int do_descendents;

  clear_flags(&top);

  while (*x) {
    do_descendents = include_descendents(*x); /* May modify *x */
    n = lookup_node(*x, 0, NULL);
    if (!n) return -1;
    n->flag = 1;
    if (do_descendents) {
      mark_all_descendents(n);
    }
    n->scratch = *x; /* Safe to alias, *x has long lifetime */
    x++;
  }
   
  mark_done_from_bottom_up(&top, when);

  return 0;
}