Changeset - 0deae41fe011
[Not reviewed]
default
0 2 0
ethanzonca - 16 years ago 2009-07-27 17:43:04

Updated funtion proto, uncommented the conf replacer's decl.
2 files changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -99,40 +99,42 @@ void loginuser(char *username){
 
  buf[9] = '\0'; // null-terminating the array...
 
  while(!execio_read(testrem, buf, 9, &readlen)) // What's with the readlen stuff?
 
    {
 
      if(readlen > 9) {
 
	fprintf(stderr, "!!!! Something is terribly wrong!\n");
 
      }
 
    buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is?
 
    fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 
}
 

	
 
/* Replaces username and key in the slave's conf file, currently pseudo, add to .h!!! */
 
/*
 
/* Replaces username and key in the slave's conf file, currently pseudo */
 

	
 
void conf_replace(char *username, char *key){
 
	// Doesn't delete anything! :D
 
/*
 
	mktemp(); // Gets a new file to put data into
 
	fopen('w'); // Open the file we created in write mode
 
	fopen('r'); // Open the conf file in read-only mode
 
	read(); // Read the created file, scanning for and replacing strings, whie
 
	writ(); // writing out to the newly created file
 
	fsync(); // fsync the file we wrote data to
 
	rename(); // rename the old file to the new file
 
*/
 
}
 
*/
 

	
 

	
 
/* Executors */
 

	
 
/*
 
  It seems that the client will need to know the job number. Is finish_frame going to be on the client or the server? we gotta figure that out!
 
  It seems that the client will need to know the job number. fixme.
 
*/
 

	
 
void exec_blender(struct blendjob* blendjob, char *input, char *output, int frame)
 
{
 
  char *frame_str;
 
  asprintf(frame,frame_str); // GNU/*nix compatible only, fix before releasing win32, although dll for windows for asprintf exists!
 
  int ret;
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-f", frame_str, (char *)0 };
 
  ret = execv("/usr/bin/blender", cmd); // This path will be absolute for testing, should be relative to install on production
 
}
src/server/slavefuncs.h
Show inline comments
 
@@ -15,16 +15,17 @@
 

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

	
 
#ifndef _DISTREN_SLAVEFUNCS_H
 
#define _DISTREN_SLAVEFUNCS_H
 
#include "blendjob.h"
 

	
 
void ssh_keygen();
 
void registeruser(char *username, char *email);
 
void loginuser(char *username);
 
void conf_replace(char *username, char *key);
 
void exec_blender(struct blendjob* blendjob, char *input, char *output, int frame);
 

	
 

	
 
#endif
0 comments (0 inline, 0 general)