]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua.h
ebl Modify disk-changer to check if slot contains something before
[bacula/bacula] / bacula / src / dird / ua.h
index e04315bf14d66a23b6907a2cbe95475877f1888d..c55510812282ac0d50a27c7c8d344bda0b0dcb9d 100644 (file)
@@ -1,3 +1,30 @@
+/*
+   Bacula® - The Network Backup Solution
+
+   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.
+   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 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 /*
  * Includes specific to the Director User Agent Server
  *
  *
  *     Version $Id$
  */
-/*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
 
 #ifndef __UA_H_
 #define __UA_H_ 1
 
-struct UAContext {
+class UAContext {
+public:
    BSOCK *UA_sock;
    BSOCK *sd;
    JCR *jcr;
@@ -38,6 +52,7 @@ struct UAContext {
    char **prompt;                     /* list of prompts */
    int max_prompts;                   /* max size of list */
    int num_prompts;                   /* current number in list */
+   int api;                           /* For programs want an API */
    bool auto_display_messages;        /* if set, display messages */
    bool user_notified_msg_pending;    /* set when user notified */
    bool automount;                    /* if set, mount after label */
@@ -48,6 +63,14 @@ struct UAContext {
    uint32_t pint32_val;               /* positive integer */
    int32_t  int32_val;                /* positive/negative */
    int64_t  int64_val;                /* big int */
+
+   void signal(int sig) { UA_sock->signal(sig); };
+
+   /* The below are in ua_output.c */
+   void send_msg(const char *fmt, ...);
+   void error_msg(const char *fmt, ...);
+   void warning_msg(const char *fmt, ...);
+   void info_msg(const char *fmt, ...);
 };
 
 /* Context for insert_tree_handler() */
@@ -78,7 +101,8 @@ struct RESTORE_CTX {
    utime_t JobTDate;
    uint32_t TotalFiles;
    JobId_t JobId;
-   char ClientName[MAX_NAME_LENGTH];
+   char ClientName[MAX_NAME_LENGTH];  /* backup client */
+   char RestoreClientName[MAX_NAME_LENGTH];  /* restore client */
    char last_jobid[20];
    POOLMEM *JobIds;                   /* User entered string of JobIds */
    STORE  *store;
@@ -87,6 +111,7 @@ struct RESTORE_CTX {
    int restore_jobs;
    uint32_t selected_files;
    char *where;
+   char *RegexWhere;
    RBSR *bsr;
    POOLMEM *fname;                    /* filename only */
    POOLMEM *path;                     /* path only */
@@ -100,5 +125,4 @@ struct RESTORE_CTX {
 
 #define MAX_ID_LIST_LEN 2000000
 
-
 #endif