From: Ricardo Markiewicz Date: Wed, 23 Nov 2005 04:10:52 +0000 (+0000) Subject: Agrego Magic. X-Git-Tag: 1_0~6 X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/commitdiff_plain/8352395b56693923c60194a35f9315b8da2619da Agrego Magic. El magic en el file es lo que va a permitir luego distinguir de un arbol B de cualquier otro archivo al momento de abrir. --- diff --git a/src/btree.cpp b/src/btree.cpp index 56dd9db..ae68316 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -20,6 +20,8 @@ BTree::BTree (const std::string &name, unsigned int block_size, int tt, int kt, header.tree_type = tt; header.key_type = kt; header.block_data_counter = 0; + strcpy (header.magic, "DILUMA"); + header.magic[6] = '\0'; WriteFileHeader (); /* Creo el primer bloque vacio */ diff --git a/src/btree.h b/src/btree.h index 36558f0..9e49213 100644 --- a/src/btree.h +++ b/src/btree.h @@ -207,6 +207,7 @@ * ocupe block_size de tamaƱo. */ struct BTreeFileHeader { + char magic[7]; uint block_size; int tree_type; int key_type;