~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_access.c

  • Committer: Brian Aker
  • Date: 2008-07-20 05:41:52 UTC
  • Revision ID: brian@tangent.org-20080720054152-5laf6plsb0o7h6ss
Documentation cleanup

Show diffs side-by-side

added added

removed removed

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