1
by brian
clean slate |
1 |
/* Copyright (C) 2000 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 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
16 |
#include "config.h" |
1
by brian
clean slate |
17 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
18 |
#include "drizzled/internal/my_sys.h" |
1241.9.64
by Monty Taylor
Moved remaining non-public portions of mysys and mystrings to drizzled/internal. |
19 |
#include "drizzled/internal/m_string.h" |
1
by brian
clean slate |
20 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
21 |
namespace drizzled |
22 |
{
|
|
23 |
namespace internal |
|
24 |
{
|
|
25 |
||
1
by brian
clean slate |
26 |
/*
|
27 |
Return a pointer to the extension of the filename.
|
|
28 |
||
29 |
SYNOPSIS
|
|
30 |
fn_ext()
|
|
31 |
name Name of file
|
|
32 |
||
33 |
DESCRIPTION
|
|
34 |
The extension is defined as everything after the first extension character
|
|
35 |
(normally '.') after the directory name.
|
|
36 |
||
37 |
RETURN VALUES
|
|
38 |
Pointer to to the extension character. If there isn't any extension,
|
|
39 |
points at the end ASCII(0) of the filename.
|
|
40 |
*/
|
|
41 |
||
42 |
char *fn_ext(const char *name) |
|
43 |
{
|
|
44 |
register const char *pos, *gpos; |
|
45 |
||
1122.2.5
by Monty Taylor
Killed some dead code. |
46 |
#if defined(FN_DEVCHAR)
|
1
by brian
clean slate |
47 |
{
|
48 |
char buff[FN_REFLEN]; |
|
49 |
size_t res_length; |
|
50 |
gpos= name+ dirname_part(buff,(char*) name, &res_length); |
|
51 |
}
|
|
52 |
#else
|
|
53 |
if (!(gpos= strrchr(name, FN_LIBCHAR))) |
|
54 |
gpos= name; |
|
55 |
#endif
|
|
56 |
pos=strchr(gpos,FN_EXTCHAR); |
|
376
by Brian Aker
strend remove |
57 |
return((char*) (pos ? pos : strchr(gpos, '\0'))); |
1
by brian
clean slate |
58 |
} /* fn_ext */ |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
59 |
|
60 |
} /* namespace internal */ |
|
61 |
} /* namespace drizzled */ |