Repository navigation
Expand file tree
/
Copy pathdm.h
More file actions
101 lines (90 loc) · 3.19 KB
/
Copy pathdm.h
File metadata and controls
101 lines (90 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
8000
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/**
* $Id: dm.h 407 2011-02-03 17:54:57Z rdempsey $
*
* @file dm.h
* @author Robert King <rking@calpont.com>
*
* @brief Interface file for the Disk Manager (dm) Library.
*
* This file contains the interface specification for the Disk Manager
* Library. Additionally, any structures used by this interface are
* defined here as well.
*
*
*/
#ifndef DM_H
#define DM_H
#ifndef _MSC_VER
#include <stdint.h>
#ifndef _BASETSD_H_
typedef uint32_t UINT32;
#endif
#else
typedef unsigned __int32 UINT32;
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Contains directory and filename buffers.
*
* dmFilePathArgs_t contains buffers for reporting back the directories
* and filename that correspond to an Object ID (OID)
*
* Directories are organized in a 3-layer tree (used for version buffer files):
*
* <DirA>/<DirB>/<DirC>/<FName>
*
* OR in a 5-layer tree (used for all other db files besides version buffer):
*
* <DirA>/<DirB>/<DirC>/<DirD>/<DirE>/<FName>
*
* @note All buffers must be pre-allocated by the calling routine.
* @note 5-layer directory structure includes partition and segment number.
*/
typedef struct
{
char* pDirA; /**< OUT -- DirA's buffer*/
char* pDirB; /**< OUT -- DirB's buffer */
char* pDirC; /**< OUT -- DirC's buffer */
char* pDirD; /**< OUT -- DirD's buffer */ //dmc-Branch
char* pDirE; /**< OUT -- DirE's buffer */ //dmc-Branch
char* pFName; /**< OUT -- Filename buffer */
int ALen; /**< IN -- Size in bytes of DirA's Buffer. */
int BLen; /**< IN -- Size in bytes of DirB's Buffer. */
int CLen; /**< IN -- Size in bytes of DirC's Buffer. */
int DLen; /**< IN -- Size in bytes of DirD's Buffer. */ //dmc-Branch
int ELen; /**< IN -- Size in bytes of DirE's Buffer. */ //dmc-Branch
int FNLen; /**< IN -- Size in bytes of Filename's Buffer. */
int Arc; /**< OUT -- result code for formatting DirA. */
int Brc; /**< OUT -- result code for formatting DirB. */
int Crc; /**< OUT -- result code for formatting DirC. */
int Drc; /**< OUT -- result code for formatting DirD. */ //dmc-Branch
int Erc; /**< OUT -- result code for formatting DirE. */ //dmc-Branch
int FNrc; /**< OUT -- result code for formatting Filename. */
} dmFilePathArgs_t;
/**
* @brief fill in dmFilePathArgs_t struct for OID.
*/
int dmOid2FPath(UINT32 oid, UINT32 partition, UINT32 segment, dmFilePathArgs_t* pArgs); //dmc-Branch
/**
* @brief calculate OID given dmFilePathArgs_t struct.
*/
int dmFPath2Oid(dmFilePathArgs_t* pArgs, UINT32* oid);
#ifdef __cplusplus
}
#endif
#endif