diff --git a/src/server/blendjob.h b/src/server/blendjob.h --- a/src/server/blendjob.h +++ b/src/server/blendjob.h @@ -25,7 +25,7 @@ This file stores the blendjob and frameset structs and prototypes for some functions to manipulate/use these. */ -#include /* clock_t */ +#include /* clock_t, time_t */ typedef unsigned int jobnum_t; @@ -36,16 +36,15 @@ struct blendjob { struct blendjob *next; /*< next will be NULL unless if there is another blendjob */ char *name; char *submitter; - char *email; + char *email; /*< This should be looked up based on the value of submitter, not stored in this struct */ jobnum_t jobnum; int priority; // 1 is lowest, 10 is highest, 0 means the job is done - int percent_done; + float percent_done; int completed_frames; // number of completed frames for stats/etc int assigned_frames; // number of assigned frames (that are not yet completed) for stats/etc int total_frames; // how many frames are in the animation for stats/etc (unassigned frames) - int avg_render_time; // average seconds it took to render a frame - unsigned int time_remaining; // estimated seconds remaining till render is complete (up to 49, 710 days) - // we can have the client computer convert it into days, hours, etc if they wish to view it + time_t avg_render_time; // average seconds it took to render a frame + time_t time_remaining; /*< estimated seconds remaining till render is complete (up to 49, 710 days) */ struct frameset *frameset; }; @@ -63,4 +62,31 @@ struct frameset { }; /* Frameset array is generated by status_report_generator() */ +/* +related functions +*/ + +/** + + @param distrenjob the address where we will store the pointer of a malloc()ed + distrenjob struct. + @param pathtoxml filename/pathname of the xml file to be read into a blendjob struct + */ +int xml2distrenjob(struct blendjob **distrenjob, char *pathtoxml); + +/** + support function for xml2distrenjob() to help cleaning up a + struct blendjob when it is incompletely initialized. + Also acts as a general-purpose struct distrenjob free()er ;-) + */ +void distrenjob_free(struct blendjob **distrenjob); + +/** + initializes an empty, pointless struct distrenjob. This + DOES run malloc() for you. It could return nonzero on error, + but there are no errors to have yet (except for nomem). This + sets all char* to NULL. + */ +int distrenjob_new(struct blendjob **distrenjob); + #endif