#define _EMUFS_IDX_H
#include <string.h>
+#include <unistd.h>
#include "emufs.h"
#define EMUFS_IDX_EXT ".idx"
typedef struct emufs_idx_t {
- int block;
- long int id_reg;
+ EMUFS_REG_ID id_reg;
+ EMUFS_BLOCK_ID location;
} EMUFS_IDX;
FILE* emufs_idx_abrir(EMUFS*, const char*);
int emufs_idx_crear(EMUFS*);
-int emufs_idx_buscar_mayor_id(EMUFS *);
+EMUFS_REG_ID emufs_idx_buscar_mayor_id_libre(EMUFS*, int*);
-int emufs_idx_buscar_registro(EMUFS *, int);
+EMUFS_BLOCK_ID emufs_idx_buscar_registro(EMUFS*, EMUFS_REG_ID);
-int emufs_idx_agregar(EMUFS *, int , int);
+int emufs_idx_agregar(EMUFS*, EMUFS_BLOCK_ID, EMUFS_REG_ID);
+
+int emufs_idx_borrar(EMUFS*, EMUFS_REG_ID);
+
+EMUFS_REG_ID emufs_idx_get_count(EMUFS *);
+
+EMUFS_REG_ID emufs_idx_get_id_at(EMUFS *, long pos);
+
+EMUFS_REG_ID emufs_idx_get_new_id(EMUFS*, int*);
+
+/*me informa la cantidad de registros existentes en .dat*/
+int emufs_idx_get_cant_reg(EMUFS*);
#endif /* _EMUFS_IDX_H */