~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/engine_ms.h

Renamed more stuff to drizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
 
 *
3
 
 * PrimeBase Media Stream for MySQL
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
 
 *
19
 
 * Original author: Paul McCullagh
20
 
 * Continued development: Barry Leslie
21
 
 *
22
 
 * 2007-07-20
23
 
 *
24
 
 * H&G2JCtL
25
 
 *
26
 
 * Engine interface
27
 
 *
28
 
 */
29
 
 
30
 
#ifndef __ENGINE_MS_H__
31
 
#define __ENGINE_MS_H__
32
 
 
33
 
#include "defs_ms.h"
34
 
 
35
 
#include "pbms.h"
36
 
class MSOpenTable;
37
 
 
38
 
#ifdef DRIZZLED
39
 
namespace drizzled
40
 
{
41
 
class Session;
42
 
} /* namespace drizzled */
43
 
#else
44
 
class THD;
45
 
#endif
46
 
 
47
 
class MSEngine : public CSObject {
48
 
public:
49
 
        
50
 
#ifdef DRIZZLED
51
 
        static int startUp(PBMSResultPtr ) { return 0;}
52
 
        static void shutDown() {}
53
 
#else
54
 
        static int startUp(PBMSResultPtr result);
55
 
 
56
 
        static void shutDown();
57
 
 
58
 
        static const PBMSEnginePtr getEngineInfoAt(int indx);
59
 
#endif
60
 
        
61
 
        static int exceptionToResult(CSException *e, PBMSResultPtr result);
62
 
        static int errorResult(const char *func, const char *file, int line, int err, const char *message, PBMSResultPtr result);
63
 
        static int osErrorResult(const char *func, const char *file, int line, int err, PBMSResultPtr result);
64
 
        static int enterConnectionNoThd(CSThread **r_self, PBMSResultPtr result);
65
 
        static int enterConnection(THD *thd, CSThread **r_self, PBMSResultPtr result, bool doCreate);
66
 
        static void exitConnection();
67
 
        static void closeConnection(THD* thd);
68
 
 
69
 
        static int32_t  dropDatabase(const char *db_name, PBMSResultPtr result);
70
 
        static int32_t  createBlob(const char *db_name, const char *tab_name, char *blob, size_t blob_len, PBMSBlobURLPtr blob_url, PBMSResultPtr result);
71
 
        static int32_t  referenceBlob(const char *db_name, const char *tab_name, PBMSBlobURLPtr  ret_blob_url, char *blob_url, uint16_t col_index, PBMSResultPtr result);
72
 
        static int32_t  dereferenceBlob(const char *db_name, const char *tab_name, char *blob_url, PBMSResultPtr result);
73
 
        static int32_t  dropTable(const char *db_name, const char *tab_name, PBMSResultPtr result);
74
 
        static int32_t  renameTable(const char *from_db_name, const char *from_table, const char *to_db_name, const char *to_table, PBMSResultPtr result);
75
 
        static void             callCompleted(bool ok);
76
 
        
77
 
        static bool couldBeURL(const char *url, size_t length);
78
 
        
79
 
        private:
80
 
        static MSOpenTable *openTable(const char *db_name, const char *tab_name, bool create);
81
 
        static bool renameTable(const char *db_name, const char *from_table, const char *to_db_name, const char *to_table);
82
 
        static void completeRenameTable(struct UnDoInfo *info, bool ok);
83
 
};
84
 
 
85
 
#endif