+int add_job(t_net *net,int chan,t_list *jl) {
+
+ t_job job;
+
+ job.channel=-1;
+ job.status=IN_QUEUE;
+ job.progress=0;
+
+ network_receive_chan(net,chan,(unsigned char *)&(job.x),sizeof(int));
+ network_receive_chan(net,chan,(unsigned char *)&(job.y),sizeof(int));
+ network_receive_chan(net,chan,(unsigned char *)&(job.z),sizeof(int));
+ network_receive_chan(net,chan,(unsigned char *)&(job.info),sizeof(info));
+
+ job.size=job.x*job.y*job.z;
+
+ job.ac=(unsigned char *)malloc(job.size*sizeof(unsigned char));
+ if(job.ac==NULL) {
+ printf("unable to malloc a/c memory\n");
+ return -1;
+ }
+
+ job.cc=(int *)malloc(job.size*sizeof(int));
+ if(job.cc==NULL) {
+ printf("unable to malloc cc memory\n");
+ return -1;
+ }
+
+ job.step=0;
+
+ list_add_element(jl,&job,sizeof(t_job));
+
+ return 1;
+}
+
+int send_status(t_net *net,int chan,t_list *jl) {
+
+ unsigned char data;
+ int count;
+ int i;
+
+ data=GUI_INFO;
+ count=list_count(jl);
+
+ network_send_chan(net,chan,&data,sizeof(unsigned char));
+ network_send_chan(net,chan,(unsigned char *)&count,sizeof(int));
+
+ list_reset(jl);
+ for(i=0;i<count;i++) {
+ network_send_chan(net,chan,jl->current->data,sizeof(t_job));
+ list_next(jl);
+ }
+
+ return 1;
+}
+
+int handle_node(t_net *net,t_event *event,
+ t_list *c_list,t_list *g_list,t_list *job) {