bfs_tools: some more structs needed packing.
This commit is contained in:
parent
e5e3ac7f70
commit
10e6523159
@ -16,12 +16,12 @@
|
||||
class BPositionIO;
|
||||
|
||||
|
||||
//****************** on-disk structures ********************
|
||||
// ****************** on-disk structures ********************
|
||||
|
||||
#define BPLUSTREE_NULL -1LL
|
||||
#define BPLUSTREE_FREE -2LL
|
||||
|
||||
struct bplustree_header
|
||||
struct __attribute__((packed)) bplustree_header
|
||||
{
|
||||
uint32 magic;
|
||||
uint32 node_size;
|
||||
@ -49,7 +49,7 @@ enum bplustree_types {
|
||||
BPLUSTREE_DOUBLE_TYPE = 6
|
||||
};
|
||||
|
||||
struct bplustree_node {
|
||||
struct __attribute((packed)) bplustree_node {
|
||||
off_t left_link;
|
||||
off_t right_link;
|
||||
off_t overflow_link;
|
||||
@ -60,10 +60,10 @@ struct bplustree_node {
|
||||
inline off_t *Values() const;
|
||||
inline uint8 *Keys() const;
|
||||
inline int32 Used() const;
|
||||
uint8 *KeyAt(int32 index,uint16 *keyLength) const;
|
||||
uint8 *KeyAt(int32 index, uint16 *keyLength) const;
|
||||
|
||||
uint8 CountDuplicates(off_t offset,bool isFragment) const;
|
||||
off_t DuplicateAt(off_t offset,bool isFragment,int8 index) const;
|
||||
uint8 CountDuplicates(off_t offset, bool isFragment) const;
|
||||
off_t DuplicateAt(off_t offset, bool isFragment, int8 index) const;
|
||||
|
||||
static inline uint8 LinkType(off_t link);
|
||||
static inline off_t FragmentOffset(off_t link);
|
||||
@ -73,7 +73,7 @@ struct bplustree_node {
|
||||
#define BPLUSTREE_DUPLICATE_NODE 2
|
||||
#define BPLUSTREE_DUPLICATE_FRAGMENT 3
|
||||
|
||||
//**************************************
|
||||
// **************************************
|
||||
|
||||
enum bplustree_traversing {
|
||||
BPLUSTREE_FORWARD = 1,
|
||||
@ -92,7 +92,7 @@ class NodeCache : public Cache<off_t> {
|
||||
|
||||
virtual Cacheable *NewCacheable(off_t offset);
|
||||
bplustree_node *Get(off_t offset);
|
||||
// void SetOffset(bplustree_node *,off_t offset);
|
||||
// void SetOffset(bplustree_node *, off_t offset);
|
||||
|
||||
protected:
|
||||
BPlusTree *fTree;
|
||||
|
@ -85,7 +85,7 @@ struct __attribute__((packed)) data_stream
|
||||
int64 size;
|
||||
};
|
||||
|
||||
//**************************************
|
||||
// **************************************
|
||||
|
||||
struct bfs_inode;
|
||||
|
||||
@ -107,7 +107,7 @@ struct __attribute__((packed)) small_data
|
||||
#define FILE_NAME_NAME 0x13
|
||||
#define FILE_NAME_NAME_LENGTH 1
|
||||
|
||||
//**************************************
|
||||
// **************************************
|
||||
|
||||
#define SHORT_SYMLINK_NAME_LENGTH 144 // length incl. terminating '\0'
|
||||
|
||||
@ -128,7 +128,7 @@ struct __attribute__((packed)) bfs_inode
|
||||
int32 inode_size;
|
||||
uint32 etc; // for in-memory structures (unused in OpenBeOS' fs)
|
||||
|
||||
union {
|
||||
union __attribute__((packed)) {
|
||||
data_stream data;
|
||||
char short_symlink[SHORT_SYMLINK_NAME_LENGTH];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user