X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/60505ae8ce77483ea58c6829c20de89f1c01afaf..e0b2f02fb7880eb26e4fc28e85253dc56b6c6aab:/emufs/tipo3.h diff --git a/emufs/tipo3.h b/emufs/tipo3.h index 47b2568..ad84d81 100644 --- a/emufs/tipo3.h +++ b/emufs/tipo3.h @@ -1,36 +1,72 @@ -#ifndef _PARAM_CTE_H_ -#define _PARAM_CTE_H_ +/* vim: set noexpandtab tabstop=4 shiftwidth=4: + *---------------------------------------------------------------------------- + * emufs + *---------------------------------------------------------------------------- + * This file is part of emufs. + * + * emufs is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * emufs is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along + * with emufs; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + *---------------------------------------------------------------------------- + * Creado: mié mar 31 17:26:46 ART 2004 + * Autores: Nicolás Dimov + *---------------------------------------------------------------------------- + * + * $Id$ + * + */ + +/** \file + * + * Archivo con bloques y registros de longitud parametrizada. + * + * Implementación del archivo con bloques y registros de longitud + * parametrizada. + * + */ + +#ifndef _EMUFS_TIPO3_H_ +#define _EMUFS_TIPO3_H_ + #include #include #include #include #include "emufs.h" +#include "did.h" +#include "idx.h" +#include "fsc.h" -typedef struct block_free_t{ - int block; - int free_space; -}BLOCK_FREE_T; -typedef struct block_reg_t{ - int block; - long int id_reg; -}BLOCK_REG_T; +/** Lee el registro \param id_reg y lo almacena en \param ptr */ +int emufs_tipo3_leer_registro(EMUFS *emu, int id_reg, void *ptr, unsigned long tam_reg); -int leer_registro(EMUFS *, int , void *, unsigned long); +/** Lee el bloque \param num_bloque y lo almacena en \param ptr */ +int emufs_tipo3_leer_bloque(EMUFS *emu, int num_bloque, void *ptr); -int leer_bloque(EMUFS *, int , void *); +/** Graba el registro apuntado por \param ptr en el archivo */ +int emufs_tipo3_grabar_registro(EMUFS *emu, void *ptr, unsigned long tam_reg); -int grabar_registro(EMUFS *, void *, unsigned long ); +/** Graba el bloque apuntado por \param ptr en el archivo */ +int emufs_tipo3_grabar_bloque(EMUFS *emu, void *ptr, int num_bloque); -int existe_registro(EMUFS *, int); +int emufs_tipo3_get_id(EMUFS *emu); -int buscar_registro(EMUFS *, int); +int emufs_tipo3_buscar_registro(EMUFS *emu, int id_reg); -int buscar_lugar(EMUFS *, unsigned long , int *); +int emufs_tipo3_buscar_lugar(EMUFS *emu, unsigned long tam_reg, int *free_space); -int get_id(EMUFS *); +int emufs_tipo3_borrar_registro(EMUFS *emu, int id_reg, unsigned long tam_reg); -int grabar_bloque(EMUFS *, void *, int); -int borrar_registro(EMUFS*, int, int); -#endif +#endif /* _EMUFS_TIPO3_H_ */