Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00032 #ifndef KM_MY_CON_H
00033 #define KM_MY_CON_H
00034
00035 #include "../../lib/srdb1/db_pool.h"
00036 #include "../../lib/srdb1/db_id.h"
00037
00038 #include <time.h>
00039 #include <mysql/mysql.h>
00040
00041
00042 struct my_con {
00043 struct db_id* id;
00044 unsigned int ref;
00045 struct pool_con* next;
00047 MYSQL_RES* res;
00048 MYSQL* con;
00049 MYSQL_ROW row;
00050 time_t timestamp;
00051 };
00052
00053
00054
00055
00056
00057 #define CON_RESULT(db_con) (((struct my_con*)((db_con)->tail))->res)
00058 #define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con)
00059 #define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row)
00060 #define CON_TIMESTAMP(db_con) (((struct my_con*)((db_con)->tail))->timestamp)
00061
00062
00067 struct my_con* db_mysql_new_connection(const struct db_id* id);
00068
00069
00073 void db_mysql_free_connection(struct pool_con* con);
00074
00075 #endif