]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/bdb_create.c
Fix segfault when loading Plugins
[bacula/bacula] / bacula / src / cats / bdb_create.c
1 /*
2  * Bacula Catalog Database Create record routines
3  *
4  * Bacula Catalog Database routines written specifically
5  *  for Bacula.  Note, these routines are VERY dumb and
6  *  do not provide all the functionality of an SQL database.
7  *  The purpose of these routines is to ensure that Bacula
8  *  can limp along if no real database is loaded on the
9  *  system.
10  *
11  *    Kern Sibbald, January MMI
12  *
13  *    Version $Id$
14  */
15 /*
16    Bacula® - The Network Backup Solution
17
18    Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
19
20    The main author of Bacula is Kern Sibbald, with contributions from
21    many others, a complete list can be found in the file AUTHORS.
22    This program is Free Software; you can redistribute it and/or
23    modify it under the terms of version two of the GNU General Public
24    License as published by the Free Software Foundation and included
25    in the file LICENSE.
26
27    This program is distributed in the hope that it will be useful, but
28    WITHOUT ANY WARRANTY; without even the implied warranty of
29    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30    General Public License for more details.
31
32    You should have received a copy of the GNU General Public License
33    along with this program; if not, write to the Free Software
34    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
35    02110-1301, USA.
36
37    Bacula® is a registered trademark of Kern Sibbald.
38    The licensor of Bacula is the Free Software Foundation Europe
39    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
40    Switzerland, email:ftf@fsfeurope.org.
41 */
42
43
44 /* The following is necessary so that we do not include
45  * the dummy external definition of DB.
46  */
47 #define __SQL_C                       /* indicate that this is sql.c */
48
49 #include "bacula.h"
50 #include "cats.h"
51 #include "bdb.h"
52
53 #ifdef HAVE_BACULA_DB
54
55 /* Forward referenced functions */
56 bool db_create_pool_record(B_DB *mdb, POOL_DBR *pr);
57
58 /* -----------------------------------------------------------------------
59  *
60  *   Bacula specific defines and subroutines
61  *
62  * -----------------------------------------------------------------------
63  */
64
65 bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
66 {
67    return true;
68 }
69
70 int db_create_file_item(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
71 {
72    return 1;
73 }
74
75
76 /*
77  * Create a new record for the Job
78  *   This record is created at the start of the Job,
79  *   it is updated in bdb_update.c when the Job terminates.
80  *
81  * Returns: 0 on failure
82  *          1 on success
83  */
84 bool db_create_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
85 {
86    return 0;
87 }
88
89 /* Create a JobMedia record for Volume used this job
90  * Returns: 0 on failure
91  *          record-id on success
92  */
93 bool db_create_jobmedia_record(JCR *jcr, B_DB *mdb, JOBMEDIA_DBR *jm)
94 {
95    return 0;
96 }
97
98
99 /*
100  *  Create a unique Pool record
101  * Returns: 0 on failure
102  *          1 on success
103  */
104 bool db_create_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
105 {
106    return 0;
107 }
108
109 bool db_create_device_record(JCR *jcr, B_DB *mdb, DEVICE_DBR *dr)
110 { return false; }
111
112 bool db_create_storage_record(JCR *jcr, B_DB *mdb, STORAGE_DBR *dr)
113 { return false; }
114
115 bool db_create_mediatype_record(JCR *jcr, B_DB *mdb, MEDIATYPE_DBR *dr)
116 { return false; }
117
118
119 /*
120  * Create Unique Media record.  This record
121  *   contains all the data pertaining to a specific
122  *   Volume.
123  *
124  * Returns: 0 on failure
125  *          1 on success
126  */
127 int db_create_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
128 {
129    return 0;
130 }
131
132
133 /*
134  *  Create a unique Client record or return existing record
135  * Returns: 0 on failure
136  *          1 on success
137  */
138 int db_create_client_record(JCR *jcr, B_DB *mdb, CLIENT_DBR *cr)
139 {
140    return 0;
141 }
142
143 /*
144  *  Create a unique FileSet record or return existing record
145  *
146  *   Note, here we write the FILESET_DBR structure
147  *
148  * Returns: 0 on failure
149  *          1 on success
150  */
151 bool db_create_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr)
152 {
153    return false;
154 }
155
156 int db_create_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr)
157 { return 0; }
158
159 bool db_write_batch_file_records(JCR *jcr) { return false; }
160 bool my_batch_start(JCR *jcr, B_DB *mdb) { return false; }
161 bool my_batch_end(JCR *jcr, B_DB *mdb, const char *error) { return false; }
162 bool my_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) { return false; }
163                                  
164
165 #endif /* HAVE_BACULA_DB */