Changeset - 9c2a6fb89ff2
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-10-09 14:52:35

fixed warnings and started a new function
1 file changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -70,12 +70,14 @@ struct general_info {
 
  internally defined funcs's prototypes @TODO: Make all functions nice and proper */
 
void distrenjob_remove(struct distrenjob *head, struct distrenjob *bj);
 

	
 
struct distrenjob *distrenjob_get(struct distrenjob *head, jobnum_t jobnum);
 
void distrenjob_enqueue(struct distrenjob *head, struct distrenjob *job);
 
void mortition(struct distrenjob *head, struct distrenjob *job);
 
int reCreateQueueFromXML(struct distrenjob *head, xmlDocPtr doc, xmlNodePtr current);
 

	
 

	
 
/* 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
 

	
 
@@ -507,12 +509,19 @@ int makeSlaveDataXML(struct distrenjob *
 
  // free writer and save xml file to disk
 
  xmlFreeTextWriter(writer);
 

	
 
  return 1;
 
}
 

	
 
// extracts data from the xml created by above function and creates a job from it
 
// it returns a pointer to the created job
 
void createJobFromXML(int job_number)
 
{
 

	
 
}
 

	
 
// returns 1 if successful
 
// updates job_list.xml which lists all the jobs in the queue
 
int updateJobListXML(struct distrenjob *head)
 
{
 
  struct distrenjob *job;
 
  xmlTextWriterPtr writer;
 
@@ -549,13 +558,12 @@ int updateJobListXML(struct distrenjob *
 

	
 
// returns 1 if completed successfully, 0 if not
 
// this reads a list of jobs in the queue before DistRen was shut down
 
// and then adds the jobs to the queue, as if it were never shut down
 
int createQueueFromXML(struct distrenjob *head)
 
{
 
  xmlChar *tmp;
 
  xmlDocPtr doc;  // holds xml document in memory
 
  xmlNodePtr cur; // points to the current xml element node
 

	
 
  // load xml document
 
  doc = xmlParseFile("job_list.xml");
 
  if(doc == NULL)
 
@@ -577,13 +585,13 @@ int createQueueFromXML(struct distrenjob
 
      fprintf(stderr, "createQueueFromXML: incorrect root element (%s)", (char*)cur->name);
 
    }
 

	
 
  // moves into the children elements of job_list
 
  cur = cur->xmlChildrenNode;
 

	
 
  reCreateQueueFromXML(doc, cur);
 
  reCreateQueueFromXML(head, doc, cur);
 
  /* scans the list of all jobs that were in queue before DistRen shutdown
 
  while(cur != NULL)
 
    {
 
      tmp = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 
      fprintf(stderr, "adding job: %s", tmp);
 
      // add job from job number @TODO create function with parameters (struct distrenjob *head, int job_number)
0 comments (0 inline, 0 general)