]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored.h
Backport from BEE
[bacula/bacula] / bacula / src / stored / stored.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from many
7    others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    Bacula® is a registered trademark of Kern Sibbald.
15 */
16 /*
17  * Storage daemon specific defines and includes
18  *
19  */
20
21 #ifndef __STORED_H_
22 #define __STORED_H_
23
24 #define STORAGE_DAEMON 1
25
26 /* Set to debug Lock() and Unlock() only */
27 #define DEV_DEBUG_LOCK
28
29 /*
30  * Set to define all SD locks except Lock()
31  *  currently this does not work. More locks
32  *  must be converted.
33  */
34 #define SD_DEBUG_LOCK
35 #ifdef SD_DEBUG_LOCK
36 const int sd_dbglvl = 300;
37 #else
38 const int sd_dbglvl = 300;
39 #endif
40
41 #ifdef HAVE_MTIO_H
42 #include <mtio.h>
43 #else
44 # ifdef HAVE_SYS_MTIO_H
45 # include <sys/mtio.h>
46 # else
47 #   ifdef HAVE_SYS_TAPE_H
48 #   include <sys/tape.h>
49 #   else
50     /* Needed for Mac 10.6 (Snow Leopard) */
51 #   include "lib/bmtio.h"
52 #   endif
53 # endif
54 #endif
55 #include "lock.h"
56 #include "block.h"
57 #include "record.h"
58 #include "dev.h"
59 #include "file_dev.h"
60 #include "tape_dev.h"
61 #include "stored_conf.h"
62 #include "bsr.h"
63 #include "jcr.h"
64 #include "vol_mgr.h"
65 #include "reserve.h"
66 #include "protos.h"
67 #ifdef HAVE_LIBZ
68 #include <zlib.h>                     /* compression headers */
69 #else
70 #define uLongf uint32_t
71 #endif
72 #ifdef HAVE_FNMATCH
73 #include <fnmatch.h>
74 #else
75 #include "lib/fnmatch.h"
76 #endif
77 #ifdef HAVE_DIRENT_H
78 #include <dirent.h>
79 #define NAMELEN(dirent) (strlen((dirent)->d_name))
80 #endif
81 #ifndef HAVE_READDIR_R
82 int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
83 #endif
84
85 #include "file_dev.h"
86 #include "tape_dev.h"
87 #include "vtape_dev.h"
88 #include "sd_plugins.h"
89
90 /* Daemon globals from stored.c */
91 extern STORES *me;                    /* "Global" daemon resource */
92 extern bool forge_on;                 /* proceed inspite of I/O errors */
93 extern pthread_mutex_t device_release_mutex;
94 extern pthread_cond_t wait_device_release; /* wait for any device to be released */
95
96 #endif /* __STORED_H_ */