patch 8.0.0797: finished job in terminal window is not handled

Problem:    Finished job in terminal window is not handled.
Solution:   Add the scrollback buffer.  Use it to fill the buffer when the job
            has ended.
diff --git a/src/proto/terminal.pro b/src/proto/terminal.pro
index ac0beb5..70e619a 100644
--- a/src/proto/terminal.pro
+++ b/src/proto/terminal.pro
@@ -1,10 +1,10 @@
 /* terminal.c */
 void ex_terminal(exarg_T *eap);
-void free_terminal(term_T *term);
+void free_terminal(buf_T *buf);
 void write_to_term(buf_T *buffer, char_u *msg, channel_T *channel);
-void terminal_loop(void);
-void term_job_ended(job_T *job);
-void term_update_window(win_T *wp);
+int terminal_loop(void);
+void term_channel_closed(channel_T *ch);
+int term_update_window(win_T *wp);
 char_u *term_get_status_text(term_T *term);
 int set_ref_in_term(int copyID);
 /* vim: set ft=c : */