version 1.40, 2020/04/13 18:59:41 |
version 1.41, 2020/04/22 21:01:28 |
|
|
} |
} |
} |
} |
|
|
void |
static int |
mode_tree_set_current(struct mode_tree_data *mtd, uint64_t tag) |
mode_tree_get_tag(struct mode_tree_data *mtd, uint64_t tag, u_int *found) |
{ |
{ |
u_int i; |
u_int i; |
|
|
|
|
break; |
break; |
} |
} |
if (i != mtd->line_size) { |
if (i != mtd->line_size) { |
mtd->current = i; |
*found = i; |
|
return (1); |
|
} |
|
return (0); |
|
} |
|
|
|
void |
|
mode_tree_expand(struct mode_tree_data *mtd, uint64_t tag) |
|
{ |
|
u_int found; |
|
|
|
if (!mode_tree_get_tag(mtd, tag, &found)) |
|
return; |
|
if (!mtd->line_list[found].item->expanded) { |
|
mtd->line_list[found].item->expanded = 1; |
|
mode_tree_build(mtd); |
|
} |
|
} |
|
|
|
int |
|
mode_tree_set_current(struct mode_tree_data *mtd, uint64_t tag) |
|
{ |
|
u_int found; |
|
|
|
if (mode_tree_get_tag(mtd, tag, &found)) { |
|
mtd->current = found; |
if (mtd->current > mtd->height - 1) |
if (mtd->current > mtd->height - 1) |
mtd->offset = mtd->current - mtd->height + 1; |
mtd->offset = mtd->current - mtd->height + 1; |
else |
else |
mtd->offset = 0; |
mtd->offset = 0; |
} else { |
return (1); |
mtd->current = 0; |
|
mtd->offset = 0; |
|
} |
} |
|
mtd->current = 0; |
|
mtd->offset = 0; |
|
return (0); |
} |
} |
|
|
u_int |
u_int |