#include "emufs.h"
#include "tipo3.h"
+#include "did.h"
+#include "fsc.h"
+#include "idx.h"
/* Defino las extenciones que usan cada tipo de archivo */
-#define EXT_TIPO3_DATA ".dat"
char *str_dup(const char *s);
tmp->nombre = str_dup(filename);
strcpy(name, filename);
- strcat(name, EXT_TIPO3_DATA);
+ strcat(name, ".dat");
fp = fopen(name, "w");
if (fp == NULL) {
/* ERROR */
fclose(fp);
strcpy(name, filename);
- strcat(name, EXT_TIPO3_ID);
+ strcat(name, EMUFS_IDX_EXT);
fp = fopen(name, "w");
fclose(fp);
strcpy(name, filename);
- strcat(name, EXT_TIPO3_DISP);
+ strcat(name, EMUFS_FSC_EXT);
fp = fopen(name, "w");
fclose(fp);
strcpy(name, filename);
- strcat(name, EXT_TIPO3_IDS);
+ strcat(name, EMUFS_DID_EXT);
fp = fopen(name, "w");
fclose(fp);
FILE *fp;
strcpy(name, filename);
- strcat(name, EXT_TIPO3_DATA);
+ strcat(name, ".dat");
/* Trato de determinar el tipo de archivo */
fp = fopen(name, "r");
int ver_archivo_FS(EMUFS *emu)
{
FILE *f_block_free;
- BLOCK_FREE_T reg;
+ EMUFS_FSC reg;
char name_f_block_free[255];
strcpy(name_f_block_free,emu->nombre);
strcpy(name_f_block_free,emu->nombre);
strcat(name_f_block_free,".idx");
{
- BLOCK_REG_T r;
+ EMUFS_IDX r;
f_block_free = fopen(name_f_block_free, "r");
- fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
+ fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
while (!feof(f_block_free)) {
printf("ID %ld en bloque %d\n", r.id_reg, r.block);
- fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
+ fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
}
fclose(f_block_free);
}