-/*
- *
- * Bacula Director -- User Agent Input and scanning code
- *
- * Kern Sibbald, October MMI
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ *
+ * Bacula Director -- User Agent Input and scanning code
+ *
+ * Kern Sibbald, October MMI
+ *
+ * Version $Id$
+ */
#include "bacula.h"
#include "dird.h"
if (!sock) { /* No UA */
return 0;
}
- bnet_fsend(sock, "%s", prompt);
- bnet_sig(sock, BNET_PROMPT); /* request more input */
+ sock->fsend("%s", prompt);
+ sock->signal(BNET_PROMPT); /* request more input */
for ( ;; ) {
- stat = bnet_recv(sock);
+ stat = sock->recv();
if (stat == BNET_SIGNAL) {
continue; /* ignore signals */
}
return true;
}
if (!is_a_number(ua->cmd)) {
- bsendmsg(ua, _("Expected a positive integer, got: %s\n"), ua->cmd);
+ ua->warning_msg(_("Expected a positive integer, got: %s\n"), ua->cmd);
continue;
}
errno = 0;
dval = strtod(ua->cmd, NULL);
if (errno != 0 || dval < 0) {
- bsendmsg(ua, _("Expected a positive integer, got: %s\n"), ua->cmd);
+ ua->warning_msg(_("Expected a positive integer, got: %s\n"), ua->cmd);
continue;
}
ua->pint32_val = (uint32_t)dval;
ua->pint32_val = ret;
return true;
}
- bsendmsg(ua, _("Invalid response. You must answer yes or no.\n"));
+ ua->warning_msg(_("Invalid response. You must answer yes or no.\n"));
}
}
Enabled = atoi(val);
}
if (Enabled < 0 || Enabled > 2) {
- bsendmsg(ua, _("Invalid Enabled value, it must be yes, no, archived, 0, 1, or 2\n"));
+ ua->error_msg(_("Invalid Enabled value, it must be yes, no, archived, 0, 1, or 2\n"));
return -1;
}
return Enabled;