Changeset - befcc7fbb765
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-10-10 01:31:56

completed start_data() function
1 file changed with 8 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -75,12 +75,13 @@ void distrenjob_enqueue(struct distrenjo
 
void mortition(struct distrenjob *head, struct distrenjob *job);
 
int makeJobDataXML(struct distrenjob *job);
 
int updateJobListXML(struct distrenjob *head);
 
int createQueueFromXML(struct distrenjob *head);
 
int reCreateQueueFromXML(struct distrenjob *head, xmlDocPtr doc, xmlNodePtr current);
 
void updateGeneralInfo();
 
void importGeneralInfo();
 

	
 
/* Global Vars, eliminate these */
 
jobnum_t jobnum = 0; // The next job number to create in the queue
 
int hcfjob; // Highest consecutively finished job
 
int highest_jobnum; // The job number of the most recently created job, this is used when creating new jobs
 

	
 
@@ -135,25 +136,28 @@ void remotio_send_to_client()
 
	// I am futile!
 
}
 

	
 
/** Fill variables after crash / shutdown from XML dumps */
 
int start_data(struct distrenjob *head)
 
{
 
  general_info.hibernate = 0;
 
  struct stat buffer;
 
  if(stat(SYSCONFDIR "/data.xml", &buffer) == 0){
 

	
 
    // @TODO: retrieve total_finished_jobs and total_finished_frames from xml file
 
  if(stat("general_info.xml", &buffer) == 0){
 
    importGeneralInfo();
 

	
 
    fprintf(stderr,"Parsing XML files and restoring previous state...\n");
 
    createQueueFromXML(head);
 
    return 1;
 
  }
 
  else{
 
    general_info.total_finished_jobs = 0;
 
    general_info.total_frames_rendered = 0;
 
    general_info.free_clients = 0;
 
    general_info.highest_jobnum = 0;
 
    general_info.jobs_in_queue = 0;
 
    general_info.rendering_clients = 0;
 
    general_info.hibernate = 0;
 
    fprintf(stderr,"Couldn't find XML dump, starting up fresh.\n");
 
    return 2;
 
  }
 
}
 

	
 
/** Finish-Setter: Sets a frame to the "completed" status.*/
0 comments (0 inline, 0 general)