-/* save to file --> send to server :) --> T O D O <-- */
-void send_data(int signum) {
-
- int c;
-
- c=gd3_l->max_x*gd3_l->max_y*gd3_l->max_z;
-
- network_send(gnet->connection[0].fd,&dc,1);
- network_send(gnet->connection[0].fd,(unsigned char *)gd3_l,
- sizeof(d3_lattice));
- network_send(gnet->connection[0].fd,(unsigned char *)gmy_info,sizeof(info));
- network_send(gnet->connection[0].fd,gd3_l->status,c*sizeof(unsigned char));
- network_send(gnet->connection[0].fd,(unsigned char *)gd3_l->extra,
- c*sizeof(int));
- network_send(gnet->connection[0].fd,(unsigned char *)gi,sizeof(int));
-
-}
-
-int save_to_file(char *sf,d3_lattice *d3_l,info *my_inf)
-{
- int sf_fd,c;
-
- if((sf_fd=open(sf,O_WRONLY|O_CREAT))<0)
- {
- puts("cannot open save file");
- return -1;
- }
- if(write(sf_fd,d3_l,sizeof(d3_lattice))<sizeof(d3_lattice))
- {
- puts("failed saving d3 lattice struct");
- return -1;
- }
- if(write(sf_fd,my_inf,sizeof(info))<sizeof(info))
- {
- puts("failed saving info struct");
- return-1;
- }
- c=d3_l->max_x*d3_l->max_y*d3_l->max_z;
- if(write(sf_fd,d3_l->status,c*sizeof(unsigned char))<c*sizeof(unsigned char))
- {
- puts("failed saving status of d3 lattice sites");
- return -1;
- }
- if(write(sf_fd,d3_l->extra,c*sizeof(int))<c*sizeof(int))
- {
- puts("failed saving sites concentration");
- return -1;
- }
- close(sf_fd);
-
- return 1;
-}
-