]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/bdb_sqlite.h
Backport from Bacula Enterprise
[bacula/bacula] / bacula / src / cats / bdb_sqlite.h
index 39a0b33bccb551aea9644bc4e47b9ce253fb2521..87f469dc21a1e8481d4abe72837367ec7f260b3c 100644 (file)
@@ -1,22 +1,28 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
+   Copyright (C) 2000-2015 Kern Sibbald
    Copyright (C) 2009-2014 Free Software Foundation Europe e.V.
 
-   The main author of Bacula is Kern Sibbald, with contributions from many
-   others, a complete list can be found in the file AUTHORS.
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
 
    You may use this file and others of this release according to the
    license defined in the LICENSE file, which includes the Affero General
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
-   Bacula® is a registered trademark of Kern Sibbald.
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
-#ifndef __BDB_SQLITE_H_
-#define __BDB_SQLITE_H_ 1
 
-class B_DB_SQLITE: public B_DB_PRIV {
+/* SQLite driver specific definitions */
+
+#ifdef __BDB_SQLITE_H_
+
+class BDB_SQLITE: public BDB {
 private:
    struct sqlite3 *m_db_handle;
    char **m_result;             /* sql_store_results() and sql_query() */
@@ -25,11 +31,8 @@ private:
    SQL_FIELD m_sql_field;       /* used when using db_sql_query() and sql_fetch_field() */
 
 public:
-   B_DB_SQLITE(JCR *jcr, const char *db_driver, const char *db_name,
-               const char *db_user, const char *db_password,
-               const char *db_address, int db_port, const char *db_socket,
-               bool mult_db_connections, bool disable_batch_insert);
-   ~B_DB_SQLITE();
+   BDB_SQLITE();
+   ~BDB_SQLITE();
 
    /* Used internaly by sqlite.c to access fields in db_sql_query() */
    void set_column_names(char **res, int nb) {
@@ -38,17 +41,17 @@ public:
       m_field_number = 0;
    }
 
-   /* low level operations */
-   bool db_open_database(JCR *jcr);
-   void db_close_database(JCR *jcr);
-   void db_thread_cleanup(void);
-   void db_escape_string(JCR *jcr, char *snew, char *old, int len);
-   char *db_escape_object(JCR *jcr, char *old, int len);
-   void db_unescape_object(JCR *jcr, char *from, int32_t expected_len,
+   /* Functions that we override */
+   bool bdb_open_database(JCR *jcr);
+   void bdb_close_database(JCR *jcr);
+   void bdb_thread_cleanup(void);
+   void bdb_escape_string(JCR *jcr, char *snew, char *old, int len);
+   char *bdb_escape_object(JCR *jcr, char *old, int len);
+   void bdb_unescape_object(JCR *jcr, char *from, int32_t expected_len,
                            POOLMEM **dest, int32_t *len);
-   void db_start_transaction(JCR *jcr);
-   void db_end_transaction(JCR *jcr);
-   bool db_sql_query(const char *query, DB_RESULT_HANDLER *result_handler, void *ctx);
+   void bdb_start_transaction(JCR *jcr);
+   void bdb_end_transaction(JCR *jcr);
+   bool bdb_sql_query(const char *query, DB_RESULT_HANDLER *result_handler, void *ctx);
    void sql_free_result(void);
    SQL_ROW sql_fetch_row(void);
    bool sql_query(const char *query, int flags=0);