X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/040dedefae72d1f07b8ff16073ac095c64cb82df..9da17243492426daba1cf11c353f4216e7e34ca1:/emufs/indices.c?ds=sidebyside diff --git a/emufs/indices.c b/emufs/indices.c index fe3e519..1cf7f66 100644 --- a/emufs/indices.c +++ b/emufs/indices.c @@ -134,11 +134,13 @@ CLAVE emufs_indice_generar_clave(INDICE *idx, char *data) k.i_clave = *((int *)(data+idx->offset)); break; case IDX_STRING: + error = 0; k.i_clave = idx->emu_string->grabar_registro(idx->emu_string, data+idx->offset, strlen(data+idx->offset)+1, &error ); + fprintf(stderr, "Grabe String en ID = %d\n", k.i_clave); } return k; @@ -148,7 +150,7 @@ int emufs_indice_es_menor(INDICE *idx, CLAVE c1, CLAVE c2) { char *sc1, *sc2; /* Si es IDX_STRING aca pongo los strings leidos */ EMUFS_REG_SIZE dummy; /* No me interesa el tamaƱo del string aca! */ - int error; + int error=0; switch (idx->tipo_dato) { case IDX_FLOAT: @@ -156,8 +158,13 @@ int emufs_indice_es_menor(INDICE *idx, CLAVE c1, CLAVE c2) case IDX_INT: return c1.i_clave < c2.i_clave; case IDX_STRING: + fprintf(stderr, "--- 1 ---\n"); + fprintf(stderr, "--> %d\n", c1.i_clave); sc1 = idx->emu_string->leer_registro(idx->emu_string, c1, &dummy, &error); + fprintf(stderr, "--- 2 ---\n"); + fprintf(stderr, "--> %d\n", c2.i_clave); sc2 = idx->emu_string->leer_registro(idx->emu_string, c2, &dummy, &error); + fprintf(stderr, "--- 3 ---\n"); error = (strcmp(sc1, sc2) < 0); free(sc1); free(sc2); @@ -178,7 +185,11 @@ int emufs_indice_es_igual(INDICE *idx, CLAVE c1, CLAVE c2) case IDX_INT: return c1.i_clave == c2.i_clave; case IDX_STRING: + error = 0; + fprintf(stderr, "--> %d\n", c1.i_clave); sc1 = idx->emu_string->leer_registro(idx->emu_string, c1, &dummy, &error); + error = 0; + fprintf(stderr, "--> %d\n", c2.i_clave); sc2 = idx->emu_string->leer_registro(idx->emu_string, c2, &dummy, &error); error = (strcmp(sc1, sc2) == 0); free(sc1);