~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_dirname.c

  • Committer: Monty Taylor
  • Date: 2008-07-28 02:47:38 UTC
  • mto: (212.5.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 219.
  • Revision ID: monty@inaugust.com-20080728024738-366ikqnoqv7d8g6l
Fixed the includes in places to make the myisam header file move work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "mysys_priv.h"
17
 
#include <mystrings/m_string.h>
 
17
#include <m_string.h>
18
18
 
19
19
        /* Functions definied in this file */
20
20
 
21
21
size_t dirname_length(const char *name)
22
22
{
23
 
  register const char *pos, *gpos;
 
23
  register char *pos, *gpos;
24
24
#ifdef BASKSLASH_MBTAIL
25
25
  CHARSET_INFO *fs= fs_character_set();
26
26
#endif
27
27
#ifdef FN_DEVCHAR
28
28
  if ((pos=(char*)strrchr(name,FN_DEVCHAR)) == 0)
29
29
#endif
30
 
    pos=name-1;
 
30
    pos=(char*) name-1;
31
31
 
32
32
  gpos= pos++;
33
33
  for ( ; *pos ; pos++)                         /* Find last FN_LIBCHAR */
34
34
  {
35
35
#ifdef BASKSLASH_MBTAIL
36
 
    uint32_t l;
 
36
    uint l;
37
37
    if (use_mb(fs) && (l= my_ismbchar(fs, pos, pos + 3)))
38
38
    {
39
39
      pos+= l - 1;
47
47
        )
48
48
      gpos=pos;
49
49
  }
50
 
  return gpos-name+1;
 
50
  return (size_t) (gpos+1-(char*) name);
51
51
}
52
52
 
53
53
 
80
80
  SYNPOSIS
81
81
    convert_dirname()
82
82
    to                          Store result here. Must be at least of size
83
 
                                cmin(FN_REFLEN, strlen(from) + 1) to make room
 
83
                                min(FN_REFLEN, strlen(from) + 1) to make room
84
84
                                for adding FN_LIBCHAR at the end.
85
85
    from                        Original filename. May be == to
86
86
    from_end                    Pointer at end of filename (normally end \0)
91
91
    Adds a FN_LIBCHAR to end if the result string if there isn't one
92
92
    and the last isn't dev_char.
93
93
    Copies data from 'from' until ASCII(0) for until from == from_end
94
 
    If you want to use the whole 'from' string, just send NULL as the
 
94
    If you want to use the whole 'from' string, just send NullS as the
95
95
    last argument.
96
96
 
97
97
    If the result string is larger than FN_REFLEN -1, then it's cut.
130
130
      else
131
131
      {
132
132
#ifdef BACKSLASH_MBTAIL
133
 
        uint32_t l;
 
133
        uint l;
134
134
        if (use_mb(fs) && (l= my_ismbchar(fs, from, from + 3)))
135
135
        {
136
136
          memmove(to, from, l);