Changeset - 03937b2315eb
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-06-25 18:57:43

Build-breaking goodness!
1 file changed with 33 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/client/distren.c
Show inline comments
 
@@ -123,10 +123,9 @@ int main(int argc, char *argv[])
 

	
 
  /* if these following lines fail, it'll be reported as a core dump ;-) */
 
  distren_job_free(distren_job);
 
  
 
  distren_free(distren);
 
  
 

	
 
// !!! Killed for now because I'm doing other randomness !!! //
 
  // Please find a better way of doing this :( you can't strcat multiple strings.. meh
 
  // use something like sprintf
 
  //char *username = cfg_getstr(cfg, "username");
 
@@ -135,6 +134,7 @@ int main(int argc, char *argv[])
 
  //strcat(username, hostname);
 

	
 
  // SSH's to client machine with the username speficied.
 
  /*
 
    char buf[10];
 
    struct execio *testrem;
 
    char *execargv[] =
 
@@ -152,6 +152,8 @@ int main(int argc, char *argv[])
 
    fprintf(stderr, "execio madness is occuring!");
 
    fprintf(stderr, "execio_open returns %d\n", execio_open(&testrem, "ssh", execargv));
 
    buf[9] = '\0';
 
*/
 

	
 
    /*
 
    while(!execio_read(testrem, buf, 9, &readlen))
 
      {
 
@@ -170,6 +172,35 @@ int main(int argc, char *argv[])
 
  // Killed the user reg code, as the php interface will take care of this. Although it should check for users...
 

	
 
  
 

	
 
  // ------------------------------
 
  // Ok, this is just to do something to keep distren aliveish... Kill if needed/wanted/meh'd. Borrowed some code from matt's blender.c
 

	
 
    // We need calls to populate os. This is pretty rudimentary. Should be moved to shared, or use bultin something. Change on compiletime?
 
    char *os = "nix";
 
    if(os == 'win32'){char *bin = 'blender.exe'}
 
    else{char *bin = 'blender'} // mac/*nix
 

	
 
    // Placeholders? figure out what the last one is...
 
    char *format = "%s -b \"%s\" -o %s -f %d -F JPEG -x 1",bin,input,output; /* the format string to pass to sprintf */
 

	
 
     unsigned int frame_to_render; // initialize this somewhere else...
 
     size_t blenderstrlen;
 
     frame_to_render = 10; // temporary, the number 10 will be replaced with a function call
 

	
 
// This seems pretty ridik. Just sayin'. We gotta switch this up.
 
     blenderstrlen = strlen(format) - 2 * 2 /* format string minus placeholders */ + strlen(filename) + intstrlen(frame_to_render) + 1 /* NULL terminator */;
 
     blendercmd = malloc(blenderstrlen);
 
     snprintf(blendercmd, blenderstrlen, format, filename, frame_to_render);
 

	
 
     fprintf(stderr, "will run job num. %d ``%s''\n",jobid,blendercmd);
 
     free(blendercmd);
 

	
 

	
 
  // -------------End cruddy code that will eventually compose blender.c-----------------
 

	
 

	
 

	
 
  return 0;
 
};
 

	
0 comments (0 inline, 0 general)