]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs/fsc.c
asi esta bien?
[z.facultad/75.06/emufs.git] / emufs / fsc.c
index 2d2932b332a3595546c8fbd70381731e0281b242..05e29a843758dd9e5e4fb8e77dbb162203f88439 100644 (file)
@@ -359,7 +359,7 @@ EMUFS_BLOCK_ID emufs_fsc_buscar_lugar(EMUFS *emu, EMUFS_FREE reg_size, EMUFS_FRE
 
 /** Busca n lugares consecutivos devolviendo el id del primer bloque. */
 EMUFS_BLOCK_ID emufs_fsc_buscar_n_lugares(EMUFS* efs, size_t n,
 
 /** Busca n lugares consecutivos devolviendo el id del primer bloque. */
 EMUFS_BLOCK_ID emufs_fsc_buscar_n_lugares(EMUFS* efs, size_t n,
-               EMUFS_FREE reg_size, EMUFS_FREE *freespace, int* err)
+               EMUFS_FREE size, EMUFS_FREE *freespace, int* err)
 {
        FILE *f_fsc;
        EMUFS_FSC reg;
 {
        FILE *f_fsc;
        EMUFS_FSC reg;
@@ -389,7 +389,7 @@ EMUFS_BLOCK_ID emufs_fsc_buscar_n_lugares(EMUFS* efs, size_t n,
                        *err = EMUFS_ERROR_FILE_READ;
                        return EMUFS_NOT_FOUND;
                }
                        *err = EMUFS_ERROR_FILE_READ;
                        return EMUFS_NOT_FOUND;
                }
-               if (reg.freespace >= reg_size) {
+               if (reg.freespace >= size) {
                        int found = 1;
                        EMUFS_BLOCK_ID first_id = reg.marker;
                        *freespace = reg.freespace;
                        int found = 1;
                        EMUFS_BLOCK_ID first_id = reg.marker;
                        *freespace = reg.freespace;
@@ -401,7 +401,7 @@ EMUFS_BLOCK_ID emufs_fsc_buscar_n_lugares(EMUFS* efs, size_t n,
                                        return EMUFS_NOT_FOUND;
                                }
                                /* no hay otro lugar consecutivo */
                                        return EMUFS_NOT_FOUND;
                                }
                                /* no hay otro lugar consecutivo */
-                               if (reg.freespace < reg_size) {
+                               if (reg.freespace < size) {
                                        found = 0;
                                        break;
                                }
                                        found = 0;
                                        break;
                                }
@@ -567,3 +567,12 @@ EMUFS_BLOCK_ID emufs_fsc_get_num_blocks(EMUFS* efs)
        fclose(f_fsc);
        return cant;
 }
        fclose(f_fsc);
        return cant;
 }
+
+long emufs_fsc_get_file_size(EMUFS* efs, int* err)
+{
+       char name[255];
+       strcpy(name, efs->nombre);
+       strcat(name, EMUFS_FSC_EXT);
+       return emufs_common_get_file_size(name, err);
+}
+