1
/* Copyright (C) 2003 MySQL 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; version 2 of the License.
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.
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 */
19
//===========================================================================
22
// Takes a 128 bits value (done as a array of four longs) and
23
// makes a filename out of it acording the following schema
29
// Bits 112-119 File Type
30
// Bits 120-127 Version number of Filename
32
// T, is used to find/create a directory. If T = 0xFFFF then the
33
// file is on top level. In that case the F is of no relevance.
35
// S, is used to find/create a filename. If S= 0xFFFF then it is ignored.
37
// D, is used to find/create the root directory, this is the
38
// directory before the blockname. If D= 0xFF then it is ignored.
48
// Version number of Filename, current version is 0x1, must be
49
// used for the this style of options.
52
//===========================================================================
54
#include <ndb_global.h>
55
#include <kernel_types.h>
56
#include <SimulatedBlock.hpp>
61
// filenumber is 64 bits but is split in to 4 32bits words
66
NameSpec(BaseString& f, BaseString&b) :
67
fs_path(f), backup_path(b) {}
69
BaseString& backup_path;
72
void set(NameSpec& spec,
73
BlockReference, const Uint32 fileno[4], bool = false);
74
void set(NameSpec& spec,
75
SegmentedSectionPtr ptr, class SectionSegmentPool&);
77
const char* c_str() const; // Complete name including dirname
78
const char* get_base_name() const; // Exclude fs (or backup) path
80
char theName[PATH_MAX];
85
inline const char* Filename::c_str() const {
89
inline const char* Filename::get_base_name() const {