X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/b6adfac6abe59eaf6165396982e4ab447e48b62b..13548548ec733fd01b093c91b007379dbdbf293c:/emufs_gui/tree_viewer.c diff --git a/emufs_gui/tree_viewer.c b/emufs_gui/tree_viewer.c index 7f83b26..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) { @@ -46,12 +68,7 @@ int emufs_indice_b_ver(INDICE *idx, WINDOW *win, int w, int h, int id) waddstr(win, tmp); fprintf(stderr, "CANT DE CLAVES = %d\n", header.cant); for(i=0; i