No longer needed.
Signed-off-by: NeilBrown <neil@brown.name>
struct pane *p = doc_attach(ci->focus, d);
struct pane *c = pane_child(ci->home);
- point_dup(ci->home->point, &p->point);
+ p->point = point_dup(ci->home->point);
if (c)
pane_clone(c, p);
return 1;
if (strcmp(ci->key, "Close") == 0) {
if (ci->home->point)
point_free(ci->home->point);
+ ci->home->point = NULL;
return 1;
}
ci->mark = NULL;
if (ci->home->point) {
if (ci->extra == MARK_POINT) {
- point_dup(ci->home->point, &pt);
+ pt = point_dup(ci->home->point);
ci->mark = &pt->m;
}
if (ci->extra == MARK_UNGROUPED)
struct pane *p;
p = doc_attach(parent, doc->data);
if (p) {
- point_new(doc->data, &p->point);
+ p->point = point_new(doc->data);
p = pane_attach(p, "view", doc, NULL);
}
if (p)
void point_free(struct point *p)
{
int i;
- *p->owner = NULL;
for (i = 0; i < p->size; i++)
tlist_del_init(&p->links->lists[i]);
mark_delete(&p->m);
return ret;
}
-struct point *point_dup(struct point *p, struct point **owner)
+struct point *point_dup(struct point *p)
{
int i;
struct point *ret = malloc(sizeof(*ret));
INIT_TLIST_HEAD(&lnk->lists[i], GRP_LIST);
else
tlist_add(&lnk->lists[i], GRP_LIST, &p->links->lists[i]);
- *owner = ret;
- ret->owner = owner;
ret->doc = p->doc;
return ret;
}
INIT_TLIST_HEAD(&lnk->lists[i], GRP_LIST);
}
-struct point *point_new(struct doc *d, struct point **owner)
+struct point *point_new(struct doc *d)
{
struct point *ret = malloc(sizeof(*ret));
struct point_links *lnk = malloc(sizeof(*lnk) +
ret->m.attrs = NULL;
ret->m.viewnum = MARK_POINT;
ret->size = d->nviews;
- ret->owner = owner;
ret->doc = d;
ret->links = lnk;
lnk->pt = ret;
__mark_reset(d, &ret->m, 1, 0);
- if (owner)
- *owner = ret;
return ret;
}
point = parent->point;
parent->point = p->point;
p->point = point;
- if (parent->point)
- parent->point->owner = &parent->point;
- if (p->point)
- p->point->owner = &p->point;
}
int pane_masked(struct pane *p, int x, int y, int z, int *w, int *h)
struct point {
struct mark m;
struct doc *doc;
- struct point **owner;
int size;
struct point_links {
struct point *pt;
int mark_same2(struct doc *d, struct mark *m1, struct mark *m2, struct cmd_info *ci);
int mark_same_pane(struct pane *p, struct mark *m1, struct mark *m2,
struct cmd_info *ci);
-struct point *point_new(struct doc *d, struct point **owner);
-struct point *point_dup(struct point *p, struct point **owner);
+struct point *point_new(struct doc *d);
+struct point *point_dup(struct point *p);
wint_t mark_step(struct doc *d, struct mark *m, int forward, int move, struct cmd_info *ci);
wint_t mark_step2(struct doc *d, struct mark *m, int forward, int move);
wint_t mark_next(struct doc *d, struct mark *m);
/* TEMP HACK - please fix */
doc_set_attr(esi->end, "highlight", NULL);
point_free(esi->end);
+ esi->end = NULL;
mark_free(esi->start);
while (esi->s) {
struct stk *n = esi->s;
return -1;
}
esi->end = container_of(ci2.mark, struct point, m);
- esi->end->owner = &esi->end;
esi->start = mark_dup(ci2.mark, 1);
esi->s = NULL;