Commit 8952e29b authored by Niels Möller's avatar Niels Möller

* src/interact.h (interact_dialog): New instruction attribute.

(INTERACT_DIALOG): Deleted instruction argument.
* src/interact.c (make_interact_dialog): Initialize
self->instruction to NULL.

Rev: src/interact.c:1.9
Rev: src/interact.h:1.14
parent 304fd632
......@@ -51,7 +51,8 @@ make_interact_dialog(unsigned nprompt)
{
NEW(interact_dialog, self);
unsigned i;
self->instruction = NULL;
self->nprompt = nprompt;
self->prompt = lsh_space_alloc(nprompt * sizeof(struct lsh_string *));
self->response = lsh_space_alloc(nprompt * sizeof(struct lsh_string *));
......
......@@ -63,6 +63,7 @@ struct terminal_dimensions;
(class
(name interact_dialog)
(vars
(instruction string)
(nprompt . unsigned)
(prompt space (string) nprompt)
(response space (string) nprompt)
......@@ -85,9 +86,7 @@ make_interact_dialog(unsigned nprompt);
(yes_or_no method int
"const struct lsh_string *prompt"
"int def" "int free")
; Consumes instruction
(dialog method int
"const struct lsh_string *instruction"
"const struct interact_dialog *dialog")
(get_attributes method (object terminal_attributes) )
......@@ -106,8 +105,8 @@ make_interact_dialog(unsigned nprompt);
((i)->set_askpass((i), (a)))
#define INTERACT_YES_OR_NO(i, p, d, f) \
((i)->yes_or_no((i), (p), (d), (f)))
#define INTERACT_DIALOG(i, s, d) \
((i)->dialog((i), (s), (d)))
#define INTERACT_DIALOG(i, d) \
((i)->dialog((i), (d)))
#define INTERACT_GET_ATTRIBUTES(i) \
((i)->get_attributes((i)))
#define INTERACT_SET_ATTRIBUTES(i, t) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment