Files @ e166f7bf8ca0
Branch filter:

Location: DistRen/src/server/mysql.h

ethanzonca
Initial libarchive implementation of unpackJob
/*
  Copyright 2009 Nathan Phillip Brink, Ethan Zonca, Matthew Orlando

  This file is a part of DistRen.

  DistRen is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  DistRen is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  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/>.

*/


#ifndef MYSQL_H_
#define MYSQL_H_

#include "distrenjob.h"

#include <stdint.h>

struct distrend_mysql_conn;
struct distrend_mysql_result;

typedef struct distrend_mysql_conn *distrend_mysql_conn_t;
typedef struct distrend_mysql_result *distrend_mysql_result_t;

/**
   initiates a MySQL connection
   @param conn, pointer will be set to the struct
   @return 0 on success
 */
int mysqlConnect(distrend_mysql_conn_t *conn);

/**
   cleans and disconnects MySQL connection
   @param conn connection to clean
   @return 0 on success
*/
int mysqlDisconnect(distrend_mysql_conn_t conn);

/**
   Mark a frame as finished in the database and calculate the seconds spent on that frame.
 */
void finish_frame(distrend_mysql_conn_t conn, int32_t slavekey, int32_t jobkey, int32_t framenum);

/**
   Mark a frame as started in the database and save the time at which it started.
 */
void start_frame(distrend_mysql_conn_t conn, int32_t slavekey, int32_t jobkey, int32_t framenum);

/**
   Changes the priority of an existing (and maybe running) job. @arg head I may end up changing the head if job == head
*/
int change_job_priority(distrend_mysql_conn_t conn, int32_t jobkey, int32_t newpriority);

/**
  Frame Finder: Finds a frame for a slave to render
*/
int find_jobframe(distrend_mysql_conn_t conn, int32_t slaveKey, jobnum_t *jobKey, int32_t *frameNum);

/**
  Slave Authenticator: Checks to see if a slave's ID and password match
*/
int auth_slave(distrend_mysql_conn_t conn, int32_t slavekey, int32_t slavepass);


#endif /* MYSQL_H_ */