~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/common_includes.h

  • Committer: Brian Aker
  • Date: 2008-10-29 13:46:43 UTC
  • Revision ID: brian@tangent.org-20081029134643-z6jcwjvyruhk2vlu
Updates for ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; version 2 of the License.
 
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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 */
 
19
 
 
20
/**
 
21
 * @file
 
22
 * 
 
23
 * Contains #includes and definitions that apply to ALL server-related
 
24
 * executables, including storage engine plugins.
 
25
 *
 
26
 * @details
 
27
 *
 
28
 * Previously, the mysql_priv.h file contained a number of conditional
 
29
 * #ifdef DRIZZLE_SERVER blocks which made it very difficult to determine
 
30
 * which headers and definitions were actually necessary for plugins to 
 
31
 * include.  The file, and NOT mysql_priv.h, should now be the main included
 
32
 * header for storage engine plugins, as it contains all definitions and 
 
33
 * declarations needed by the plugin and nothing more.
 
34
 */
 
35
#ifndef DRIZZLE_SERVER_COMMON_INCLUDES_H
 
36
#define DRIZZLE_SERVER_COMMON_INCLUDES_H
 
37
 
 
38
 
 
39
/* Cross-platform portability code and standard includes */
 
40
#include <drizzled/global.h>                    
 
41
/* Lots of system-wide struct definitions like IO_CACHE, prototypes for all my_* functions */
 
42
#include <mysys/my_sys.h>                       
 
43
/* Convenience functions for working with times */
 
44
#include <mysys/my_time.h>
 
45
/* Custom C string functions */
 
46
#include <mystrings/m_string.h>
 
47
/* Custom HASH API */
 
48
#include <mysys/hash.h>
 
49
/* Standard signals API */
 
50
#include <signal.h>
 
51
/* Deadlock-free table-list lock API */
 
52
#include <mysys/thr_lock.h>
 
53
/* Defines for the storage engine handler -- i.e. HA_XXX defines */
 
54
#include <drizzled/base.h>                                      /* Needed by field.h */
 
55
/* Custom queue API */
 
56
#include <mysys/queues.h>
 
57
/* Custom Bitmap API */
 
58
#include <drizzled/sql_bitmap.h>
 
59
/* Array of pointers to Elem that uses memory from MEM_ROOT */
 
60
#include "sql_array.h"
 
61
/* The <strong>INTERNAL</strong> plugin API - not the external, or public, server plugin API */
 
62
#include "sql_plugin.h"
 
63
/* The <strong>connection</strong> thread scheduler API */
 
64
#include "scheduler.h"
 
65
/* Network database operations (hostent, netent, servent, etc...*/
 
66
#include <netdb.h>
 
67
/* Contains system-wide constants and #defines */
 
68
#include <drizzled/definitions.h>
 
69
/* System-wide common data structures */
 
70
#include <drizzled/structs.h>
 
71
/* Custom continguous-section memory allocator */
 
72
#include <drizzled/sql_alloc.h>
 
73
 
 
74
#include "probes.h"
 
75
 
 
76
 
 
77
/**
 
78
 * @TODO Move the following into a drizzled.h header?
 
79
 *
 
80
 * I feel that global variables and functions referencing them directly
 
81
 * and that are used only in the server should be separated out into 
 
82
 * a drizzled.h header file -- JRP
 
83
 */
 
84
 
 
85
 
 
86
extern const CHARSET_INFO *system_charset_info, *files_charset_info ;
 
87
extern const CHARSET_INFO *national_charset_info, *table_alias_charset;
 
88
 
 
89
extern pthread_key(Session*, THR_Session);
 
90
inline Session *_current_session(void)
 
91
{
 
92
  return (Session *)pthread_getspecific(THR_Session);
 
93
}
 
94
#define current_session _current_session()
 
95
 
 
96
extern "C" void set_session_proc_info(Session *session, const char *info);
 
97
extern "C" const char *get_session_proc_info(Session *session);
 
98
 
 
99
/*
 
100
  External variables
 
101
*/
 
102
extern uint32_t server_id;
 
103
 
 
104
/* Custom C++-style String class API */
 
105
#include <drizzled/sql_string.h>
 
106
/* Custom singly-linked list lite struct and full-blown type-safe, templatized class */
 
107
#include <drizzled/sql_list.h>
 
108
#include "my_decimal.h"
 
109
#include "handler.h"
 
110
#include <drizzled/table_list.h>
 
111
#include "sql_error.h"
 
112
/* Drizzle server data type class definitions */
 
113
#include <drizzled/field.h>
 
114
#include "protocol.h"
 
115
#include "item.h"
 
116
 
 
117
extern my_decimal decimal_zero;
 
118
 
 
119
/** @TODO Find a good header to put this guy... */
 
120
void close_thread_tables(Session *session);
 
121
 
 
122
#include <drizzled/sql_parse.h>
 
123
 
 
124
#include "sql_class.h"
 
125
#include "slave.h" // for tables_ok(), rpl_filter
 
126
 
 
127
void sql_perror(const char *message);
 
128
 
 
129
bool fn_format_relative_to_data_home(char * to, const char *name,
 
130
                                     const char *dir, const char *extension);
 
131
 
 
132
/**
 
133
 * @TODO
 
134
 *
 
135
 * This is much better than the previous situation of a crap-ton
 
136
 * of conditional defines all over mysql_priv.h, but this still
 
137
 * is hackish.  Put these things into a separate header?  Or fix
 
138
 * InnoDB?  Or does the InnoDB plugin already fix this stuff?
 
139
 */
 
140
#if defined DRIZZLE_SERVER || defined INNODB_COMPATIBILITY_HOOKS
 
141
bool check_global_access(Session *session, ulong want_access);
 
142
int get_quote_char_for_identifier(Session *session, const char *name,
 
143
                                  uint32_t length);
 
144
extern struct system_variables global_system_variables;
 
145
extern uint32_t mysql_data_home_len;
 
146
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
 
147
            mysql_real_data_home[], mysql_unpacked_real_data_home[];
 
148
extern const CHARSET_INFO *character_set_filesystem;
 
149
extern char reg_ext[FN_EXTLEN];
 
150
extern uint32_t reg_ext_length;
 
151
extern ulong specialflag;
 
152
extern uint32_t lower_case_table_names;
 
153
uint32_t strconvert(const CHARSET_INFO *from_cs, const char *from,
 
154
                const CHARSET_INFO *to_cs, char *to, uint32_t to_length,
 
155
                uint32_t *errors);
 
156
uint32_t filename_to_tablename(const char *from, char *to, uint32_t to_length);
 
157
uint32_t tablename_to_filename(const char *from, char *to, uint32_t to_length);
 
158
#endif /* DRIZZLE_SERVER || INNODB_COMPATIBILITY_HOOKS */
 
159
 
 
160
 
 
161
#endif /* DRIZZLE_SERVER_COMMON_INCLUDES_H */