Esempio n. 1
0
File: util.c Progetto: 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);
    }
  }
}
Esempio n. 2
0
File: util.c Progetto: lopesivan/tdl
/*}}}*/
void clear_flags(struct links *x)/*{{{*/
{
  struct node *y;
  for (y = x->next; y != (struct node *) x; y = y->chain.next) {
    y->flag = 0;
    if (has_kids(y)) {
      clear_flags(&y->kids);
    }
  }
}
Esempio n. 3
0
File: done.c Progetto: T-J-Teru/tdl
/*}}}*/
static void undo_descendents(struct node *y)/*{{{*/
{
  struct node *c;
  for (c = y->kids.next; c != (struct node *) &y->kids; c = c->chain.next) {
    c->done = 0;
    if (has_kids(c)) {
      undo_descendents(c);
    }
  }
}
Esempio n. 4
0
File: done.c Progetto: T-J-Teru/tdl
/*}}}*/
static void mark_done_from_bottom_up(struct links *x, time_t done_time)/*{{{*/
{
  struct node *y; 

  for (y = x->next; y != (struct node *) x; y = y->chain.next) {

    if (has_kids(y)) {
      mark_done_from_bottom_up(&y->kids, done_time);
    }
    
    if (y->flag) {
      if (has_open_child(y)) {
        fprintf(stderr, "Cannot mark %s done, it has open sub-tasks\n", y->scratch);
      } else {
        y->done = done_time;
      }
    }
  }
}