X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/b6adfac6abe59eaf6165396982e4ab447e48b62b..adc471953720d36ec1767e5006ffd6c9758672c3:/emufs_gui/tree_viewer.c diff --git a/emufs_gui/tree_viewer.c b/emufs_gui/tree_viewer.c index 7f83b26..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) { @@ -44,14 +66,8 @@ 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