~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_access.cc

  • Committer: Brian Aker
  • Date: 2010-02-07 01:33:54 UTC
  • Revision ID: brian@gaz-20100207013354-d2pg1n68u5c09pgo
Remove giant include header to its own file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "mysys_priv.h"
17
 
#include <mystrings/m_string.h>
 
16
#include "config.h"
 
17
 
 
18
#include "drizzled/internal/my_sys.h"
 
19
#include "drizzled/internal/m_string.h"
 
20
 
 
21
namespace drizzled
 
22
{
 
23
namespace internal
 
24
{
18
25
 
19
26
/*
20
27
  List of file names that causes problem on windows
21
28
 
22
29
  NOTE that one can also not have file names of type CON.TXT
23
 
  
 
30
 
24
31
  NOTE: it is important to keep "CLOCK$" on the first place,
25
32
  we skip it in check_if_legal_tablename.
26
33
*/
30
37
  "CON", "PRN", "AUX", "NUL",
31
38
  "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
32
39
  "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
33
 
  NullS
 
40
  NULL
34
41
};
35
42
 
36
 
#define MAX_RESERVED_NAME_LENGTH 6
37
 
 
38
43
 
39
44
/*
40
45
  Looks up a null-terminated string in a list,
41
46
  case insensitively.
42
 
 
 
47
 
43
48
  SYNOPSIS
44
49
    str_list_find()
45
50
    list        list of items
54
59
  const char **name;
55
60
  for (name= list; *name; name++)
56
61
  {
57
 
    if (!my_strcasecmp(&my_charset_latin1, *name, str))
 
62
    if (!my_strcasecmp(&my_charset_utf8_general_ci, *name, str))
58
63
      return 1;
59
64
  }
60
65
  return 0;
91
96
 
92
97
/*
93
98
  Check if a table name may cause problems
94
 
 
 
99
 
95
100
  SYNOPSIS
96
101
    check_if_legal_tablename
97
102
    name        Table name (without any extensions)
109
114
 
110
115
int check_if_legal_tablename(const char *name)
111
116
{
112
 
  return((reserved_map[(uchar) name[0]] & 1) &&
113
 
              (reserved_map[(uchar) name[1]] & 2) &&
114
 
              (reserved_map[(uchar) name[2]] & 4) &&
 
117
  return((reserved_map[(unsigned char) name[0]] & 1) &&
 
118
              (reserved_map[(unsigned char) name[1]] & 2) &&
 
119
              (reserved_map[(unsigned char) name[2]] & 4) &&
115
120
              str_list_find(&reserved_names[1], name));
116
121
}
117
122
 
118
123
 
 
124
} /* namespace internal */
 
125
} /* namespace drizzled */