+void *procesar_guardar_articulo(t_Articulo *src, EMUFS_REG_SIZE *size, t_LstArticulos *lst)
+{
+ char *tmp=NULL;
+ int i[6];
+ char *from = (char *)src;
+ 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:
+ /* Lleno el lugar no ocupado de los strings con *, para que el ver
+ * registro se vea bien
+ */
+ 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);
+ tmp = (char *)malloc(sizeof(t_Articulo));
+ if (tmp == NULL) return NULL;
+ memcpy(tmp, from, i[0]);
+ memcpy(tmp+i[0], from+i[0], i[1]); memset(tmp+i[0]+i[1], '*', 51-i[1]);
+ memcpy(tmp+i[0]+51, from+i[0]+51, i[2]); memset(tmp+i[0]+51+i[2], '*', 31-i[2]);
+ memcpy(tmp+i[0]+82, from+i[0]+82, i[3]); memset(tmp+i[0]+82+i[3], '*', 9-i[3]);
+ memcpy(tmp+i[0]+91, from+i[0]+91, i[4]); memset(tmp+i[0]+91+i[4], '*', 9-i[4]);
+ memcpy(tmp+i[0]+100, from+i[0]+100, i[5]); memset(tmp+i[0]+100+i[5], '*', 9-i[5]);
+
+ (*size) = sizeof(t_Articulo);
+ }
+ return tmp;
+}
+