1 /* vim: set noexpandtab tabstop=4 shiftwidth=4:
2 *----------------------------------------------------------------------------
4 *----------------------------------------------------------------------------
5 * This file is part of emufs.
7 * emufs is free software; you can redistribute it and/or modify it under the
8 * terms of the GNU General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option) any later
12 * emufs is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along
18 * with emufs; if not, write to the Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA 02111-1307 USA
20 *----------------------------------------------------------------------------
21 * Creado: mié mar 31 17:26:46 ART 2004
22 * Autores: Nicolás Dimov <sagardua@uolsinectis.com.ar>
23 *----------------------------------------------------------------------------
25 * $Id: command.cpp 220 2003-11-19 23:10:40Z luca $
31 * Prueba de archivo \ref tipo3.h "tipo3".
39 int main(int argc, char *argv[])
42 int n1, n2, n3, n4, n5, n6, n7, n8;
54 printf("Modo de uso : %s tam_bloque\n", argv[0]);
58 if (atoi(argv[1]) < 104) {
59 printf("El tamaño de bloque debe ser mayor a 104\n");
63 strcpy(a, "1234567890");
64 strcpy(c, "REGISTRO NUMERO 2. ESTE REGISTRO ES MUCHO MAS LARGO QUE EL UNO");
65 strcpy(d, "ABCDEFGHIJKL");
66 strcpy(e, "HOLA soy un registro nuevo, me llamo E");
67 strcpy(f, "yo soy F");
68 strcpy(g, "me llamo G y quiero estar en el bloque 1");
69 strcpy(h, "un registro nuevo que se llama H, acompania a G en el bloque 1");
70 strcpy(i, "me argrego despues de borrar a un registro");
72 fp = emufs_crear("articulos", T3, atoi(argv[1]), 100);
74 n1 = fp->grabar_registro(fp, a, 100);
75 n2 = fp->grabar_registro(fp, c, 100);
76 n3 = fp->grabar_registro(fp, d, 100);
77 n4 = fp->grabar_registro(fp, e, 100);
78 n5 = fp->grabar_registro(fp, f, 100);
79 n6 = fp->grabar_registro(fp, g, 100);
80 n7 = fp->grabar_registro(fp, h, 100);
82 printf("ID0 = %d\n", n1);
83 printf("ID1 = %d\n", n2);
84 printf("ID2 = %d\n", n3);
85 printf("ID3 = %d\n", n4);
86 printf("ID4 = %d\n", n5);
87 printf("ID5 = %d\n", n6);
88 printf("ID6 = %d\n", n7);
91 fp->borrar_registro(fp, n4, 100);
92 n8 = fp->grabar_registro(fp, i, 100);
93 fp->leer_registro(fp, n8, b, 100);
95 printf("Recuperado : %s\n", b);