Changeset - d6d0d0d26d0b
[Not reviewed]
default
0 5 0
Nathan Brink (binki) - 16 years ago 2009-11-27 13:00:57
ohnobinki@ohnopublishing.net
nuke global vars, order and fix #include-s
5 files changed with 25 insertions and 28 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -17,28 +17,28 @@
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
*/
 

	
 
/* This file contains the code which both processes (renders) jobs as a slave, and the code which distributes frames to slaves after receiving them from the client portion of the codebase. */
 

	
 
#include "asprintf.h"
 
#include "distrenjob.h"
 
#include "execio.h"
 
#include "listen.h"
 
#include "options.h"
 
#include "distrenjob.h"
 
#include "listen.h"
 
#include "protocol.h"
 
#include "slavefuncs.h"
 
#include "asprintf.h"
 

	
 
#include <confuse.h>
 
#include <malloc.h>
 
#include <stdio.h>
 
#include <stdlib.h>
 
#include <malloc.h>
 
#include <unistd.h>
 
#include <string.h>
 
#include <sys/stat.h>
 
#include <time.h>
 
#include <sys/stat.h>
 
#include <string.h>
 
#include <unistd.h>
 

	
 
#include <libxml/xmlmemory.h>
 
#include <libxml/parser.h>
 
#include <libxml/tree.h>
 
#include <libxml/encoding.h>
 
#include <libxml/xmlwriter.h>
 
@@ -59,13 +59,14 @@ struct general_info {
 
  unsigned long int total_priority_pieces;
 
} general_info;
 

	
 

	
 

	
 
/*
 
  internally defined funcs's prototypes @TODO: Make all functions nice and proper */
 
  internally defined funcs's prototypes @TODO: Make all functions nice and proper 
 
*/
 
void distrenjob_remove(struct distrenjob *head, struct distrenjob *bj);
 

	
 
struct distrenjob *distrenjob_get(struct distrenjob *head, jobnum_t jobnum);
 
void distrenjob_enqueue(struct distrenjob *head, struct distrenjob *job);
 
void mortition(struct distrenjob *head, struct distrenjob *job);
 
int makeJobDataXML(struct distrenjob *job);
 
@@ -74,18 +75,12 @@ int createQueueFromXML(struct distrenjob
 
int reCreateQueueFromXML(struct distrenjob *head, xmlDocPtr doc, xmlNodePtr current);
 
void updateGeneralInfo();
 
void importGeneralInfo();
 
int updateJobStatsXML(struct distrenjob *job);
 

	
 

	
 
/* Global Vars, eliminate these */
 
jobnum_t jobnum = 0; // The next job number to create in the queue
 
int hcfjob; // Highest consecutively finished job
 
int highest_jobnum; // The job number of the most recently created job, this is used when creating new jobs
 

	
 

	
 
/* ********************** Functions ************************* */
 

	
 
/** Dumps all data in RAM to an xml file (such as current jobs, etc) which is parsed by start_data. Remember to invoke this before shutting down! */
 
int xml_dump()
 
{
 
  return 0;
 
@@ -143,13 +138,13 @@ int start_data(struct distrenjob *head, 
 
}
 

	
 
/** Finish-Setter: Sets a frame to the "completed" status.*/
 
void finish_frame(struct distrenjob *head, struct distrenjob *distrenjob, int frame)
 
{
 
  distrenjob->frameset[frame].status = FRAMESETSTATUS_DONE;
 
  distrenjob->total_render_time = distrenjob->total_render_time + (clock() - distrenjob[jobnum].frameset[frame].start_time);
 
  distrenjob->total_render_time = distrenjob->total_render_time + (clock() - distrenjob->frameset[frame].start_time);
 
  distrenjob->completed_frames++;
 
  distrenjob->assigned_frames--;
 
  general_info.total_frames_rendered++; // Increase total frames var for stats
 

	
 
  updateGeneralInfo();
 
  updateJobStatsXML(distrenjob);
src/server/distrenjob.c
Show inline comments
 
@@ -13,18 +13,19 @@
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#include "asprintf.h"
 
#include "distrenjob.h"
 
#include "slavefuncs.h"
 
#include "asprintf.h"
 

	
 
#include <libxml/parser.h>
 
#include <libxml/tree.h>
 
#include <libxml/parser.h>
 

	
 
void distrenjob_free(struct distrenjob **distrenjob)
 
{
 
  struct distrenjob *dj;
 

	
 
  dj = *distrenjob;
src/server/slave.c
Show inline comments
 
@@ -15,23 +15,23 @@
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
*/
 

	
 
#include "asprintf.h"
 
#include "protocol.h"
 
#include "options.h"
 
#include "remoteio.h"
 
#include "slavefuncs.h"
 
#include "asprintf.h"
 
#include "remoteio.h"
 

	
 
#include <stdio.h>
 
#include <stdlib.h>
 
#include <string.h>
 
#include <stdio.h>
 
#include <sys/stat.h>
 
#include <unistd.h>
 
#include <sys/stat.h>
 
#include <stdlib.h>
 

	
 
int main(int argc, char *argv[])
 
{
 

	
 
  int counter;
 

	
src/server/slavefuncs.c
Show inline comments
 
@@ -14,21 +14,21 @@
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#include "protocol.h"
 
#include "asprintf.h"
 
#include "slavefuncs.h"
 
#include "distrenjob.h"
 
#include "execio.h"
 
#include "protocol.h"
 
#include "slavefuncs.h"
 

	
 
#include <curl/curl.h>
 
#include <curl/easy.h>
 
#include <curl/types.h>
 
#include <curl/easy.h>
 

	
 
#include <stdio.h>
 
#include <string.h>
 
#include <unistd.h>
 
#include <stdlib.h>
 
#include <sys/stat.h>
src/server/user_mgr.c
Show inline comments
 
@@ -14,19 +14,20 @@
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#include "user_mgr.h"
 
#include "malloc.h"
 
#include <string.h>
 
#include <malloc.h>
 
#include <stdio.h>
 
#include <stdlib.h>
 
#include <string.h>
 
#include <unistd.h>
 

	
 
#include "user_mgr.h"
 

	
 
struct user_mgr_info
 
{
 
	struct user *user_array;
 
	int current_users;
 
	int user_array_size;
 
} user_mgr_info;
0 comments (0 inline, 0 general)