#define OSDependentInit() InitWinAPIWrapper()
#undef ENABLE_NLS
+
#if defined(BUILDING_DLL)
# define DLL_IMP_EXP _declspec(dllexport)
#elif defined(USING_DLL)
# define DLL_IMP_EXP
#endif
+#if defined(USING_CATS)
+# define CATS_IMP_EXP _declspec(dllimport)
+#else
+# define CATS_IMP_EXP
+#endif
+
#else
#define DLL_IMP_EXP
+#define CATS_IMP_EXP
#define OSDependentInit()
#define tape_open open
LIBSRCS = mysql.c bdb.c bdb_create.c bdb_get.c bdb_update.c \
bdb_delete.c bdb_find.c bdb_list.c \
- sql.c sql_create.c sql_delete.c sql_find.c \
+ sql.c sql_cmds.c sql_create.c sql_delete.c sql_find.c \
sql_get.c sql_list.c sql_update.c sqlite.c \
postgresql.c
LIBOBJS = mysql.o bdb.o bdb_create.o bdb_get.o bdb_update.o \
bdb_delete.o bdb_find.o bdb_list.o \
- sql.o sql_create.o sql_delete.o sql_find.o \
+ sql.o sql_cmds.o sql_create.o sql_delete.o sql_find.o \
sql_get.o sql_list.o sql_update.o sqlite.o \
postgresql.o
uint32_t bacula_db_version = 0;
-/* Forward referenced functions */
-
-extern const char *working_directory;
-
/* List of open databases */
static BQUEUE db_list = {&db_list, &db_list};
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
#ifdef HAVE_BACULA_DB
-/* Forward referenced functions */
-
/* -----------------------------------------------------------------------
*
* Bacula specific defines and subroutines
return 1;
}
+void db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
+{
+ return;
+}
#endif /* HAVE_BACULA_DB */
#include "protos.h"
#include "jcr.h"
+#include "sql_cmds.h"
/*
* Some functions exported by sql.c for use within the
* cats directory.
*/
-void list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type);
+void list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type);
void list_dashes(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx);
int get_sql_record_max(JCR *jcr, B_DB *mdb);
bool check_tables_version(JCR *jcr, B_DB *mdb);
void _db_unlock(const char *file, int line, B_DB *mdb);
void _db_lock(const char *file, int line, B_DB *mdb);
+void print_dashes(B_DB *mdb);
+void print_result(B_DB *mdb);
+int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
+int InsertDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
+int DeleteDB(const char *file, int line, JCR *jcr, B_DB *db, char *delete_cmd);
+int UpdateDB(const char *file, int line, JCR *jcr, B_DB *db, char *update_cmd);
+void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname);
#endif /* __SQL_H_ */
*/
#include "bacula.h"
-#include "dird.h"
+#include "cats.h"
/* For ua_cmds.c */
const char *list_pool = "SELECT * FROM Pool WHERE PoolId=%s";
--- /dev/null
+/*
+ Copyright (C) 2000-2006 Kern Sibbald
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as amended with additional clauses defined in the
+ file LICENSE in the main source directory.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
+
+ */
+
+extern const char CATS_IMP_EXP *client_backups;
+extern const char CATS_IMP_EXP *list_pool;
+extern const char CATS_IMP_EXP *drop_deltabs[];
+extern const char CATS_IMP_EXP *create_deltabs[];
+extern const char CATS_IMP_EXP *insert_delcand;
+extern const char CATS_IMP_EXP *select_backup_del;
+extern const char CATS_IMP_EXP *select_verify_del;
+extern const char CATS_IMP_EXP *select_restore_del;
+extern const char CATS_IMP_EXP *select_admin_del;
+extern const char CATS_IMP_EXP *select_job;
+extern const char CATS_IMP_EXP *del_File;
+extern const char CATS_IMP_EXP *cnt_File;
+extern const char CATS_IMP_EXP *cnt_DelCand;
+extern const char CATS_IMP_EXP *del_Job;
+extern const char CATS_IMP_EXP *del_MAC;
+extern const char CATS_IMP_EXP *del_JobMedia;
+extern const char CATS_IMP_EXP *cnt_JobMedia;
+extern const char CATS_IMP_EXP *sel_JobMedia;
+extern const char CATS_IMP_EXP *upd_Purged;
+
+extern const char CATS_IMP_EXP *uar_list_jobs;
+extern const char CATS_IMP_EXP *uar_file;
+extern const char CATS_IMP_EXP *uar_count_files;
+extern const char CATS_IMP_EXP *uar_sel_files;
+extern const char CATS_IMP_EXP *uar_del_temp;
+extern const char CATS_IMP_EXP *uar_del_temp1;
+extern const char CATS_IMP_EXP *uar_create_temp;
+extern const char CATS_IMP_EXP *uar_create_temp1;
+extern const char CATS_IMP_EXP *uar_last_full;
+extern const char CATS_IMP_EXP *uar_full;
+extern const char CATS_IMP_EXP *uar_inc;
+extern const char CATS_IMP_EXP *uar_list_temp;
+extern const char CATS_IMP_EXP *uar_sel_all_temp1;
+extern const char CATS_IMP_EXP *uar_sel_fileset;
+extern const char CATS_IMP_EXP *uar_mediatype;
+extern const char CATS_IMP_EXP *uar_jobid_fileindex;
+extern const char CATS_IMP_EXP *uar_dif;
+extern const char CATS_IMP_EXP *uar_sel_all_temp;
+extern const char CATS_IMP_EXP *uar_count_files;
+extern const char CATS_IMP_EXP *uar_jobids_fileindex;
+extern const char CATS_IMP_EXP *uar_jobid_fileindex_from_dir;
+extern const char CATS_IMP_EXP *uar_jobid_fileindex_from_table;
+extern const char CATS_IMP_EXP *uar_sel_jobid_temp;
static int db_create_path_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar);
-/* Imported subroutines */
-extern void print_dashes(B_DB *mdb);
-extern void print_result(B_DB *mdb);
-extern int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-extern int InsertDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-extern int UpdateDB(const char *file, int line, JCR *jcr, B_DB *db, char *update_cmd);
-extern void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname);
-
-
/* Create a new record for the Job
* Returns: false on failure
* true on success
* -----------------------------------------------------------------------
*/
-/* Imported subroutines */
-extern void print_dashes(B_DB *mdb);
-extern void print_result(B_DB *mdb);
-extern int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-extern int DeleteDB(const char *file, int line, JCR *jcr, B_DB *db, char *delete_cmd);
-
/*
* Delete Pool record, must also delete all associated
* Media records.
* -----------------------------------------------------------------------
*/
-/* Imported subroutines */
-extern void print_result(B_DB *mdb);
-extern int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-
/*
* Find job start time if JobId specified, otherwise
* find last full save for Incremental and Differential saves.
static int db_get_path_record(JCR *jcr, B_DB *mdb);
-/* Imported subroutines */
-extern void print_result(B_DB *mdb);
-extern int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-extern void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname);
-
-
-
/*
* Given a full filename (with path), look up the File record
* (with attributes) in the database.
* -----------------------------------------------------------------------
*/
-/* Imported subroutines */
-extern void list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type);
-extern int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
-
-
/*
* Submit general SQL query
*/
* -----------------------------------------------------------------------
*/
-/* Imported subroutines */
-extern void print_result(B_DB *mdb);
-extern int UpdateDB(const char *file, int line, JCR *jcr, B_DB *db, char *update_cmd);
-
/* -----------------------------------------------------------------------
*
* Generic Routines (or almost generic)
}
}
-#else
-
-void
-db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
-{
- /* DUMMY func for Bacula_DB */
- return;
-}
-
#endif /* HAVE_SQLITE3 || HAVE_MYSQL || HAVE_SQLITE || HAVE_POSTGRESQL*/
* -----------------------------------------------------------------------
*/
-extern const char *working_directory;
-
/* List of open databases */
static BQUEUE db_list = {&db_list, &db_list};
mountreq.c msgchan.c next_vol.c newvol.c \
pythondir.c \
recycle.c restore.c run_conf.c \
- scheduler.c sql_cmds.c \
+ scheduler.c \
ua_acl.c ua_cmds.c ua_dotcmds.c \
ua_query.c \
ua_input.c ua_label.c ua_output.c ua_prune.c \
mountreq.o msgchan.o next_vol.o newvol.o \
pythondir.o \
recycle.o restore.o run_conf.o \
- scheduler.o sql_cmds.o \
+ scheduler.o \
ua_acl.o ua_cmds.o ua_dotcmds.o \
ua_query.o \
ua_input.o ua_label.o ua_output.o ua_prune.o \
extern int r_first;
extern int r_last;
extern struct s_res resources[];
-extern const char *client_backups;
/* Imported functions */
extern void do_messages(UAContext *ua, const char *cmd);
#define MAX_DEL_LIST_LEN 2000000
-/* Imported variables */
-extern const char *select_job;
-extern const char *drop_deltabs[];
-extern const char *create_deltabs[];
-extern const char *insert_delcand;
-extern const char *select_backup_del;
-extern const char *select_verify_del;
-extern const char *select_restore_del;
-extern const char *select_admin_del;
-extern const char *cnt_File;
-extern const char *cnt_DelCand;
-extern const char *del_Job;
-extern const char *del_MAC;
-extern const char *del_JobMedia;
-extern const char *cnt_JobMedia;
-extern const char *sel_JobMedia;
-
-
/* In memory list of JobIds */
struct s_file_del_ctx {
JobId_t *JobId;
#include "bacula.h"
#include "dird.h"
-extern const char *del_File;
-extern const char *upd_Purged;
-
/* Forward referenced functions */
static int purge_files_from_client(UAContext *ua, CLIENT *client);
static int purge_jobs_from_client(UAContext *ua, CLIENT *client);
/* Imported functions */
extern void print_bsr(UAContext *ua, RBSR *bsr);
-/* Imported variables */
-extern const char *uar_list_jobs, *uar_file, *uar_sel_files;
-extern const char *uar_del_temp, *uar_del_temp1, *uar_create_temp;
-extern const char *uar_create_temp1, *uar_last_full, *uar_full;
-extern const char *uar_inc, *uar_list_temp, *uar_sel_jobid_temp;
-extern const char *uar_sel_all_temp1, *uar_sel_fileset, *uar_mediatype;
-extern const char *uar_jobid_fileindex, *uar_dif, *uar_sel_all_temp;
-extern const char *uar_count_files, *uar_jobids_fileindex;
-extern const char *uar_jobid_fileindex_from_dir;
-extern const char *uar_jobid_fileindex_from_table;
-
/* Forward referenced functions */
#include "bacula.h"
#include "dird.h"
-/* External variables */
-extern const char *list_pool; /* in sql_cmds.c */
-
/* Imported functions */
void update_slots(UAContext *ua);