X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/549a07c528dc9f77fa70cd331fb0250026781425..a559d9c266c7120220093b1e918a2473a62eccb0:/emufs_gui/tree_viewer.c?ds=sidebyside diff --git a/emufs_gui/tree_viewer.c b/emufs_gui/tree_viewer.c index 34fe6f2..4163d6b 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; @@ -45,12 +67,7 @@ int emufs_indice_b_ver(INDICE *idx, WINDOW *win, int w, int h, int id) sprintf(tmp, "%d", header.hijo_izquierdo); waddstr(win, tmp); for(i=0; i