X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/8c4b45bea612dbaa2b478203697ab153a11bf18a..3291460361a5e4280b125e15f833d5ec1820c349:/tipo3/main.c diff --git a/tipo3/main.c b/tipo3/main.c index c9fd819..5550d0c 100644 --- a/tipo3/main.c +++ b/tipo3/main.c @@ -1,14 +1,32 @@ #include -typedef struct block_reg_t{ - int block; - int reg; -}block_reg_t; -int main ( ) +#include +#include "emufs.h" + +int main() { - struct block_reg_t r; - - printf("sizeof(struct block_reg_t) = %d\n", sizeof(struct block_reg_t)); - printf("sizeof(r) = %d\n", sizeof(r)); + EMUFS *fp; + char a[100]; + char c[100]; + int n1, n2; + char b[100]; + + strcpy(a, "1234567890"); + strcpy(c, "REGISTRO NUMERO 2. ESTE REGISTRO ES MUCHO MAS LARGO QUE EL UNO"); + + fp = emufs_crear("articulos", T3, 512, 100); + + n1 = fp->grabar_registro(fp, a, 100); + n2 = fp->grabar_registro(fp, c, 100); + + printf("ID1 = %d\n", n1); + printf("ID2 = %d\n", n2); + + fp->leer_registro(fp, n1, b, 100); + + printf("Ok\n"); + printf("Recuperado : %s\n", b); + + emufs_destruir(fp); return 0; }