+void *procesar_guardar_articulo(t_Articulo *src, int *size, t_LstArticulos *lst)
+{
+ char *tmp=NULL;
+ int i[6];
+ switch(lst->fp->tipo) {
+ case T1:
+ case T2:
+ /* Calculo el tamaño que voy a necesitar */
+ i[0] = sizeof(unsigned int);
+ i[1] = sizeof(char)*(strlen(src->desc)+1);
+ i[2] = sizeof(char)*(strlen(src->presentacion)+1);
+ i[3] = sizeof(char)*(strlen(src->existencia)+1);
+/* i[4] = sizeof(char)*(strlen(src->ubicacion)+1); */
+ i[4] = sizeof(char)*(strlen(src->pvu)+1);
+ i[5] = sizeof(char)*(strlen(src->emin)+1);
+ (*size) = i[0]+i[1]+i[2]+i[3]+i[4]+i[5];
+ tmp = (char *)malloc((*size));
+ if (tmp == NULL) return NULL;
+ memcpy(tmp, &src->numero, i[0]);
+ memcpy(tmp+i[0], src->desc, i[1]);
+ memcpy(tmp+i[0]+i[1], src->presentacion, i[2]);
+ memcpy(tmp+i[0]+i[1]+i[2], src->existencia, i[3]);
+ memcpy(tmp+i[0]+i[1]+i[2]+i[3], src->pvu, i[4]);
+ memcpy(tmp+i[0]+i[1]+i[2]+i[3]+i[4], src->emin, i[5]);
+ break;
+ case T3:
+ tmp = (char *)malloc(sizeof(t_Articulo));
+ if (tmp == NULL) return NULL;
+ memcpy(tmp, src, sizeof(t_Articulo));
+ (*size) = sizeof(t_Articulo);
+ }
+ return tmp;
+}
+