From: Karel Zak Date: Wed, 2 Oct 2019 15:34:51 +0000 (+0200) Subject: lib/pty-session: add log callbacks X-Git-Tag: v2.35-rc1~123 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Futil-linux.git;a=commitdiff_plain;h=04f0c95f9332c00da649fe02ab8aa7b58d855c37 lib/pty-session: add log callbacks Signed-off-by: Karel Zak --- diff --git a/include/pty-session.h b/include/pty-session.h index c139d6f97e..66b62a1dea 100644 --- a/include/pty-session.h +++ b/include/pty-session.h @@ -11,11 +11,44 @@ #include #include +#include + +/* + * Callbacks -- the first argument is always callback data, see + * ul_pty_set_callback_data(). + */ struct ul_pty_callbacks { + /* + * Executed on SIGCHLD when ssi_code is EXITED, KILLED or DUMPED + * @ + */ void (*child_wait)(void *); + + /* + * Executed on SIGCHLD when ssi_status is SIGSTOP + */ void (*child_sigstop)(void *); + /* + * Executed in master loop before ul_pty enter poll() and in time set by + * ul_pty_set_mainloop_time(). The callback is no used when time is not set. + */ int (*mainloop)(void *); + + /* + * Executed on master or stdin activity, arguments: + * 2nd - file descriptor + * 3rd - buffer with data + * 4th - size of the data + */ + int (*log_stream_activity)(void *, int, char *, size_t); + + /* + * Executed on signal, arguments: + * 2nd - signal info + * 3rd - NULL or signal specific data (e.g. struct winsize on SIGWINCH + */ + int (*log_signal)(void *, struct signalfd_siginfo, void *); }; struct ul_pty {