Used for callbacks.
Signed-off-by: NeilBrown <neil@brown.name>
a = "no";
if (a)
return comm_call(ci->comm2, "callback:get_attr", ci->focus, 0,
- NULL, a, 0);
+ NULL, a);
/* Once a get-attr request reaches a document, it needs to stop there,
* as parents might have a different idea about attributes, and about marks
*/
m2 = doc_new_mark(ci->home->data, ci->numeric);
if (ci->extra == 3 && ci->mark)
m2 = do_vmark_at_or_before(ci->focus, ci->home->data, ci->mark, ci->numeric);
- return comm_call7(ci->comm2, "callback:vmark", ci->focus,
- 0, m, NULL, 0, NULL, m2);
+ return comm_call(ci->comm2, "callback:vmark", ci->focus,
+ 0, m, NULL, 0, m2);
}
DEF_CMD(doc_drop_cache)
m = do_mark_at_point(pt, ci->extra);
return comm_call(ci->comm2, "callback:dup-point", ci->focus,
- 0, m, NULL, 0);
+ 0, m);
}
if (strcmp(ci->key, "doc:assign") == 0) {
p2 = doc_assign(ci->home, ci->focus, ci->numeric, ci->str);
if (!p2)
return -1;
- comm_call(ci->comm2, "callback:doc", p2, 0, NULL, NULL, 0);
+ comm_call(ci->comm2, "callback:doc", p2);
return 1;
}
a = pane_attr_get(dd->doc, ci->str);
if (!a)
return 0;
- return comm_call(ci->comm2, "callback", ci->focus, 0, NULL, a, 0);
+ return comm_call(ci->comm2, "callback", ci->focus, 0, NULL, a);
}
if (strcmp(ci->key, "Move-to") == 0) {
struct pane *p = doc_attach(ci->focus, NULL);
if (!p)
return -1;
- return comm_call(ci->comm2, "callback:doc", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", p);
}
DEF_CMD(doc_open)
}
if (fd != ci->numeric)
close(fd);
- return comm_call(ci->comm2, "callback", p, 0, NULL,
- NULL, 0);
+ return comm_call(ci->comm2, "callback", p);
}
struct pane *doc_attach_view(struct pane *parent safe, struct pane *doc safe, char *render)
call("global-multicall-doc:appeared-", p, 1, NULL, NULL, 0);
}
call("doc:replace", p, 1, NULL, text, 1, NULL, NULL);
- return comm_call(ci->comm2, "callback", p, 0, NULL,
- NULL, 0);
+ return comm_call(ci->comm2, "callback", p);
}
DEF_CMD(doc_str_callback)
if (!ci->str ||
!(cm = key_lookup_cmd(map, ci->str)))
return -1;
- return comm_call8(ci->comm2, ci->focus, "callback:comm", ci->focus, 0, NULL, ci->str,
- 0, NULL, NULL, cm);
+ return comm_call(ci->comm2, "callback:comm", ci->focus, 0, NULL, ci->str,
+ 0, NULL, NULL, cm);
}
DEF_CMD(editor_load_module)
while (ei->idle_calls) {
struct idle_call *i = ei->idle_calls;
ei->idle_calls = i->next;
- comm_call(i->callback, "idle-callback", i->focus, 0, NULL, NULL, 0);
+ comm_call(i->callback, "idle-callback", i->focus);
command_put(i->callback);
free(i);
}
do_call(key, focus, 0, NULL, NULL, 0, NULL, NULL, comm2, 0, 0, NULL)
-
static inline int do_call(char *key safe, struct pane *focus safe, int numeric, struct mark *m,
char *str, int extra, struct mark *m2, char *str2,
struct command *comm2, int x, int y, struct pane *home)
return key_handle(&ci);
}
+/* comm_call() is quite different to call*(). It calls a specific command,
+ * not a stack of panes. The comm comes first.
+ * This is mostly used for callback.
+ */
+#define comm_call(...) VFUNC(comm_call, __VA_ARGS__)
+#define comm_call13(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2, x, y, home) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2, x, y, home)
+#define comm_call12(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2, x, y) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2, x, y, NULL)
+#define comm_call10(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, mark2, str2, comm2, 0, 0, NULL)
+#define comm_call9(comm, key, focus, numeric, mark, str, extra, mark2, str2) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, mark2, str2, NULL, 0, 0, NULL)
+#define comm_call8(comm, key, focus, numeric, mark, str, extra, mark2) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, mark2, NULL, NULL, 0, 0, NULL)
+#define comm_call7(comm, key, focus, numeric, mark, str, extra) \
+ do_comm_call(comm, key, focus, numeric, mark, str, extra, NULL, NULL, NULL, 0, 0, NULL)
+#define comm_call6(comm, key, focus, numeric, mark, str) \
+ do_comm_call(comm, key, focus, numeric, mark, str, 0, NULL, NULL, NULL, 0, 0, NULL)
+#define comm_call5(comm, key, focus, numeric, mark) \
+ do_comm_call(comm, key, focus, numeric, mark, NULL, 0, NULL, NULL, NULL, 0, 0, NULL)
+#define comm_call4(comm, key, focus, numeric) \
+ do_comm_call(comm, key, focus, numeric, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL)
+#define comm_call3(comm, key, focus) \
+ do_comm_call(comm, key, focus, 0, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL)
+
+static inline int do_comm_call(struct command *comm,
+ char *key safe, struct pane *focus safe, int numeric, struct mark *m,
+ char *str, int extra, struct mark *m2, char *str2,
+ struct command *comm2, int x, int y, struct pane *home)
+{
+ struct cmd_info ci = {.key = key, .focus = focus, .home = home ?: focus,
+ .numeric = numeric, .mark = m, .str = str,
+ .extra = extra, .mark2 = m2, .str2 = str2,
+ .comm2 = comm2, .x = x, .y = y,
+ .comm = safe_cast 0};
+
+ if (!comm)
+ return -1;
+ ci.comm = comm;
+ return ci.comm->func(&ci);
+}
+
struct call_return {
struct command c;
struct mark *m, *m2;
struct command *comm;
};
-static inline int comm_call(struct command *comm, char *key safe, struct pane *focus safe,
- int numeric, struct mark *m, char *str, int extra)
-{
- struct cmd_info ci = {.key = key, .focus = focus, .home = focus, .comm = safe_cast 0};
-
- if (!comm)
- return -1;
- ci.numeric = numeric;
- ci.mark = m;
- ci.str = str;
- ci.extra = extra;
- ci.comm = comm;
- return ci.comm->func(&ci);
-}
-
-static inline int comm_call_xy(struct command *comm, char *key safe, struct pane *focus safe,
- int numeric, int extra, int x, int y)
-{
- struct cmd_info ci = {.key = key, .focus = focus, .home = focus, .comm = safe_cast 0};
-
- if (!comm)
- return -1;
- ci.numeric = numeric;
- ci.extra = extra;
- ci.x = x;
- ci.y = y;
- ci.comm = comm;
- return ci.comm->func(&ci);
-}
-
static inline int comm_call_pane(struct pane *home, char *key safe,
struct pane *focus safe,
int numeric, struct mark *m, char *str, int extra,
ci.comm2 = comm2;
return ci.comm->func(&ci);
}
-
-static inline int comm_call7(struct command *comm, char *key safe,
- struct pane *focus safe,
- int numeric, struct mark *m, char *str,
- int extra, char *str2, struct mark *m2)
-{
- struct cmd_info ci = {.key = key, .focus = focus, .home = focus, .comm = safe_cast 0};
-
- if (!comm)
- return -1;
- ci.numeric = numeric;
- ci.mark = m;
- ci.mark2 = m2;
- ci.str = str;
- ci.str2 = str2;
- ci.extra = extra;
- ci.comm = comm;
- return ci.comm->func(&ci);
-}
-
-static inline int comm_call8(struct command *comm, struct pane *home safe,
- char *key safe,
- struct pane *focus safe,
- int numeric, struct mark *m, char *str,
- int extra, char *str2, struct mark *m2,
- struct command *comm2)
-{
- struct cmd_info ci = {.key = key, .focus = focus, .home = home, .comm = safe_cast 0};
-
- if (!comm)
- return -1;
- ci.numeric = numeric;
- ci.mark = m;
- ci.mark2 = m2;
- ci.str = str;
- ci.str2 = str2;
- ci.extra = extra;
- ci.comm = comm;
- ci.comm2 = comm2;
- return ci.comm->func(&ci);
-}
if (size <= max_space)
max_bytes = offset;
}
- return comm_call_xy(ci->comm2, "callback:size", ci->focus,
- max_bytes, 0, size, 1);
+ return comm_call(ci->comm2, "callback:size", ci->focus,
+ max_bytes, NULL, NULL,
+ 0, NULL, NULL, NULL, size, 1);
}
if (strcmp(ci->key, "Draw:text") == 0 && ci->str) {
int attr = cvt_attrs(ci->str2);
{
struct pane *p = ncurses_init(ci->focus);
if (p)
- return comm_call(ci->comm2, "callback:display", p, 0, NULL,
- NULL, 0);
+ return comm_call(ci->comm2, "callback:display", p);
return -1;
}
p = pane_register(ci->home, 0, &doc_handle.c, &dr->doc, NULL);
dr->doc.home = p;
if (p)
- return comm_call(ci->comm2, "callback:doc", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", p);
return -1;
}
if (!val)
return 0;
- comm_call(ci->comm2, "callback:get_attr", ci->focus,
- 0, NULL, val, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val);
return 1;
}
val = dr->fname;
else
return 0;
- comm_call(ci->comm2, "callback:get_attr", ci->focus,
- 0, NULL, val, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val);
return 1;
}
prev_modified(ci->home->parent, m);
attr = pane_mark_attr(ci->home->parent, m, 1, ci->str);
mark_free(m);
- comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, attr, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, attr);
return 1;
}
if (strcmp(ci->key, "doc:mark-same") == 0 &&
ci->str &&
strcmp(ci->str, "doc-name") == 0)
return comm_call(ci->comm2, "callback:get_attr", ci->focus,
- 0, NULL, "*Modified Documents*", 0);
+ 0, NULL, "*Modified Documents*");
return 0;
}
if (strcmp(ci->key, "docs:byname") == 0) {
if (ci->str == NULL || strcmp(ci->str, "*Documents*") == 0)
- return comm_call(ci->comm2, "callback:doc", doc->doc.home,
- 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", doc->doc.home);
list_for_each_entry(p, &doc->collection->children, siblings) {
struct doc *dc = p->data;
char *n = dc->name;
if (n && strcmp(ci->str, n) == 0)
- return comm_call(ci->comm2, "callback:doc", p, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", p);
}
return -1;
}
list_for_each_entry(p, &doc->collection->children, siblings) {
if (call("doc:same-file", p, 0, NULL, ci->str,
ci->extra) > 0)
- return comm_call(ci->comm2, "callback:doc", p, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", p);
}
return -1;
}
choice = last;
if (!choice)
choice = doc->doc.home;
- return comm_call(ci->comm2, "callback:doc", choice, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", choice);
}
if (strcmp(ci->key, "docs:save-all") == 0) {
if (!val)
return 0;
- comm_call(ci->comm2, "callback:get_attr", ci->focus,
- 0, NULL, val, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val);
return 1;
}
return 0;
comm_call(ci->comm2, "callback:get_attr", ci->focus,
- 0, NULL, val, 0);
+ 0, NULL, val);
return 1;
}
call_home(p, "doc:set-parent", doc->collection);
- return comm_call(ci->comm2, "callback:doc", doc->doc.home, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", doc->doc.home);
}
void edlib_init(struct pane *ed safe)
}
ret = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL,
- buf_final(&b), 0);
+ buf_final(&b));
free(b.b);
return ret;
}
fields += 1;
}
sprintf(ret, "%d", fields);
- return comm_call(ci->comm2, "callback", ci->focus, 0, ci->mark, ret, 0);
+ return comm_call(ci->comm2, "callback", ci->focus, 0, ci->mark, ret);
}
static struct map *email_map safe;
attr_set_str(&h->attrs, "render-default", "text");
attr_set_str(&p->attrs, "filename", ci->str+6);
attr_set_str(&p->attrs, "doc-type", "email");
- return comm_call(ci->comm2, "callback:attach", h, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", h);
}
out:
mark_free(start);
if (strcmp(attr, "multipart:visible") == 0) {
if (d >= 0 && d < mpi->nparts &&
mpi->parts[d].visible)
- comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, "1", 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, "1");
else
- comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, "0", 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, "0");
return 1;
}
/* Get a pane attribute, not char attribute */
char *s = pane_attr_get(mpi->parts[d].pane, attr);
if (s)
- return comm_call(ci->comm2, "callback", ci->focus, 0, NULL,
- s, 0);
+ return comm_call(ci->comm2, "callback", ci->focus, 0, NULL, s);
return 1;
}
h = pane_register(ci->home, 0, &mp_handle.c, &mpi->doc, NULL);
mpi->doc.home = h;
if (h)
- return comm_call(ci->comm2, "callback:doc", h, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", h);
free(mpi);
p = pane_register(ci->home, 0, &text_handle.c, &t->doc, NULL);
t->doc.home = p;
if (p)
- return comm_call(ci->comm2, "callback:doc", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:doc", p);
return -1;
}
break;
}
ret[l] = 0;
- comm_call(ci->comm2, "callback:get-str", ci->focus, 0, NULL, ret, 0);
+ comm_call(ci->comm2, "callback:get-str", ci->focus, 0, NULL, ret);
free(ret);
return 1;
}
return -1;
a = text_attrset(d, m, forward, &o);
val = attr_get_str(a, attr, o);
- comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val);
if (ci->extra == 1) {
char *key = attr;
int len = strlen(attr);
while ((key = attr_get_next_key(a, key, o, &val)) != NULL &&
strncmp(key, attr, len) == 0)
- comm_call7(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val, 0,
- key, NULL);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val, 0,
+ NULL, key);
}
return 1;
}
else
return 0;
- comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val, 0);
+ comm_call(ci->comm2, "callback:get_attr", ci->focus, 0, NULL, val);
return 1;
}
p = pane_register(ci->focus, 0, &search_handle.c, esi, NULL);
if (p) {
call("Request:Notify:doc:Replace", p);
- comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ comm_call(ci->comm2, "callback:attach", p);
}
return 1;
}
}
call("doc:set:filter", p, 1, NULL, NULL, 0);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
cd->start = mark_dup(ci->mark, 1);
cd->end = mark_dup(ci->mark2, 1);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
p = pane_register(ci->focus, 0, &history_handle, hi, NULL);
pane_add_notify(p, hi->history, "Notify:Close");
call("Request:Notify:doc:Replace", p);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
p = pane_register(ci->focus, 0, &input_handle.c, im, NULL);
if (p)
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
return -1;
}
{
struct pane *p = do_keymap_attach(ci->focus, 1);
if (p)
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
return -1;
}
int ret;
int oldfd = ev->fd;
- if ((ret=comm_call(ev->comm, "callback:event", ev->home, thing,
- NULL, NULL, 0)) < 0) {
+ if ((ret=comm_call(ev->comm, "callback:event", ev->home, thing)) < 0) {
if (oldfd == ev->fd)
/* No early removal */
event_del(ev->l);
{
struct evt *ev safe = safe_cast evv;
- if (comm_call(ev->comm, "callback:event", ev->home, thing,
- NULL, NULL, 0) < 0) {
+ if (comm_call(ev->comm, "callback:event", ev->home, thing) < 0) {
event_free(ev->l);
list_del(&ev->lst);
command_put(ev->comm);
ret = do_messageline_attach(ci->focus);
if (!ret)
return -1;
- return comm_call(ci->comm2, "callback:attach", ret, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", ret);
}
void edlib_init(struct pane *ed safe)
return 1;
}
if (strcmp(ci->key, "popup:get-target") == 0)
- return comm_call(ci->comm2, "callback:get-target",
- ppi->target, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:get-target", ppi->target);
if (strcmp(ci->key, "popup:close") == 0) {
char *key, *str;
if (!p)
return -1;
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
return -1;
call("doc:set:filter", p, 1, NULL, NULL, 0);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
}
ret = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL,
- buf_final(&b), 0);
+ buf_final(&b));
free(b.b);
return ret;
}
ret = do_renderline_attach(ci->focus);
if (!ret)
return -1;
- return comm_call(ci->comm2, "callback:attach", ret, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", ret);
}
DEF_CMD(rl_clone)
if (start && end)
find_headers(p, start, end);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
ti->name = strdup(ci->str2);
INIT_LIST_HEAD(&ti->tiles);
attr_set_str(&p->attrs, "borders", "BL");
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
static struct pane *tile_split(struct pane **pp safe, int horiz, int after, char *name,
ti2 = tile_next_named(ti, ci->str2);
if (ti2 != ti)
- return comm_call(ci->comm2, "callback:pane", ti2->p, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:pane", ti2->p);
/* Need to create a tile. If wider than 120 (FIXME configurable?),
* horiz-split else vert
p2 = tile_split(&p, p->w * 1000 >= 1200 * xy.x, 1, ci->str2, 0);
}
if (p2)
- return comm_call(ci->comm2, "callback:pane", p2, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:pane", p2);
return -1;
}
/* same group - continue */
}
return comm_call(ci->comm2, "callback:pane", ci->home, 0,
- NULL, ti->name, 0);
+ NULL, ti->name);
}
DEF_CMD(tile_root)
/* same group - continue */
}
- return comm_call(ci->comm2, "callback:pane", p, 0,
- NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:pane", p);
}
DEF_CMD(tile_child_closed)
return -1;
call("doc:set:filter", p, 1, NULL, NULL, 0);
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)
if (strchr(borderstr, 'L')) borders |= BORDER_LEFT;
if (strchr(borderstr, 'R')) borders |= BORDER_RIGHT;
- return comm_call(ci->comm2, "callback:attach", do_view_attach(ci->focus, borders),
- 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", do_view_attach(ci->focus, borders));
}
-
DEF_CMD(view_click)
{
struct pane *p = ci->home;
DEF_CMD(viewer_attach)
{
- return comm_call(ci->comm2, "callback:attach", do_viewer_attach(ci->focus),
- 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", do_viewer_attach(ci->focus));
}
DEF_CMD(no_replace)
0, ci->mark2, &cr.c) == 0)
return 0;
- ret = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL, cr.s, 0);
+ ret = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL, cr.s);
free(cr.s);
if (ci->numeric != NO_NUMERIC)
return ret;
while (rpt > 1) {
struct call_return cr;
cr.c = eol_cb;
- if (comm_call8(&render_complete_line, ci->home, "render-line",
- ci->focus, NO_NUMERIC, ci->mark, NULL,
- 0, NULL, NULL, &cr.c) <= 0)
+ if (comm_call(&render_complete_line, "render-line",
+ ci->focus, NO_NUMERIC, ci->mark, NULL,
+ 0, NULL, NULL, &cr.c, 0, 0, ci->home) <= 0)
rpt = 1;
rpt -= 1;
}
common[common_len(c, common)] = 0;
cnt += 1;
}
- comm_call(ci->comm2, "callback:prefix", ci->focus, 0, NULL, common, 0);
+ comm_call(ci->comm2, "callback:prefix", ci->focus, 0, NULL, common);
free(common);
call("Move-to", ci->focus, 0, m);
mark_free(m);
cr.c = save_str;
cr.s = NULL;
- comm_call8(&render_complete_line, ci->home, "render-line",
- ci->home, NO_NUMERIC, ci->mark, NULL, 0, NULL,
- NULL, &cr.c);
+ comm_call(&render_complete_line, "render-line",
+ ci->home, NO_NUMERIC, ci->mark, NULL, 0, NULL,
+ NULL, &cr.c, 0, 0, ci->home);
if (!cr.s)
return 1;
l = strlen(cr.s);
}
cd->prefix = strdup("");
- return comm_call(ci->comm2, "callback:attach", complete, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", complete);
}
void edlib_init(struct pane *ed safe)
}
}
rv = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL,
- buf_final(&ret), 0);
+ buf_final(&ret));
free(ret.b);
return rv;
}
strcmp(ci->str, "renderline:fields") != 0)
return 0;
sprintf(attr, "%u:%u", rf->home_field, rf->fields);
- return comm_call(ci->comm2, "attr", ci->focus, 0, ci->mark, attr, 0);
+ return comm_call(ci->comm2, "attr", ci->focus, 0, ci->mark, attr);
}
static struct map *rf_map;
p = do_render_format_attach(ci->focus);
if (!p)
return -1;
- return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p, 0, NULL, NULL);
}
void edlib_init(struct pane *ed safe)
if (m)
mark_free(m);
rv = comm_call(ci->comm2, "callback:render", ci->focus, 0, NULL,
- buf_final(&ret), 0);
+ buf_final(&ret));
free(ret.b);
return rv;
}
if (!p)
return -1;
- return comm_call(ci->comm2, "callback:attach",
- p,
- 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
DEF_CMD(hex_appeared)
p = pane_register(p, 0, &render_lines_handle.c, rl, NULL);
call("Request:Notify:doc:Replace", p, 0, NULL);
- return comm_call(ci->comm2, "callback:attach", p,
- 0, NULL, NULL, 0);
+ return comm_call(ci->comm2, "callback:attach", p);
}
void edlib_init(struct pane *ed safe)