version 1.75, 2011/04/29 07:07:31 |
version 1.76, 2011/07/02 21:05:44 |
|
|
|
|
/* Enable status line prompt. */ |
/* Enable status line prompt. */ |
void |
void |
status_prompt_set(struct client *c, const char *msg, |
status_prompt_set(struct client *c, const char *msg, const char *input, |
int (*callbackfn)(void *, const char *), void (*freefn)(void *), |
int (*callbackfn)(void *, const char *), void (*freefn)(void *), |
void *data, int flags) |
void *data, int flags) |
{ |
{ |
|
|
|
|
c->prompt_string = xstrdup(msg); |
c->prompt_string = xstrdup(msg); |
|
|
c->prompt_buffer = xstrdup(""); |
if (input != NULL) |
c->prompt_index = 0; |
c->prompt_buffer = xstrdup(input); |
|
else |
|
c->prompt_buffer = xstrdup(""); |
|
c->prompt_index = strlen(c->prompt_buffer); |
|
|
c->prompt_callbackfn = callbackfn; |
c->prompt_callbackfn = callbackfn; |
c->prompt_freefn = freefn; |
c->prompt_freefn = freefn; |
|
|
|
|
/* Update status line prompt with a new prompt string. */ |
/* Update status line prompt with a new prompt string. */ |
void |
void |
status_prompt_update(struct client *c, const char *msg) |
status_prompt_update(struct client *c, const char *msg, const char *input) |
{ |
{ |
xfree(c->prompt_string); |
xfree(c->prompt_string); |
c->prompt_string = xstrdup(msg); |
c->prompt_string = xstrdup(msg); |
|
|
*c->prompt_buffer = '\0'; |
xfree(c->prompt_buffer); |
c->prompt_index = 0; |
if (input != NULL) |
|
c->prompt_buffer = xstrdup(input); |
|
else |
|
c->prompt_buffer = xstrdup(""); |
|
c->prompt_index = strlen(c->prompt_buffer); |
|
|
c->prompt_hindex = 0; |
c->prompt_hindex = 0; |
|
|