aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authornicm <nicm>2018-08-23 15:45:05 +0000
committernicm <nicm>2018-08-23 15:45:05 +0000
commitbceccc6b63b48ddeefb035ef6d910bea60340342 (patch)
treec431664eda689fe64d533f846cf180427f0b0eba /tmux.h
parent55db3623bf7084a161d457f0c0b891a46a444a77 (diff)
downloadrtmux-bceccc6b63b48ddeefb035ef6d910bea60340342.tar.gz
rtmux-bceccc6b63b48ddeefb035ef6d910bea60340342.tar.bz2
rtmux-bceccc6b63b48ddeefb035ef6d910bea60340342.zip
Move job struct into job.c.
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h45
1 files changed, 12 insertions, 33 deletions
diff --git a/tmux.h b/tmux.h
index 62170215..7a1cc502 100644
--- a/tmux.h
+++ b/tmux.h
@@ -44,6 +44,7 @@ struct cmdq_list;
struct environ;
struct format_job_tree;
struct input_ctx;
+struct job;
struct mode_tree_data;
struct mouse_event;
struct options;
@@ -619,37 +620,6 @@ struct hook {
RB_ENTRY(hook) entry;
};
-/* 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,
- JOB_DEAD,
- JOB_CLOSED
- } state;
-
- int flags;
-#define JOB_NOWAIT 0x1
-
- char *cmd;
- pid_t pid;
- int status;
-
- int fd;
- struct bufferevent *event;
-
- job_update_cb updatecb;
- job_complete_cb completecb;
- job_free_cb freecb;
- void *data;
-
- LIST_ENTRY(job) entry;
-};
-LIST_HEAD(joblist, job);
-
/* Virtual screen. */
struct screen_sel;
struct screen_titles;
@@ -1628,11 +1598,20 @@ void options_style_update_old(struct options *,
extern const struct options_table_entry options_table[];
/* job.c */
-extern struct joblist all_jobs;
+typedef void (*job_update_cb) (struct job *);
+typedef void (*job_complete_cb) (struct job *);
+typedef void (*job_free_cb) (void *);
+#define JOB_NOWAIT 0x1
struct job *job_run(const char *, struct session *, const char *,
job_update_cb, job_complete_cb, job_free_cb, void *, int);
void job_free(struct job *);
-void job_died(struct job *, int);
+void job_check_died(pid_t, int);
+int job_get_status(struct job *);
+void *job_get_data(struct job *);
+struct bufferevent *job_get_event(struct job *);
+void job_kill_all(void);
+int job_still_running(void);
+void job_print_summary(struct cmdq_item *, int);
/* environ.c */
struct environ *environ_create(void);