terminal: call user-defined callback when destroying terminal

main uses this to get the exit code of the terminal.
This commit is contained in:
Daniel Eklöf 2019-11-01 20:34:32 +01:00
parent 70b236d66d
commit 1e41a25f00
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 38 additions and 13 deletions

View file

@ -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);