/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2008 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.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
* returns: 0 on error
* 1 on success and fills in CLIENT_DBR
*/
-int get_client_dbr(UAContext *ua, CLIENT_DBR *cr)
+bool get_client_dbr(UAContext *ua, CLIENT_DBR *cr)
{
int i;
* Returns 1 on success
* 0 on failure
*/
-int select_client_dbr(UAContext *ua, CLIENT_DBR *cr)
+bool select_client_dbr(UAContext *ua, CLIENT_DBR *cr)
{
CLIENT_DBR ocr;
char name[MAX_NAME_LENGTH];
* returns: false on error
* true on success and fills in POOL_DBR
*/
-bool get_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk)
+bool get_pool_dbr(UAContext *ua, POOL_DBR *pr, const char *argk)
{
if (pr->Name[0]) { /* If name already supplied */
if (db_get_pool_record(ua->jcr, ua->db, pr) &&
* Select a Pool record from catalog
* argk can be pool, recyclepool, scratchpool etc..
*/
-bool select_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk)
+bool select_pool_dbr(UAContext *ua, POOL_DBR *pr, const char *argk)
{
POOL_DBR opr;
char name[MAX_NAME_LENGTH];
}
start_prompt(ua, _("Defined Pools:\n"));
+ if (bstrcmp(argk, NT_("recyclepool"))) {
+ add_prompt(ua, _("*None*"));
+ }
for (i=0; i < num_pools; i++) {
opr.PoolId = ids[i];
if (!db_get_pool_record(ua->jcr, ua->db, &opr) ||
if (do_prompt(ua, _("Pool"), _("Select the Pool"), name, sizeof(name)) < 0) {
return false;
}
- memset(&opr, 0, sizeof(opr));
- bstrncpy(opr.Name, name, sizeof(opr.Name));
- if (!db_get_pool_record(ua->jcr, ua->db, &opr)) {
- ua->error_msg(_("Could not find Pool \"%s\": ERR=%s"), name, db_strerror(ua->db));
- return false;
+ memset(&opr, 0, sizeof(opr));
+ /* *None* is only returned when selecting a recyclepool, and in that case
+ * the calling code is only interested in opr.Name, so then we can leave
+ * pr as all zero.
+ */
+ if (!bstrcmp(name, _("*None*"))) {
+ bstrncpy(opr.Name, name, sizeof(opr.Name));
+
+ if (!db_get_pool_record(ua->jcr, ua->db, &opr)) {
+ ua->error_msg(_("Could not find Pool \"%s\": ERR=%s"), name, db_strerror(ua->db));
+ return false;
+ }
}
+
memcpy(pr, &opr, sizeof(opr));
return true;
}
bool found = false;
for (int i=0; joblevels[i].level_name; i++) {
if (strcasecmp(level_name, joblevels[i].level_name) == 0) {
- jcr->JobLevel = joblevels[i].level;
+ jcr->set_JobLevel(joblevels[i].level);
found = true;
break;
}