Ejemplo n.º 1
0
Archivo: cmenu.c Proyecto: jkkm/xfsdump
int
list_prune(node_t *menulist, char *mountpt, uuid_t *uuidp, time32_t prunetime)
{
    node_t *n;
    data_t *d;

    n = menulist;
    while(n != NULL) {
	d = (data_t *)(n->data);

	if(d != NULL && d->ops != NULL && d->ops->op_prune != NULL) {
	    if(d->ops->op_prune(mountpt, uuidp, prunetime, n, menulist) == BOOL_TRUE) {
		if(d->ops->op_delete == NULL) {
		    list_delete(n, menulist);
		}
		else {
		    d->ops->op_delete(NULL, n, menulist);
		}
	    }
	    else {
		if(d->ops->op_undelete == NULL) {
		    list_undelete(n, menulist);
		}
		else {
		    d->ops->op_undelete(NULL, n, menulist);
		}
	    }
	}
	n = n->next;
    }

    return 0;
}
Ejemplo n.º 2
0
Archivo: cmenu.c Proyecto: jkkm/xfsdump
int
menu_undelete(WINDOW *win, node_t *current, node_t *list)
{
    data_t *d;

    if(current == NULL || current->data == NULL) {
	return BOOL_FALSE;
    }
    d = (data_t *)(current->data);

    if(d->ops != NULL && d->ops->op_undelete != NULL) {
	return d->ops->op_undelete(win, current, list);
    }

    list_undelete(current, list);

    redraw_screen = BOOL_TRUE;

    return BOOL_FALSE;
}
Ejemplo n.º 3
0
/*ARGSUSED*/
int
stobj_undelete(WINDOW *win, node_t *current, node_t *list)
{
    node_t *n;
    data_t *d;

    if(current == NULL || current->data == NULL) {
	return BOOL_FALSE;
    }

    list_undelete(current, list);

    d = ((data_t *)(current->data));
    n = current->next;
    while(n != NULL && n->data != NULL && ((data_t *)(n->data))->level > d->level) {
	((data_t *)(n->data))->deleted = BOOL_FALSE;
	((data_t *)(n->data))->text[0] = ' ';
	n = n->next;
    }

    redraw_screen = BOOL_TRUE;

    return BOOL_FALSE;
}