lib/vty: add vty_stdio at-close hook
This is intended to be used for either "exit on close", "fork on close"
or "reopen vty on close" functionality for the stdio vty. Which of
these options to take depends on the context, the use case right now is
test programs exiting on EOF.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/lib/vty.h b/lib/vty.h
index abac3dd..806f2c6 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -237,7 +237,7 @@
extern void vty_terminate (void);
extern void vty_reset (void);
extern struct vty *vty_new (void);
-extern struct vty *vty_stdio (void);
+extern struct vty *vty_stdio (void (*atclose)(void));
extern int vty_out (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
extern void vty_read_config (char *, char *);
extern void vty_time_print (struct vty *, int);