Changeset - 7a41ccaab4c9
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-10-01 01:21:36

changed up printJob and printFrame to require less parameters, and now printJob only passes a pointer to a frame to printFrame

create a loop in the main function to interact with the queue in order to test it... it still needs a bit of work though
1 file changed with 39 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -435,18 +435,17 @@ int distrend_config_free(struct distrend
 
  options_free(config->options);
 
  free(config);
 

	
 
  return 0;
 
}
 
/* ************************** Test Functions ************************* */
 
void printFrameInfo(struct distrenjob *head, struct distrenjob *job, int frame_num)
 
void printFrameInfo(struct frameset *frame)
 
{
 
  char *status = "";
 
  frame_num = frame_num - job->frameset[0].num;
 

	
 
  switch(job->frameset[frame_num].status)
 
  switch(frame->status)
 
  {
 
    case FRAMESETSTATUS_UNASSIGNED:
 
      _distren_asprintf(&status, "%s", "unassigned");
 
      break;
 
    case FRAMESETSTATUS_ASSIGNED:
 
      _distren_asprintf(&status, "%s", "assigned");
 
@@ -455,22 +454,22 @@ void printFrameInfo(struct distrenjob *h
 
      _distren_asprintf(&status, "%s", "completed");
 
      break;
 
    case FRAMESETSTATUS_CANCELED:
 
      _distren_asprintf(&status, "%s", "canceled");
 
  }
 

	
 
  printf("frame #: %d --> %s", frame_num, status);
 
  printf("frame #: %d --> %s", frame->num, status);
 
}
 

	
 
void printJob(struct distrenjob *head, struct distrenjob *job)
 
void printJob(struct distrenjob *job)
 
{
 
  int counter;
 
  printf("frame_num: status");
 
  for(counter = 0; counter < job->total_frames; counter++)
 
    {
 
      printFrameInfo(head, job, job->frameset[counter].num);
 
      printFrameInfo(&job->frameset[counter]);
 
    }
 
}
 

	
 
void printJobInfo(struct distrenjob *head, struct distrenjob *job)
 
{
 
  printf("type: %d", job->type);
 
@@ -533,12 +532,46 @@ int main(int argc, char *argv[])
 
  memset(&head, '\0', sizeof(struct distrenjob));
 

	
 
  start_data(); // Starts fresh or loads data from xml dump. Should we grab the return?
 

	
 
  distrend_do_config(argc, argv, &config);
 

	
 
  while(t==1)
 
  {
 
	  int command;
 
	  printf("1-->print all frames in a job");
 
	  printf("2-->examine certain job");
 
	  printf("3-->get a frame to render");
 
	  printf("4-->add a job");
 
	  printf("5-->delete a job");
 
	  printf("6-->exit menu");
 

	
 
	  command = scanf();
 

	
 
	  if(command == 6)
 
		  break;
 

	
 
	  switch(command)
 
	  {
 
	  case 1:
 
		  printf("job number:");
 
		  command = scanf();
 
		  printJob(distrenjob_get(head, command));
 
		  break;
 
	  case 2:
 

	
 
		  break;
 
	  case 3:
 
		  break;
 
	  case 4:
 
		  break;
 
	  case 5:
 
		  break;
 
	  }
 
  }
 

	
 
  distrend_listen(&listenset, config);
 
  /* This is called the "main loop" */
 
  while(cont)
 
    {
 
      struct distren_action *action;
 
      int clientsays = 0; /*< temporary example variable, will be replaced when we can handle messages */
0 comments (0 inline, 0 general)