~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unireg.h

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2006 MySQL AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
 
 
 
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; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
16
20
 
17
21
/*  Extra functions used by unireg library */
18
22
 
19
23
#ifndef _unireg_h
20
24
 
 
25
#include <libdrizzle/gettext.h>
 
26
 
21
27
#ifndef NO_ALARM_LOOP
22
28
#define NO_ALARM_LOOP           /* lib5 and popen can't use alarm */
23
29
#endif
24
30
 
25
 
/* These paths are converted to other systems (WIN95) before use */
26
 
 
27
 
#define LANGUAGE        "english/"
28
 
#define ERRMSG_FILE     "errmsg.sys"
29
 
#define TEMP_PREFIX     "MY"
30
 
#define LOG_PREFIX      "ML"
31
 
#define PROGDIR         "bin/"
32
 
#ifndef DATADIR
33
 
#define DATADIR         "data/"
34
 
#endif
35
 
#ifndef SHAREDIR
36
 
#define SHAREDIR        "share/"
37
 
#endif
38
 
#ifndef PLUGINDIR
39
 
#define PLUGINDIR       "lib/plugin"
40
 
#endif
41
 
 
42
 
#define ER(X) errmesg[(X) - ER_ERROR_FIRST]
43
 
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code")
 
31
#define ER(X) _(drizzled_error_messages[(X) - ER_ERROR_FIRST])
 
32
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : _("Invalid error code"))
44
33
 
45
34
 
46
35
#define ERRMAPP 1                               /* Errormap f|r my_error */
113
102
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
114
103
#define MYF_RW MYF(MY_WME+MY_NABP)              /* Vid my_read & my_write */
115
104
 
116
 
#define SPECIAL_USE_LOCKS       1               /* Lock used databases */
117
 
#define SPECIAL_NO_NEW_FUNC     2               /* Skip new functions */
118
 
#define SPECIAL_SKIP_SHOW_DB    4               /* Don't allow 'show db' */
119
 
#define SPECIAL_WAIT_IF_LOCKED  8               /* Wait if locked database */
120
 
#define SPECIAL_SAME_DB_NAME   16               /* form name = file name */
121
 
#define SPECIAL_ENGLISH        32               /* English error messages */
122
 
#define SPECIAL_NO_RESOLVE     64               /* Don't use gethostname */
123
 
#define SPECIAL_NO_PRIOR        128             /* Don't prioritize threads */
124
 
#define SPECIAL_BIG_SELECTS     256             /* Don't use heap tables */
125
 
#define SPECIAL_NO_HOST_CACHE   512             /* Don't cache hosts */
126
 
#define SPECIAL_SHORT_LOG_FORMAT 1024
127
 
#define SPECIAL_SAFE_MODE       2048
128
 
#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
129
 
 
130
105
        /* Extern defines */
131
 
#define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
132
 
#define restore_record(A,B) bmove_align((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
 
106
#define store_record(A,B) memcpy((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
 
107
#define restore_record(A,B) memcpy((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
133
108
#define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
134
 
#define empty_record(A) { \
135
 
                          restore_record((A),s->default_values); \
136
 
                          bfill((A)->null_flags,(A)->s->null_bytes,255);\
137
 
                        }
138
 
 
139
 
        /* Defines for use with openfrm, openprt and openfrd */
140
 
 
141
 
#define READ_ALL                1       /* openfrm: Read all parameters */
142
 
#define CHANGE_FRM              2       /* openfrm: open .frm as O_RDWR */
143
 
#define READ_KEYINFO            4       /* L{s nyckeldata fr}n filen */
144
 
#define EXTRA_RECORD            8       /* Reservera plats f|r extra record */
145
 
#define DONT_OPEN_TABLES        8       /* Don't open database-files (frd) */
146
 
#define DONT_OPEN_MASTER_REG    16      /* Don't open first reg-file (prt) */
147
 
#define EXTRA_LONG_RECORD       16      /* Plats f|r dubbel s|k-record */
148
 
#define COMPUTE_TYPES           32      /* Kontrollera type f|r f{ltena */
149
 
#define SEARCH_PRG              64      /* S|k efter registret i 'prg_dev' */
150
 
#define READ_USED_NAMES         128     /* L{s anv{nda formul{rnamn */
151
 
#define DONT_GIVE_ERROR         256     /* Don't do frm_error on openfrm  */
152
 
#define READ_SCREENS            1024    /* Read screens, info and helpfile */
153
 
#define DELAYED_OPEN            4096    /* Open table later */
154
 
#define OPEN_VIEW               8192    /* Allow open on view */
155
 
#define OPEN_VIEW_NO_PARSE     16384    /* Open frm only if it's a view,
156
 
                                           but do not parse view itself */
 
109
#define empty_record(A)                                 \
 
110
  do {                                                  \
 
111
    restore_record((A),s->default_values);              \
 
112
    memset((A)->null_flags, 255, (A)->s->null_bytes);   \
 
113
  } while (0)
 
114
 
157
115
/**
158
116
  This flag is used in function get_all_tables() which fills
159
117
  I_S tables with data which are retrieved from frm files and storage engine
188
146
*/
189
147
#define OPTIMIZE_I_S_TABLE     OPEN_VIEW_FULL*2
190
148
 
191
 
/*
192
 
  The flag means that we need to process trigger files only.
193
 
*/
194
 
#define OPEN_TRIGGER_ONLY      OPTIMIZE_I_S_TABLE*2
195
 
 
196
149
#define SC_INFO_LENGTH 4                /* Form format constant */
197
150
#define TE_INFO_LENGTH 3
198
151
#define MTYP_NOEMPTY_BIT 128
199
152
 
200
153
#define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */
201
 
#define MYSQL_VERSION_TABLESPACE_IN_FRM_CGE 50120
202
 
#define MYSQL_VERSION_TABLESPACE_IN_FRM 50205
203
 
#define MYSQL_VERSION_TABLESPACE_IN_FRM_STR "50205"
 
154
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_CGE 50120
 
155
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM 50205
 
156
#define DRIZZLE_VERSION_TABLESPACE_IN_FRM_STR "50205"
204
157
 
205
158
/*
206
159
  Minimum length pattern before Turbo Boyer-Moore is used
225
178
 
226
179
/* Include prototypes for unireg */
227
180
 
228
 
#include "mysqld_error.h"
 
181
#include <drizzled/error.h>
229
182
#include "structs.h"                            /* All structs we need */
230
183
 
231
184
#endif