aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-01 19:34:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-01 19:34:32 +0000
commit1e41a25f00aab1038486cff37e286fd5c729a72b (patch)
treea10b1a978d4310306d4fa473bc2cc6bc04861c0e /terminal.h
parentterm_shutdown(): cleanup (diff)
terminal: call user-defined callback when destroying terminal
main uses this to get the exit code of the terminal.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/terminal.h b/terminal.h
index 5a0473b3..3ec2802c 100644
--- a/terminal.h
+++ b/terminal.h
@@ -287,12 +287,18 @@ struct terminal {
int lower_fd;
int upper_fd;
} delayed_render_timer;
+
+ bool is_shutting_down;
+ void (*shutdown_cb)(void *data, int exit_code);
+ void *shutdown_data;
};
struct config;
struct terminal *term_init(
const struct config *conf, struct fdm *fdm, struct wayland *wayl,
- int argc, char *const *argv);
+ int argc, char *const *argv,
+ void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data);
+
bool term_shutdown(struct terminal *term);
int term_destroy(struct terminal *term);