Changeset - ee9022e568b8
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-06-25 19:10:36

Fixed a few errors in the sludge.
1 file changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/client/distren.c
Show inline comments
 
@@ -167,39 +167,42 @@ int main(int argc, char *argv[])
 
      }
 
    execio_close(testrem);
 
    */
 
  // Can we prune off some of this code up here^? I'm not exactly sure how execio returns output, but it seems like more could be happening in execio itself, and less happening where it is actually called.
 
  // We need some code to ssh, and if the SSH fails, tell the user to register.
 
  // 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
 

	
 
// Vars to fill:
 
    int os=1;
 
    unsigned int frame_to_render; // initialize this somewhere else...
 
    frame_to_render = 10; // temporary, the number 10 will be replaced with a function call
 
    char *filename;
 

	
 

	
 
    if(os == 1){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 */
 
     size_t blenderstrlen;
 

	
 
     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.
 
     // 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);
 
     char *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)