Changeset - 3fcf567f92be
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 16 years ago 2009-05-23 21:24:29
ohnobinki@ohnopublishing.net
added distren_job_retrieve_file
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/client/distren.c
Show inline comments
 
@@ -120,24 +120,26 @@ int main(int argc, char *argv[])
 
      return 1;
 
    }
 

	
 
  fprintf(stderr, "reading from %s\nwriting to %s\n", input, output);
 
  
 
  distren_init_mf(&distren, &malloc, &free);
 
  
 
  distren_submit_file(distren, &distren_job, input);
 
  
 
  distren_job_getid(distren_job, &jobid);
 
  fprintf(stdout, "jobid: %s\n", jobid);
 
  
 
  distren_job_retrieve_file(distren_job, output);
 

	
 
  distren_job_free(distren_job);
 
  
 
  distren_free(distren);
 
  
 

	
 
  // 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");
 
  //char *hostname = cfg_getstr(cfg, "hostname");
 
  //strcat(username, "@");
 
  //strcat(username, hostname);
 

	
src/client/distren.h
Show inline comments
 
@@ -51,24 +51,30 @@ int distren_init(distren_t *handle);
 
 @TODO create a stream-based interface
 
*/
 
int distren_submit_file(distren_t handle, distren_job_t *job, const char *filename);
 

	
 
/**
 
   Retrieve a job-ID that can be used to refer to the job after the client's process has recycled. Currently, this will be the only way to retrieve a job handle (a distren_job_t) and, consequently, the only way to retrieve a finished render.
 
   A job ID is representable using a character string. Hopefully, they will be kept at a reasonably small length. It should be made up of alphanumeric characters so as to be useful in most situations. 
 
   @param jobid This will be set to a string allocated by the specified malloc implementation
 
   @param job The distren_job_t from which to retrieve a jobid
 
*/
 
int distren_job_getid(distren_job_t job, char **jobid);
 

	
 
/**
 
   Retrieves a tarball of a rendering's result.
 
   @param outfile Filename to save the result to
 
 */
 
int distren_job_retrieve_file(distren_job_t job, const char *outfile);
 

	
 
/*
 
 TODO: extraction of a job-ID, retrieving job handle by job-ID, getting information
 
 for a job handle, retrieving results of a job, callbacks for progress (i.e., job_is_finished callback)
 
 -- threads?
 
*/
 

	
 
/**
 
 Destroys and frees a job handle
 
*/
 
int distren_job_free(distren_job_t job);
 

	
 
/**
0 comments (0 inline, 0 general)