1
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
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; either version 2 of the License, or
6
(at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18
/* Extra functions used by unireg library */
23
#define NO_ALARM_LOOP /* lib5 and popen can't use alarm */
26
/* These paths are converted to other systems (WIN95) before use */
28
#define LANGUAGE "english/"
29
#define ERRMSG_FILE "errmsg.sys"
30
#define TEMP_PREFIX "MY"
31
#define PROGDIR "bin/"
33
#define DATADIR "data/"
36
#define SHAREDIR "share/"
39
#define ER(X) errmesg[(X)-1000]
41
#define ERRMAPP 1 /* Errormap f|r my_error */
42
#define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */
43
#define MAX_FIELD_NAME 34 /* Max colum name length +2 */
44
#define MAX_KEY 32 /* Max used keys */
45
#define MAX_REF_PARTS 16 /* Max parts used as ref */
46
#define MAX_KEY_LENGTH 500 /* max possible key */
48
#define MAX_REFLENGTH 8 /* Max length for record ref */
50
#define MAX_REFLENGTH 4 /* Max length for record ref */
53
#define MAX_FIELD_WIDTH 256 /* Max column width +1 */
54
#define MAX_TABLES (sizeof(table_map)*8-1) /* Max tables in join */
55
#define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1))
56
#define MAX_FIELDS 4096 /* Limit in the .frm file */
58
#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD)
59
#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD)
60
#define EXTRA_RECORDS 10 /* Extra records in sort */
61
#define SCROLL_EXTRA 5 /* Extra scroll-rows. */
62
#define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */
63
#define FORM_NAME_USED ((uint) 16384) /* Bit set if formname used */
64
#define FIELD_NR_MASK 16383 /* To get fieldnumber */
65
#define FERR -1 /* Error from my_functions */
66
#define CREATE_MODE 0 /* Default mode on new files */
67
#define NAMES_SEP_CHAR '\377' /* Char to sep. names */
69
#define EXTRA_FIELD_CHAR (char) '\234' /* Interchangebly with '#' */
71
#define EXTRA_FIELD_CHAR '#' /* Interchangebly with '#' */
74
#define READ_RECORD_BUFFER (uint) (IO_SIZE*8) /* Pointer_buffer_size */
75
#define DISK_BUFFER_SIZE (uint) (IO_SIZE*16) /* Size of diskbuffer */
76
#define POSTFIX_ERROR DBL_MAX
78
#define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH)
79
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
80
#define MYF_RW MYF(MY_WME+MY_NABP) /* Vid my_read & my_write */
82
#define SPECIAL_USE_LOCKS 1 /* Lock used databases */
83
#define SPECIAL_NO_NEW_FUNC 2 /* Skipp new functions */
84
#define SPECIAL_NEW_FUNC 4 /* New nonstandard functions */
85
#define SPECIAL_WAIT_IF_LOCKED 8 /* Wait if locked database */
86
#define SPECIAL_SAME_DB_NAME 16 /* form name = file name */
87
#define SPECIAL_ENGLISH 32 /* English error messages */
88
#define SPECIAL_NO_RESOLVE 64 /* Don't use gethostname */
89
#define SPECIAL_NO_PRIOR 128 /* Don't prioritize threads */
90
#define SPECIAL_BIG_SELECTS 256 /* Don't use heap tables */
91
#define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */
92
#define SPECIAL_LONG_LOG_FORMAT 1024
93
#define SPECIAL_SAFE_MODE 2048
94
#define SPECIAL_SKIP_SHOW_DB 4096 /* Don't allow 'show db' */
97
#define store_record(A,B) bmove_allign((A)->record[B],(A)->record[0],(size_t) (A)->reclength)
98
#define restore_record(A,B) bmove_allign((A)->record[0],(A)->record[B],(size_t) (A)->reclength)
99
#define cmp_record(A,B) memcmp((A)->record[0],(A)->record[B],(size_t) (A)->reclength)
100
#define empty_record(A) { \
101
bmove_allign((A)->record[0],(A)->record[2],(size_t) (A)->reclength); \
102
bfill((A)->null_flags,(A)->null_bytes,255);\
105
#if MAX_REFLENGTH == 4
106
#define TEST_IF_LASTREF(A,B) ((long) *((int32*) (A)) == -1L)
108
#define TEST_IF_LASTREF(A,B) (bcmp(A,last_ref,B) == 0)
111
/* Defines for use with openfrm, openprt and openfrd */
113
#define READ_ALL 1 /* openfrm: Read all parameters */
114
#define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */
115
#define READ_KEYINFO 4 /* L{s nyckeldata fr}n filen */
116
#define EXTRA_RECORD 8 /* Reservera plats f|r extra record */
117
#define DONT_OPEN_TABLES 8 /* Don't open database-files (frd) */
118
#define DONT_OPEN_MASTER_REG 16 /* Don't open first reg-file (prt) */
119
#define EXTRA_LONG_RECORD 16 /* Plats f|r dubbel s|k-record */
120
#define COMPUTE_TYPES 32 /* Kontrollera type f|r f{ltena */
121
#define SEARCH_PRG 64 /* S|k efter registret i 'prg_dev' */
122
#define READ_USED_NAMES 128 /* L{s anv{nda formul{rnamn */
123
#define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */
124
#define READ_SCREENS 1024 /* Read screens, info and helpfile */
125
#define DELAYED_OPEN 4096 /* Open table later */
127
#define SC_INFO_LENGTH 4 /* Form format constant */
128
#define TE_INFO_LENGTH 3
129
#define MTYP_NOEMPTY_BIT 128
131
/* Include prototypes for unireg */
133
#include "mysqld_error.h"
134
#include "structs.h" /* All structs we need */