]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/bdb_get.c
73657a1458b3f2b51f8a86415dd800b056ef2670
[bacula/bacula] / bacula / src / cats / bdb_get.c
1 /*
2  * Bacula Catalog Database Get record interface routines
3  *  Note, these routines generally get a record by id or
4  *        by name.  If more logic is involved, the routine
5  *        should be in find.c
6  *
7  * Bacula Catalog Database routines written specifically
8  *  for Bacula.  Note, these routines are VERY dumb and
9  *  do not provide all the functionality of an SQL database.
10  *  The purpose of these routines is to ensure that Bacula
11  *  can limp along if no real database is loaded on the
12  *  system.
13  *
14  *    Kern Sibbald, January MMI
15  *
16  *    Version $Id$
17  */
18 /*
19    Bacula® - The Network Backup Solution
20
21    Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
22
23    The main author of Bacula is Kern Sibbald, with contributions from
24    many others, a complete list can be found in the file AUTHORS.
25    This program is Free Software; you can redistribute it and/or
26    modify it under the terms of version two of the GNU General Public
27    License as published by the Free Software Foundation and included
28    in the file LICENSE.
29
30    This program is distributed in the hope that it will be useful, but
31    WITHOUT ANY WARRANTY; without even the implied warranty of
32    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33    General Public License for more details.
34
35    You should have received a copy of the GNU General Public License
36    along with this program; if not, write to the Free Software
37    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
38    02110-1301, USA.
39
40    Bacula® is a registered trademark of John Walker.
41    The licensor of Bacula is the Free Software Foundation Europe
42    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
43    Switzerland, email:ftf@fsfeurope.org.
44 */
45
46
47 /* The following is necessary so that we do not include
48  * the dummy external definition of DB.
49  */
50 #define __SQL_C                       /* indicate that this is sql.c */
51
52 #include "bacula.h"
53 #include "cats.h"
54 #include "bdb.h"
55
56 #ifdef HAVE_BACULA_DB
57
58 /* Forward referenced functions */
59
60
61 /* -----------------------------------------------------------------------
62  *
63  *   Bacula specific defines and subroutines
64  *
65  * -----------------------------------------------------------------------
66  */
67
68
69 /*
70  * Get Job record for given JobId
71  * Returns: 0 on failure
72  *          1 on success
73  */
74
75 bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
76 {
77    return 0;
78 }
79
80
81 /*
82  * Get the number of pool records
83  *
84  * Returns: -1 on failure
85  *          number on success
86  */
87 int db_get_num_pool_records(JCR *jcr, B_DB *mdb)
88 {
89    return -1;
90 }
91
92 /*
93  * This function returns a list of all the Pool record ids.
94  *  The caller must free ids if non-NULL.
95  *
96  *  Returns 0: on failure
97  *          1: on success
98  */
99 int db_get_pool_ids(JCR *jcr, B_DB *mdb, int *num_ids, uint32_t *ids[])
100 {
101    return 0;
102 }
103
104
105 /*
106  * Get Pool Record
107  * If the PoolId is non-zero, we get its record,
108  *  otherwise, we search on the PoolName
109  *
110  * Returns: false on failure
111  *          true on success
112  */
113 bool db_get_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
114 {
115    return 0;
116 }
117
118 /*
119  * Get the number of Media records
120  *
121  * Returns: -1 on failure
122  *          number on success
123  */
124 int db_get_num_media_records(JCR *jcr, B_DB *mdb)
125 {
126    return -1;
127 }
128
129 /*
130  * This function returns a list of all the Media record ids
131  *  for a specified PoolId
132  *  The caller must free ids if non-NULL.
133  *
134  *  Returns false: on failure
135  *          true:  on success
136  */
137 bool db_get_media_ids(JCR *jcr, B_DB *mdb, uint32_t PoolId, int *num_ids, uint32_t *ids[])
138 {
139    return false;
140 }
141
142 /*
143  * Get Media Record
144  * If the MediaId is non-zero, we get its record,
145  *  otherwise, we search on the MediaName
146  *
147  * Returns: false on failure
148  *          true on success
149  */
150 bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
151 {
152    return false;
153 }
154
155 /*
156  * Find VolumeNames for a give JobId
157  *  Returns: 0 on error or no Volumes found
158  *           number of volumes on success
159  *              Volumes are concatenated in VolumeNames
160  *              separated by a vertical bar (|).
161  */
162 int db_get_job_volume_names(JCR *jcr, B_DB *mdb, uint32_t JobId, POOLMEM **VolumeNames)
163 {
164    return 0;
165 }
166
167 /*
168  * Get Client Record
169  * If the ClientId is non-zero, we get its record,
170  *  otherwise, we search on the Name
171  *
172  * Returns: 0 on failure
173  *          id on success
174  */
175 int db_get_client_record(JCR *jcr, B_DB *mdb, CLIENT_DBR *cr)
176 {
177    return 0;
178 }
179
180 /*
181  * Get FileSet Record   (We read the FILESET_DBR structure)
182  * If the FileSetId is non-zero, we get its record,
183  *  otherwise, we search on the FileSet (its name).
184  *
185  * Returns: 0 on failure
186  *          id on success
187  */
188 int db_get_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr)
189 {
190    return 0;
191 }
192
193 bool db_get_query_dbids(JCR *jcr, B_DB *mdb, POOL_MEM &query, dbid_list &ids)
194 { return false; }
195
196 int db_get_file_attributes_record(JCR *jcr, B_DB *mdb, char *fname, JOB_DBR *jr, FILE_DBR *fdbr)
197 { return 0; }
198
199 int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, uint32_t JobId, VOL_PARAMS **VolParams)
200 { return 0; }
201
202 int db_get_client_ids(JCR *jcr, B_DB *mdb, int *num_ids, uint32_t *ids[])
203 { return 0; }
204
205 int db_get_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr)
206 { return 0; }
207
208
209 #endif /* HAVE_BACULA_DB */