]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored.h
- Fix seg fault if user labels a drive directory bug #513
[bacula/bacula] / bacula / src / stored / stored.h
1 /*
2  * Storage daemon specific defines and includes
3  *
4  *  Version $Id$
5  */
6 /*
7    Copyright (C) 2000-2005 Kern Sibbald
8
9    This program is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    version 2 as amended with additional clauses defined in the
12    file LICENSE in the main source directory.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
17    the file LICENSE for additional details.
18
19  */
20
21 #ifndef __STORED_H_
22 #define __STORED_H_
23
24 #define STORAGE_DAEMON 1
25
26 #ifdef HAVE_MTIO_H
27 #include <mtio.h>
28 #else
29 # ifdef HAVE_SYS_MTIO_H
30 # include <sys/mtio.h>
31 # else
32 #   ifdef HAVE_SYS_TAPE
33 #   include <sys/tape.h>
34 #   endif
35 # endif
36 #endif
37 #include "block.h"
38 #include "record.h"
39 #include "dev.h"
40 #include "stored_conf.h"
41 #include "bsr.h"
42 #include "jcr.h"
43 #include "protos.h"
44 #ifdef HAVE_LIBZ
45 #include <zlib.h>                     /* compression headers */
46 #else
47 #define uLongf uint32_t
48 #endif
49 #ifdef HAVE_FNMATCH
50 #include <fnmatch.h>
51 #else
52 #include "lib/fnmatch.h"
53 #endif
54 #ifdef HAVE_DIRENT_H
55 #include <dirent.h>
56 #define NAMELEN(dirent) (strlen((dirent)->d_name))
57 #endif
58 #ifndef HAVE_READDIR_R
59 int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
60 #endif
61
62 /* Daemon globals from stored.c */
63 extern STORES *me;                    /* "Global" daemon resource */
64 extern bool forge_on;                 /* proceed inspite of I/O errors */
65 extern pthread_mutex_t device_release_mutex;
66 extern pthread_cond_t wait_device_release; /* wait for any device to be released */                           
67
68 #ifdef debug_tracing
69 extern int _rewind_dev(char *file, int line, DEVICE *dev);
70 #define rewind_dev(d) _rewind_dev(__FILE__, __LINE__, (d))
71 #endif
72
73 #endif /* __STORED_H_ */