4 int main(int argc, char* argv[]) {
10 /* Creamos un handler EMUFS, luego un Indice B+ y testing... */
12 indice.tam_bloque = SIZE_B_PLUS_HEADER + sizeof(int)*5 + sizeof(int)*6;
13 indice.size_claves = (indice.tam_bloque - SIZE_B_PLUS_HEADER - sizeof(int))/2;
14 indice.size_hijos = indice.size_claves + sizeof(int);
15 indice.filename = "idxbplus_primary.idx";
16 printf("\nTam Nodo: %i Size Claves: %i Size_Hijos: %i\n",indice.tam_bloque,indice.size_claves,indice.size_hijos);
17 emufs_b_plus_crear(&indice);
19 querydata.num_bloque = 9;
20 querydata.clave.i_clave = 5;
21 b_plus_insertar(&indice,&querydata);
23 querydata.num_bloque = 2;
24 querydata.clave.i_clave = 4;
25 b_plus_insertar(&indice,&querydata);
27 querydata.num_bloque = 7;
28 querydata.clave.i_clave = 3;
29 b_plus_insertar(&indice,&querydata);
31 querydata.num_bloque = 5;
32 querydata.clave.i_clave = 2;
33 b_plus_insertar(&indice,&querydata);
35 querydata.num_bloque = 8;
36 querydata.clave.i_clave = 63;
37 b_plus_insertar(&indice,&querydata);
40 memnodo = b_plus_leer_nodo(&indice, num_node);
41 printf("Dumping Node_%i\n",num_node);
42 printf("Nivel: %i Cant Claves: %i\n",memnodo->nivel,memnodo->cant_claves);
44 for (i = 0; i < indice.size_claves/sizeof(int); ++i) printf(" %i",memnodo->claves[i]);
46 for (i = 0; i < indice.size_hijos/sizeof(int); ++i) printf(" %i",memnodo->hijos[i]);
47 printf("\nEnd Dump\n");
50 /*querydata.num_bloque = 54;
51 querydata.clave.i_clave = 15;
52 b_plus_insertar(&indice, &querydata);*/