Changed tree, re-implemented and fixed a lot of problematic areas

This commit is contained in:
Mario Danic
2007-05-31 04:25:39 +00:00
parent 0281fcb717
commit 3e29f914fd
19 changed files with 1397 additions and 756 deletions

View File

@ -117,8 +117,8 @@ susp_add_CE(struct ecma119_write_target *t, struct ecma119_tree_node *node)
{
try_add_CE(t, &node->susp, node->dirent_len);
if (node->type == ECMA119_DIR) {
try_add_CE(t, &node->dir.self_susp, 34);
try_add_CE(t, &node->dir.parent_susp, 34);
try_add_CE(t, &node->info.dir.self_susp, 34);
try_add_CE(t, &node->info.dir.parent_susp, 34);
}
}
@ -137,7 +137,7 @@ susp_add_SP(struct ecma119_write_target *t, struct ecma119_tree_node *dir)
SP[4] = 0xbe;
SP[5] = 0xef;
SP[6] = 0;
susp_append(t, &dir->dir.self_susp, SP);
susp_append(t, &dir->info.dir.self_susp, SP);
}
#if 0
@ -176,7 +176,7 @@ rrip_add_ER(struct ecma119_write_target *t, struct ecma119_tree_node *dir)
"FILE SYSTEM SEMANTICS.", 72);
memcpy(&ER[89], "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, "
"PISCATAWAY, NJ, USA FOR THE 1282 SPECIFICATION.", 93);
susp_append(t, &dir->dir.self_susp, ER);
susp_append(t, &dir->info.dir.self_susp, ER);
}
/* calculate the location of the CE areas. Since CE areas don't need to be
@ -184,9 +184,9 @@ rrip_add_ER(struct ecma119_write_target *t, struct ecma119_tree_node *dir)
* directory and dump them immediately after all the directory records.
*
* Requires that the following be known:
* - position of the current directory (dir->block)
* - length of the current directory (dir->dir.len)
* - sum of the children's CE lengths (dir->dir.CE_len)
* - position of the current directory (dir->info.dir.block)
* - length of the current directory (dir->info.dir.len)
* - sum of the children's CE lengths (dir->info.dir.CE_len)
*/
static void
susp_fin_1_CE(struct ecma119_write_target *t,
@ -208,18 +208,18 @@ static void susp_fin_CE(struct ecma119_write_target *t,
struct ecma119_tree_node *dir)
{
int i;
size_t CE_offset = dir->dir.len;
size_t CE_offset = dir->info.dir.len;
assert(dir->type == ECMA119_DIR);
susp_fin_1_CE(t, &dir->dir.self_susp, dir->block, &CE_offset);
susp_fin_1_CE(t, &dir->dir.parent_susp, dir->block, &CE_offset);
susp_fin_1_CE(t, &dir->info.dir.self_susp, dir->info.dir.block, &CE_offset);
susp_fin_1_CE(t, &dir->info.dir.parent_susp, dir->info.dir.block, &CE_offset);
for (i = 0; i < dir->dir.nchildren; i++) {
struct ecma119_tree_node *ch = dir->dir.children[i];
susp_fin_1_CE(t, &ch->susp, dir->block, &CE_offset);
for (i = 0; i < dir->info.dir.nchildren; i++) {
struct ecma119_tree_node *ch = dir->info.dir.children[i];
susp_fin_1_CE(t, &ch->susp, dir->info.dir.block, &CE_offset);
}
assert(CE_offset == dir->dir.len + dir->dir.CE_len);
assert(CE_offset == dir->info.dir.len + dir->info.dir.CE_len);
}
void
@ -229,13 +229,13 @@ susp_finalize(struct ecma119_write_target *t, struct ecma119_tree_node *dir)
assert(dir->type = ECMA119_DIR);
if (dir->dir.depth != 1) {
if (dir->info.dir.depth != 1) {
susp_fin_CE(t, dir);
}
for (i = 0; i < dir->dir.nchildren; i++) {
if (dir->dir.children[i]->type == ECMA119_DIR)
susp_finalize(t, dir->dir.children[i]);
for (i = 0; i < dir->info.dir.nchildren; i++) {
if (dir->info.dir.children[i]->type == ECMA119_DIR)
susp_finalize(t, dir->info.dir.children[i]);
}
}