]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_input.c
Massive bat notifier rewrite + fix seg fault + implement text input dialog
[bacula/bacula] / bacula / src / dird / ua_input.c
index 23a629bc5a0fc8b42c5dcea76507de74a39ac1f9..2b16f507433fc1e260febb4346fe5e8ae18faa66 100644 (file)
 
 /* Exported functions */
 
-int get_cmd(UAContext *ua, const char *prompt)
+/* 
+ * If subprompt is set, we send a BNET_SUB_PROMPT signal otherwise
+ *   send a BNET_TEXT_INPUT signal.
+ */
+int get_cmd(UAContext *ua, const char *prompt, bool subprompt)
 {
    BSOCK *sock = ua->UA_sock;
    int stat;
@@ -52,8 +56,13 @@ int get_cmd(UAContext *ua, const char *prompt)
    if (!sock || ua->batch) {          /* No UA or batch mode */
       return 0;
    }
+   if (!subprompt) {
+      sock->signal(BNET_TEXT_INPUT);
+   }
    sock->fsend("%s", prompt);
-   sock->signal(BNET_PROMPT);         /* request more input */
+   if (subprompt) {
+      sock->signal(BNET_SUB_PROMPT);
+   }
    for ( ;; ) {
       stat = sock->recv();
       if (stat == BNET_SIGNAL) {