]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/protos.h
First cut of bat rerun a Job from Jobs Run
[bacula/bacula] / bacula / src / lib / protos.h
index 6a424cc514828331f946e0eae3ef5a4d3c0ae447..b63f5382a2a3469f5e6547a2c1177e6c588ccb86 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 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
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    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
+   You should have received a copy of the GNU Affero 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.
@@ -28,7 +28,6 @@
 /*
  * Prototypes for lib directory of Bacula
  *
- *   Version $Id$
  */
 
 #ifndef __LIBPROTOS_H
@@ -39,7 +38,7 @@ class JCR;
 /* attr.c */
 ATTR     *new_attr(JCR *jcr);
 void      free_attr(ATTR *attr);
-int       unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr);
+int       unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, int32_t reclen, ATTR *attr);
 void      build_attr_output_fnames(JCR *jcr, ATTR *attr);
 void      print_ls_output(JCR *jcr, ATTR *attr);
 
@@ -69,8 +68,8 @@ int       bvsnprintf             (char *str, int32_t size, const char *format, v
 int       pool_sprintf           (char *pool_buf, const char *fmt, ...);
 void      create_pid_file        (char *dir, const char *progname, int port);
 int       delete_pid_file        (char *dir, const char *progname, int port);
-void      drop                   (char *uid, char *gid);
-int       bmicrosleep            (time_t sec, long usec);
+void      drop                   (char *uid, char *gid, bool keep_readall_caps);
+int       bmicrosleep            (int32_t sec, int32_t usec);
 char     *bfgets                 (char *s, int size, FILE *fd);
 void      make_unique_filename   (POOLMEM **name, int Id, char *what);
 #ifndef HAVE_STRTOLL
@@ -79,6 +78,8 @@ long long int strtoll            (const char *ptr, char **endptr, int base);
 void      read_state_file(char *dir, const char *progname, int port);
 int       b_strerror(int errnum, char *buf, size_t bufsiz);
 char     *escape_filename(const char *file_path);
+int       Zdeflate(char *in, int in_len, char *out, int &out_len);
+int       Zinflate(char *in, int in_len, char *out, int &out_len);
 
 /* bnet.c */
 int32_t    bnet_recv             (BSOCK *bsock);
@@ -186,26 +187,30 @@ bool             duration_to_utime       (char *str, utime_t *value);
 bool             size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
 char             *edit_utime             (utime_t val, char *buf, int buf_len);
 bool             is_a_number             (const char *num);
+bool             is_a_number_list        (const char *n);
 bool             is_an_integer           (const char *n);
 bool             is_name_valid           (char *name, POOLMEM **msg);
 
 /* jcr.c (most definitions are in src/jcr.h) */
-void init_last_jobs_list();
-void term_last_jobs_list();
-void lock_last_jobs_list();
-void unlock_last_jobs_list();
-bool read_last_jobs_list(int fd, uint64_t addr);
+void     init_last_jobs_list();
+void     term_last_jobs_list();
+void     lock_last_jobs_list();
+void     unlock_last_jobs_list();
+bool     read_last_jobs_list(int fd, uint64_t addr);
 uint64_t write_last_jobs_list(int fd, uint64_t addr);
-void write_state_file(char *dir, const char *progname, int port);
-void job_end_push(JCR *jcr, void job_end_cb(JCR *jcr,void *), void *ctx);
-void lock_jobs();
-void unlock_jobs();
-JCR *jcr_walk_start();
-JCR *jcr_walk_next(JCR *prev_jcr);
-void jcr_walk_end(JCR *jcr);
+void     write_state_file(char *dir, const char *progname, int port);
+void     job_end_push(JCR *jcr, void job_end_cb(JCR *jcr,void *), void *ctx);
+void     lock_jobs();
+void     unlock_jobs();
+JCR     *jcr_walk_start();
+JCR     *jcr_walk_next(JCR *prev_jcr);
+void     jcr_walk_end(JCR *jcr);
+int      job_count();
+JCR     *get_jcr_from_tsd();
+void     set_jcr_in_tsd(JCR *jcr);
+void     remove_jcr_from_tsd(JCR *jcr);
 uint32_t get_jobid_from_tsd();             
-JCR *get_jcr_from_tsd();
-void set_jcr_in_tsd(JCR *jcr);
+uint32_t get_jobid_from_tid(pthread_t tid);
 
 
 /* lex.c */
@@ -225,8 +230,8 @@ void       term_msg              (void);
 void       close_msg             (JCR *jcr);
 void       add_msg_dest          (MSGS *msg, int dest, int type, char *where, char *dest_code);
 void       rem_msg_dest          (MSGS *msg, int dest, int type, char *where);
-void       Jmsg                  (JCR *jcr, int type, time_t mtime, const char *fmt, ...);
-void       dispatch_message      (JCR *jcr, int type, time_t mtime, char *buf);
+void       Jmsg                  (JCR *jcr, int type, utime_t mtime, const char *fmt, ...);
+void       dispatch_message      (JCR *jcr, int type, utime_t mtime, char *buf);
 void       init_console_msg      (const char *wd);
 void       free_msgs_res         (MSGS *msgs);
 void       dequeue_messages      (JCR *jcr);
@@ -252,13 +257,6 @@ int generate_daemon_event(JCR *jcr, const char *event);
 void             init_signals             (void terminate(int sig));
 void             init_stack_dump          (void);
 
-/* Used to debug database lock 
- * which job takes the main DB access 
- */
-extern DLL_IMP_EXP utime_t      _db_lock_time;
-extern DLL_IMP_EXP int          _db_lock_recurse_count;
-extern DLL_IMP_EXP pthread_t    _db_lock_threadid;
-
 /* scan.c */
 void             strip_leading_space     (char *str);
 void             strip_trailing_junk     (char *str);
@@ -317,13 +315,14 @@ void             bash_spaces             (char *str);
 void             bash_spaces             (POOL_MEM &pm);
 void             unbash_spaces           (char *str);
 void             unbash_spaces           (POOL_MEM &pm);
-char *           encode_time             (time_t time, char *buf);
+char *           encode_time             (utime_t time, char *buf);
 char *           encode_mode             (mode_t mode, char *buf);
 int              do_shell_expansion      (char *name, int name_len);
 void             jobstatus_to_ascii      (int JobStatus, char *msg, int maxlen);
 void             jobstatus_to_ascii_gui  (int JobStatus, char *msg, int maxlen);
 int              run_program             (char *prog, int wait, POOLMEM *&results);
 int              run_program_full_output (char *prog, int wait, POOLMEM *&results);
+char *           action_on_purge_to_string(int aop, POOL_MEM &ret);
 const char *     job_type_to_str         (int type);
 const char *     job_status_to_str       (int stat);
 const char *     job_level_to_str        (int level);
@@ -342,6 +341,7 @@ int stop_watchdog(void);
 watchdog_t *new_watchdog(void);
 bool register_watchdog(watchdog_t *wd);
 bool unregister_watchdog(watchdog_t *wd);
+bool is_watchdog();
 
 /* timers.c */
 btimer_t *start_child_timer(JCR *jcr, pid_t pid, uint32_t wait);