aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authornicm <nicm>2017-04-20 09:20:22 +0000
committernicm <nicm>2017-04-20 09:20:22 +0000
commit0b44ad99b51606a8cab662e04cf043a8c4a3ca92 (patch)
tree06a3c095e0babd541df00c9cd80bac898724c984 /tmux.h
parentf184c6f06c8bd63390ecec3fbe290b087f995ea7 (diff)
downloadrtmux-0b44ad99b51606a8cab662e04cf043a8c4a3ca92.tar.gz
rtmux-0b44ad99b51606a8cab662e04cf043a8c4a3ca92.tar.bz2
rtmux-0b44ad99b51606a8cab662e04cf043a8c4a3ca92.zip
If a #() command doesn't exit, use its most recent line of output (it
must be a full line). Don't let it redraw the status line more than once a second. Requested by someone about 10 years ago...
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/tmux.h b/tmux.h
index e000081d..adad2edc 100644
--- a/tmux.h
+++ b/tmux.h
@@ -588,6 +588,10 @@ struct hook {
};
/* Scheduled job. */
+struct job;
+typedef void (*job_update_cb) (struct job *);
+typedef void (*job_complete_cb) (struct job *);
+typedef void (*job_free_cb) (void *);
struct job {
enum {
JOB_RUNNING,
@@ -595,18 +599,19 @@ struct job {
JOB_CLOSED
} state;
- char *cmd;
- pid_t pid;
- int status;
+ char *cmd;
+ pid_t pid;
+ int status;
- int fd;
- struct bufferevent *event;
+ int fd;
+ struct bufferevent *event;
- void (*callbackfn)(struct job *);
- void (*freefn)(void *);
- void *data;
+ job_update_cb updatecb;
+ job_complete_cb completecb;
+ job_free_cb freecb;
+ void *data;
- LIST_ENTRY(job) lentry;
+ LIST_ENTRY(job) entry;
};
LIST_HEAD(joblist, job);
@@ -1601,10 +1606,10 @@ extern const struct options_table_entry options_table[];
/* job.c */
extern struct joblist all_jobs;
-struct job *job_run(const char *, struct session *, const char *,
- void (*)(struct job *), void (*)(void *), void *);
-void job_free(struct job *);
-void job_died(struct job *, int);
+struct job *job_run(const char *, struct session *, const char *,
+ job_update_cb, job_complete_cb, job_free_cb, void *);
+void job_free(struct job *);
+void job_died(struct job *, int);
/* environ.c */
struct environ *environ_create(void);