diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-01-27 15:25:46 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-01-27 15:25:46 +0000 |
commit | 9098237f5bb16b204a5ea999b702e5eb170f68ac (patch) | |
tree | ddf0c3013f0877d1f406401c6b4509d11bfb23e3 /src/nids.h | |
parent | 8bc5ac336d5d684341a05e97d1cb1b18ecba0331 (diff) | |
download | libbu++-9098237f5bb16b204a5ea999b702e5eb170f68ac.tar.gz libbu++-9098237f5bb16b204a5ea999b702e5eb170f68ac.tar.bz2 libbu++-9098237f5bb16b204a5ea999b702e5eb170f68ac.tar.xz libbu++-9098237f5bb16b204a5ea999b702e5eb170f68ac.zip |
Corrected some larger read/write issues in corner cases that I hit suprisingly
often within nids. There's still a problem somewhere, but I'll find it.
Also, even after having the file class canRead and canWrite functions work
properly, and using them before trying to write to a nids to update info, we
never ever write anything, so something is still wrong there. For now, all
utilities that open a nids stream read-only will crash when it closes. Pretty
minor really.
Diffstat (limited to 'src/nids.h')
-rw-r--r-- | src/nids.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -65,6 +65,10 @@ namespace Bu | |||
65 | NidsStream openStream( int iID ); | 65 | NidsStream openStream( int iID ); |
66 | 66 | ||
67 | int getBlockSize(); | 67 | int getBlockSize(); |
68 | int getNumBlocks(); | ||
69 | int getNumUsedBlocks(); | ||
70 | int getBlockStart(); | ||
71 | int getBlockOverhead(); | ||
68 | 72 | ||
69 | private: | 73 | private: |
70 | typedef struct Block | 74 | typedef struct Block |
@@ -92,6 +96,8 @@ namespace Bu | |||
92 | uint32_t getNextBlock( uint32_t uIndex, struct Nids::Block *pBlock, | 96 | uint32_t getNextBlock( uint32_t uIndex, struct Nids::Block *pBlock, |
93 | bool bCreate=true); | 97 | bool bCreate=true); |
94 | 98 | ||
99 | void updateHeader(); | ||
100 | |||
95 | // Block allocation routines | 101 | // Block allocation routines |
96 | Block *newBlock(); | 102 | Block *newBlock(); |
97 | void deleteBlock( Block *pBlock ); | 103 | void deleteBlock( Block *pBlock ); |
@@ -101,6 +107,7 @@ namespace Bu | |||
101 | int iBlockSize; | 107 | int iBlockSize; |
102 | int iBlocks; | 108 | int iBlocks; |
103 | int iBlockStart; | 109 | int iBlockStart; |
110 | int iUsed; | ||
104 | Bu::BitString bsBlockUsed; | 111 | Bu::BitString bsBlockUsed; |
105 | }; | 112 | }; |
106 | }; | 113 | }; |