Changeset - b31adf3243b9
[Not reviewed]
default
0 1 0
ethanzonca@localhost.localdomain - 16 years ago 2009-03-31 18:29:10
ethanzonca@localhost.localdomain
Let's break a build! Ohnobinki should update stuff so this doesn't break...
1 file changed with 37 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -18,6 +18,9 @@
 

	
 
*/
 

	
 
#include <my_global.h> /* This provides windows compat too */
 
#include <my_sys.h>
 
#include <mysql.h>
 
#include <stdio.h>
 

	
 

	
 
@@ -34,7 +37,8 @@
 
 * Notes from IRCness:
 
 * Server<==>Client Communication
 
 * Job initiation:  	<jobnumber> <jobtype={blender,povray,indigo,etc}> <filename> <args specific to the jobtype>
 
 * Job addition : 		<jobnumber> <alteration: could be (cancel):cancel job (frames):tell the client to render more frames>
 
 * Job addition : 		<jobnumber> <alteration: could be (cancel):cancel job (frames):tell the client to render more 
 
frames>
 
 * Client Control: 		system <command> (such as drop all jobs, shutdown client, etc)
 
 *
 
 *  blender_getframecount()
 
@@ -46,13 +50,44 @@
 
 */
 

	
 

	
 
// Let's fix those global variable issues one of these days! :D test
 
// mySql configuration vars
 
static char *opt_host_name = "localhost";  // Server Hostname
 
static char *opt_user_name = "distren";    // Username
 
static char *opt_password = "008987";      // Password
 
static unsigned int opt_port_num = 0;      // Port (or builtin if 0)
 
static char *opt_socket_name = NULL;       // Socket Name (or builtin if null)
 
static char *opt_db_name = "distrend";     // Database name
 
static unsigned int opt_flags = 0;         // Connection flags, what are these for?
 
static MYSQL *conn;                        // Pointer to the connection handler
 

	
 

	
 

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

	
 

	
 
// It's a happy fun mySQL party! This just test-connects to the server and does absolutely nothing else. Hopefully.
 

	
 
	/* initialize connection handler */
 
	conn = mysql_init (NULL);
 
	if (conn == NULL)
 
	{
 
	    fprintf (stderr, "mysql_init() failed (probably out of memory)\n");
 
	    exit (1);
 
	}
 
	/* connect to server */
 
	if (mysql_real_connect (conn, opt_host_name, opt_user_name, opt_password,
 
	        opt_db_name, opt_port_num, opt_socket_name, opt_flags) == NULL)
 
	{
 
	    fprintf (stderr, "mysql_real_connect() failed\n");
 
	    mysql_close (conn);
 
	    exit (1);
 
	}
 
	/* disconnect from server */
 
	mysql_close (conn);
 

	
 

	
 
  return 0;
 
}
 

	
 
\
0 comments (0 inline, 0 general)