X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/549a07c528dc9f77fa70cd331fb0250026781425..0e7dc53e78dfe5d9f9d6b14eee33caf6c52a76bc:/emufs_gui/tree_viewer.c?ds=inline diff --git a/emufs_gui/tree_viewer.c b/emufs_gui/tree_viewer.c index 34fe6f2..0c6e968 100644 --- a/emufs_gui/tree_viewer.c +++ b/emufs_gui/tree_viewer.c @@ -1,5 +1,27 @@ #include "tree_viewer.h" +#include "emufs.h" + +void sprint_ind(INDICE *idx, char *dst, B_NodoEntry e) +{ + int error; + char * leido; + EMUFS_REG_SIZE dummy; + + switch (idx->tipo_dato) { + case IDX_INT: + sprintf(dst, "(%d)%d", e.clave.i_clave, e.hijo_derecho); + break; + case IDX_FLOAT: + sprintf(dst, "(%.2f)%d", e.clave.f_clave, e.hijo_derecho); + break; + case IDX_STRING: + error = 0; + leido = idx->emu_string->leer_registro(idx->emu_string, e.clave, &dummy, &error); + sprintf(dst, "(%s)%d", leido, e.hijo_derecho); + free(leido); + } +} int emufs_indice_b_ver(INDICE *idx, WINDOW *win, int w, int h, int id) { @@ -10,7 +32,7 @@ int emufs_indice_b_ver(INDICE *idx, WINDOW *win, int w, int h, int id) char *nodo; char tmp[100]; int i; - int posibles_proximos[100]; + int posibles_proximos[1000]; int proximo; if (id == -1) return 0; @@ -44,13 +66,9 @@ int emufs_indice_b_ver(INDICE *idx, WINDOW *win, int w, int h, int id) wmove(win, y, 0); sprintf(tmp, "%d", header.hijo_izquierdo); waddstr(win, tmp); + fprintf(stderr, "CANT DE CLAVES = %d\n", header.cant); for(i=0; i