X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/8bc5985288b46b993316b85bf2e13899c1a09292..8567a7085f7e311712244a69a1d1a45737a9ae32:/emufs/tipo3.c diff --git a/emufs/tipo3.c b/emufs/tipo3.c index ac73429..10d6f33 100644 --- a/emufs/tipo3.c +++ b/emufs/tipo3.c @@ -575,16 +575,27 @@ void emufs_tipo3_leer_bloque_raw(EMUFS *efs, EMUFS_BLOCK_ID id, char **actual, c (*size1) = (*size2) = (*size3) = efs->tam_bloque; } +CLAVE obtener_clave(void *ptr, INDICE indice) +{ + CLAVE clave; + + switch ( indice->tipo_dato ){ + case IDX_FLOAT: + memcpy(&clave, ptr+indice->offset, sizeof(float)); + break; + case IDX_INT: + memcpy(&clave, ptr+indice->offset, sizeof(int)); + } + return clave; +} + int emufs_tipo3_insertar_ordenado(EMUFS *emu, void *ptr, CLAVE clave, int offset, EMUFS_BLOCK_ID num_bloque, int *err) { - FILE *f; - char f_name[255]; + /*FILE *f; + char f_name[255];*/ char *bloque; - int size; CLAVE clave_ant; - - strcpy(f_name, emu->nombre); - strcat(f_name, ".dat"); + bloque = emufs_tipo3_leer_bloque(emu, num_bloque, err); if (err){