/* 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 . */ #ifndef MYSQL_H_ #define MYSQL_H_ #include 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, int32_t jobKey, int32_t frameNum); #endif /* MYSQL_H_ */