Added new features to the MyDDAS Interface, including some statistical support
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1483 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
fa03c540ce
commit
53b4a0e8f6
@ -113,43 +113,66 @@ c_db_my_query(void) {
|
||||
|
||||
int length=strlen(sql);
|
||||
|
||||
/* Measure time spent by the MySQL Server
|
||||
processing the SQL Query */
|
||||
#ifdef MYDDAS_STATS
|
||||
unsigned long start,end,total_time;
|
||||
/* Measure time spent by the MySQL Server
|
||||
processing the SQL Query */
|
||||
unsigned long start,end,total_time,last_time;
|
||||
start = myddas_current_time();
|
||||
#endif
|
||||
|
||||
/* executar a query SQL */
|
||||
if (mysql_real_query(conn, sql, length) != 0)
|
||||
{
|
||||
printf("Erro na query!\n");
|
||||
#ifdef DEBUG
|
||||
printf("Erro na query! %s\n",sql);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
/* Measure time spent by the MySQL Server
|
||||
processing the SQL Query */
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Measure time spent by the MySQL Server
|
||||
processing the SQL Query */
|
||||
end = myddas_current_time();
|
||||
|
||||
MYDDAS_UTIL_CONNECTION node = myddas_util_search_connection(conn);
|
||||
total_time = (end-start) + myddas_util_get_conn_total_time_DBServer(node);
|
||||
last_time = (end-start);
|
||||
total_time = last_time + myddas_util_get_conn_total_time_DBServer(node);
|
||||
|
||||
myddas_util_set_conn_last_time_DBServer(node,last_time);
|
||||
myddas_util_set_conn_total_time_DBServer(node,total_time);
|
||||
#endif
|
||||
|
||||
|
||||
/* guardar os tuplos do lado do cliente */
|
||||
if (strcmp(mode,"store_result")!=0) //Verdadeiro
|
||||
res_set = mysql_use_result(conn);
|
||||
else{
|
||||
/* */
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Measure time spent by the MySQL Server
|
||||
transferring the result of the last query
|
||||
back to the client */
|
||||
start = myddas_current_time();
|
||||
#endif
|
||||
res_set = mysql_store_result(conn);
|
||||
#ifdef MYDDAS_STATS
|
||||
/* With an INSERT statement,
|
||||
mysql_(use or store)_result() returns
|
||||
a NULL pointer*/
|
||||
/* Measure time spent by the MySQL Server
|
||||
transferring the result of the last query
|
||||
back to the client */
|
||||
end = myddas_current_time();
|
||||
|
||||
node = myddas_util_search_connection(conn);
|
||||
last_time = (end-start);
|
||||
total_time = last_time + myddas_util_get_conn_total_transfering_from_DBServer(node);
|
||||
|
||||
myddas_util_set_conn_last_transfering_from_DBServer(node,last_time);
|
||||
myddas_util_set_conn_total_transfering_from_DBServer(node,total_time);
|
||||
|
||||
/* Measure the number of Rows returned from the server */
|
||||
if (res_set != NULL)
|
||||
{
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
myddas_util_search_connection(conn);
|
||||
/* With an INSERT statement, mysql_(use or store)_result()
|
||||
returns a NULL pointer*/
|
||||
node = myddas_util_search_connection(conn);
|
||||
|
||||
/* This is only works if we use mysql_store_result */
|
||||
unsigned long numberRows = mysql_num_rows(res_set);
|
||||
@ -159,7 +182,6 @@ c_db_my_query(void) {
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (res_set == NULL)
|
||||
{
|
||||
//INSERT statements don't return any res_set
|
||||
@ -198,8 +220,9 @@ c_db_my_number_of_fields(void) {
|
||||
/* executar a query SQL */
|
||||
if (mysql_query(conn, sql) != 0)
|
||||
{
|
||||
|
||||
printf("Erro na query!\n");
|
||||
#ifdef DEBUG
|
||||
printf("Erro na query! %s\n",sql);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -239,7 +262,9 @@ c_db_my_get_attributes_types(void) {
|
||||
/* executar a query SQL */
|
||||
if (mysql_query(conn, sql) != 0)
|
||||
{
|
||||
printf("Erro na query!\n");
|
||||
#ifdef DEBUG
|
||||
printf("Erro na query! %s\n",sql);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
/* guardar os tuplos do lado do cliente */
|
||||
@ -379,6 +404,12 @@ c_db_my_row_cut(void) {
|
||||
/* db_row: ResultSet x Arity_ListOfArgs x ListOfArgs -> */
|
||||
static int
|
||||
c_db_my_row(void) {
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Measure time used by the
|
||||
c_db_my_row function */
|
||||
unsigned long start,end,total_time,last_time;
|
||||
start = myddas_current_time();
|
||||
#endif
|
||||
Term arg_result_set = Deref(ARG1);
|
||||
Term arg_arity = Deref(ARG2);
|
||||
Term arg_list_args = Deref(ARG3);
|
||||
@ -433,12 +464,28 @@ c_db_my_row(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef MYDDAS_STATS
|
||||
end = myddas_current_time();
|
||||
|
||||
last_time = (end-start);
|
||||
total_time = last_time + myddas_util_get_total_db_row_function();
|
||||
|
||||
myddas_util_set_total_db_row_function(total_time);
|
||||
#endif /* MYDDAS_STATS */
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mysql_free_result(res_set);
|
||||
cut_fail();
|
||||
#ifdef MYDDAS_STATS
|
||||
end = myddas_current_time();
|
||||
|
||||
last_time = (end-start);
|
||||
total_time = last_time + myddas_util_get_total_db_row_function();
|
||||
|
||||
myddas_util_set_total_db_row_function(total_time);
|
||||
#endif /* MYDDAS_STATS */
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -461,7 +508,9 @@ c_db_my_number_of_fields_in_query(void) {
|
||||
/* executar a query SQL */
|
||||
if (mysql_query(conn, query) != 0)
|
||||
{
|
||||
printf("Erro na query!\n");
|
||||
#ifdef DEBUG
|
||||
printf("Erro na query! %s\n",query);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -502,7 +551,9 @@ c_db_my_get_fields_properties(void) {
|
||||
/* executar a query SQL */
|
||||
if (mysql_query(conn, sql) != 0)
|
||||
{
|
||||
printf("Erro na query!\n");
|
||||
#ifdef DEBUG
|
||||
printf("Erro na query! %s\n",sql);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -556,41 +607,6 @@ c_db_my_get_fields_properties(void) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
//Returns the stats of this module in a list
|
||||
|
||||
static int
|
||||
c_db_my_stats(void) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
Term arg_list = Deref(ARG2);
|
||||
|
||||
MYSQL *conn = (MYSQL *) (IntegerOfTerm(arg_conn));
|
||||
MYDDAS_UTIL_CONNECTION
|
||||
node = myddas_util_search_connection(conn);
|
||||
Term head, list;
|
||||
list = arg_list;
|
||||
|
||||
//[Index 1] -> Total Number of Rows by connection
|
||||
//Total number of Rows returned by the server
|
||||
//WARNING: only works with store_result
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
int totalRows = myddas_util_get_conn_total_rows(node);
|
||||
Yap_unify(head, MkIntegerTerm(totalRows));
|
||||
printf ("Total Number of Rows returned from the Server: %d\n",totalRows);
|
||||
|
||||
//[Index 2] -> Total Number of Rows by connection
|
||||
//Total number of Rows returned by the server
|
||||
//WARNING: only works with store_result
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
int totalTimeDBServer = myddas_util_get_conn_total_time_DBServer(node);
|
||||
Yap_unify(head, MkIntegerTerm(totalTimeDBServer));
|
||||
printf ("Total Time Spent by the Server: %d\n",totalTimeDBServer);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Yap_InitMYDDAS_MySQLPreds(void)
|
||||
{
|
||||
@ -617,12 +633,6 @@ void Yap_InitMYDDAS_MySQLPreds(void)
|
||||
|
||||
/* db_get_fields_properties: PredName x Connnection x PropertiesList*/
|
||||
Yap_InitCPred("c_db_my_get_fields_properties",3,c_db_my_get_fields_properties,0);
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
/* db_stats: Connection */
|
||||
Yap_InitCPred("c_db_my_stats",2, c_db_my_stats, 0);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Yap_InitBackMYDDAS_MySQLPreds(void)
|
||||
|
@ -15,10 +15,6 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
/* Problema colocar no configure uma forma de detctar se o mysql *
|
||||
* devel esta instalado*/
|
||||
|
||||
/* This flag should be deleted, and do this test, off including this file, which is depending on the flag "MYDDAS_MYSQL", on configure time */
|
||||
#if defined MYDDAS_ODBC && defined CUT_C
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -21,17 +21,61 @@
|
||||
#include "Yatom.h"
|
||||
#include "cut_c.h"
|
||||
#include "myddas_util.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
STATIC_PROTO(int c_db_get_new_table_name,(void));
|
||||
STATIC_PROTO(int c_db_connection_type,(void));
|
||||
STATIC_PROTO(int c_db_add_preds,(void));
|
||||
STATIC_PROTO(int c_db_preds_conn_start ,(void));
|
||||
STATIC_PROTO(int c_db_preds_conn_continue ,(void));
|
||||
STATIC_PROTO(int c_db_add_preds,(void));
|
||||
STATIC_PROTO(int c_db_check_if_exists_pred,(void));
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
STATIC_PROTO(int c_db_stats,(void));
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
STATIC_PROTO(int c_db_check,(void));
|
||||
#endif
|
||||
|
||||
/* c_db_get_new_table_name: -TableName */
|
||||
static int
|
||||
c_db_get_new_table_name (void){
|
||||
Term arg_con = Deref(ARG1);
|
||||
Term arg_name = Deref(ARG2);
|
||||
|
||||
int *con = (int *) IntegerOfTerm(arg_con);
|
||||
char *tableName = myddas_util_get_table_name(con);
|
||||
|
||||
Yap_unify(arg_name, MkAtomTerm(Yap_LookupAtom(tableName)));
|
||||
|
||||
free(tableName);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Gives the type of a given connection,
|
||||
in other words, type will be mysql or odbc
|
||||
|
||||
NOTE: In order to use this predicate, the connection*/
|
||||
/* c_db_connection_type: +Connection * ?Type */
|
||||
static int
|
||||
c_db_connection_type (void){
|
||||
Term arg_con = Deref(ARG1);
|
||||
Term arg_type = Deref(ARG2);
|
||||
|
||||
int *con = (int *) IntegerOfTerm(arg_con);
|
||||
short int type = myddas_util_connection_type(con);
|
||||
|
||||
if (type == 1) /* MYSQL Connection */
|
||||
Yap_unify(arg_type, MkAtomTerm(Yap_LookupAtom("mysql")));
|
||||
else if (type ==2) /* ODBC Connection */
|
||||
Yap_unify(arg_type, MkAtomTerm(Yap_LookupAtom("odbc")));
|
||||
else /* Not a valid connection*/
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* db_add_preds: PredName * Arity * Module * Connection*/
|
||||
static int
|
||||
@ -48,7 +92,9 @@ c_db_add_preds (void){
|
||||
|
||||
if (myddas_util_add_predicate(nome,aridade,module,conn) == NULL)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf ("ERRO : Nao consegui adicionar predicado\n");
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -77,8 +123,9 @@ c_db_check_if_exists_pred (void){
|
||||
static int
|
||||
c_db_preds_conn_start (void){
|
||||
Term arg_conn = Deref(ARG1);
|
||||
Term nome = Deref(ARG2);
|
||||
Term aridade = Deref(ARG3);
|
||||
Term module = Deref(ARG2);
|
||||
Term nome = Deref(ARG3);
|
||||
Term aridade = Deref(ARG4);
|
||||
|
||||
int *conn = (int *) IntegerOfTerm(arg_conn);
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
@ -92,9 +139,9 @@ c_db_preds_conn_start (void){
|
||||
}
|
||||
|
||||
void *pointer = myddas_util_get_list_pred(node);
|
||||
EXTRA_CBACK_ARG(3,1)=(CELL) MkIntegerTerm((int)pointer);
|
||||
EXTRA_CBACK_ARG(4,1)=(CELL) MkIntegerTerm((int)pointer);
|
||||
|
||||
if (IsVarTerm(nome) && IsVarTerm(aridade))
|
||||
if (IsVarTerm(nome) && IsVarTerm(aridade) && IsVarTerm(module))
|
||||
return (c_db_preds_conn_continue());
|
||||
|
||||
cut_fail();
|
||||
@ -104,18 +151,20 @@ c_db_preds_conn_start (void){
|
||||
/* db_preds_conn : Connection(+) * Pred_name(-) * Pred_arity*/
|
||||
static int
|
||||
c_db_preds_conn_continue (void){
|
||||
Term nome = Deref(ARG2);
|
||||
Term aridade = Deref(ARG3);
|
||||
Term module = Deref(ARG2);
|
||||
Term nome = Deref(ARG3);
|
||||
Term aridade = Deref(ARG4);
|
||||
|
||||
void *pointer;
|
||||
pointer = (void *) IntegerOfTerm(EXTRA_CBACK_ARG(3,1));
|
||||
pointer = (void *) IntegerOfTerm(EXTRA_CBACK_ARG(4,1));
|
||||
|
||||
if (pointer != NULL)
|
||||
{
|
||||
Yap_unify(module, MkAtomTerm(Yap_LookupAtom(myddas_util_get_pred_module(pointer))));
|
||||
Yap_unify(nome, MkAtomTerm(Yap_LookupAtom(myddas_util_get_pred_name(pointer))));
|
||||
Yap_unify(aridade, MkIntegerTerm((int)myddas_util_get_pred_arity(pointer)));
|
||||
|
||||
EXTRA_CBACK_ARG(3,1)=(CELL) MkIntegerTerm((int)myddas_util_get_pred_next(pointer));
|
||||
EXTRA_CBACK_ARG(4,1)=(CELL) MkIntegerTerm((int)myddas_util_get_pred_next(pointer));
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@ -125,6 +174,8 @@ c_db_preds_conn_continue (void){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
static int
|
||||
c_db_check(void){
|
||||
@ -133,14 +184,127 @@ c_db_check(void){
|
||||
}
|
||||
#endif /*DEBUG*/
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
//Returns the stats of this module in a list
|
||||
static int
|
||||
c_db_stats(void) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
Term arg_list = Deref(ARG2);
|
||||
|
||||
int *conn = (int *) (IntegerOfTerm(arg_conn));
|
||||
|
||||
//if (conn == 0) /* We want all the statistics */
|
||||
|
||||
|
||||
|
||||
MYDDAS_UTIL_CONNECTION
|
||||
node = myddas_util_search_connection(conn);
|
||||
Term head, list;
|
||||
list = arg_list;
|
||||
|
||||
//[Index 1] -> Total Number of Rows by connection
|
||||
//Total number of Rows returned by the server
|
||||
//WARNING: only works with store_result
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long totalRows = myddas_util_get_conn_total_rows(node);
|
||||
Yap_unify(head, MkIntegerTerm(totalRows));
|
||||
#ifdef DEBUG
|
||||
printf ("Total Number of Rows returned from the Server: %lu\n",totalRows);
|
||||
#endif
|
||||
|
||||
//[Index 2] -> Total of Time Spent by the DB Server
|
||||
// processing all the SQL Querys
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long totalTimeDBServer = myddas_util_get_conn_total_time_DBServer(node);
|
||||
Yap_unify(head, MkIntegerTerm(totalTimeDBServer));
|
||||
#ifdef DEBUG
|
||||
printf ("Time Spent by the Server, on all the SQL Querys: %lu\n",totalTimeDBServer);
|
||||
#endif
|
||||
|
||||
//[Index 3] -> Total of Time Spent by the DB Server
|
||||
// processing a the last SQL Query
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long lastTimeDBServer = myddas_util_get_conn_last_time_DBServer(node);
|
||||
Yap_unify(head, MkIntegerTerm(lastTimeDBServer));
|
||||
#ifdef DEBUG
|
||||
printf ("Time Spent by the Server, on the last SQL Query: %lu\n",lastTimeDBServer);
|
||||
#endif
|
||||
|
||||
//[Index 4] -> Total of Time Spent by the DB Server
|
||||
// transfering all the results of the SQL Querys
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long totalFromDBServer = myddas_util_get_conn_total_transfering_from_DBServer(node);
|
||||
Yap_unify(head, MkIntegerTerm(totalFromDBServer));
|
||||
#ifdef DEBUG
|
||||
printf ("Time Spent by the Server, transfering all the results SQL Query: %lu\n",totalFromDBServer);
|
||||
#endif
|
||||
|
||||
//[Index 5] -> Total of Time Spent by the DB Server
|
||||
// transfering the result of the last SQL Query
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long lastFromDBServer = myddas_util_get_conn_last_transfering_from_DBServer(node);
|
||||
Yap_unify(head, MkIntegerTerm(lastFromDBServer));
|
||||
#ifdef DEBUG
|
||||
printf ("Time Spent by the Server, transfering the result of the last SQL Query: %lu\n",lastFromDBServer);
|
||||
#endif
|
||||
|
||||
//[Index 6] -> Total of Time Spent by the
|
||||
// db_row_function
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
unsigned long db_row = myddas_util_get_total_db_row_function();
|
||||
Yap_unify(head, MkIntegerTerm(db_row));
|
||||
#ifdef DEBUG
|
||||
printf ("Time Spent by the db_row_function: %lu\n",db_row);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
|
||||
/* Function to delete all the temporary tables */
|
||||
/* from the mysql server */
|
||||
void Yap_MyDDAS_delete_all_myddas_structs(void)
|
||||
{
|
||||
//char *table_name;
|
||||
//char query[500];
|
||||
|
||||
/* NAO ESQUECER DE FAZER ISTO TB PARA O DB_CLOSE*/
|
||||
|
||||
/* for(;(table_name = myddas_util_delete_all_temp_table()) != NULL ;) { */
|
||||
/* printf ("%s\n",table_name); */
|
||||
/* sprintf (query,"DROP TABLE IF EXISTS %s",table_name); */
|
||||
/* printf ("%s\n",query); */
|
||||
/* free(table_name); */
|
||||
/* query[0]=0; */
|
||||
/* } */
|
||||
}
|
||||
|
||||
void Yap_InitMYDDAS_SharedPreds(void)
|
||||
{
|
||||
/* db_add_preds : PredName * Arity * Connection */
|
||||
|
||||
Yap_InitCPred("c_db_get_new_table_name",2,c_db_get_new_table_name, 0);
|
||||
|
||||
|
||||
Yap_InitCPred("c_db_connection_type",2,c_db_connection_type, 0);
|
||||
|
||||
/* CORRECT THIS: db_add_preds : PredName * Arity * Connection */
|
||||
Yap_InitCPred("c_db_add_preds",4,c_db_add_preds, 0);
|
||||
|
||||
/* db_check_if_exists_pred : PredName * Arity * Connection */
|
||||
Yap_InitCPred("c_db_check_if_exists_pred",3,c_db_check_if_exists_pred, 0);
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
/* db_stats: Connection * Stats*/
|
||||
Yap_InitCPred("c_db_stats",2, c_db_stats, 0);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
Yap_InitCPred("c_db_check",0, c_db_check, 0);
|
||||
@ -149,7 +313,7 @@ void Yap_InitMYDDAS_SharedPreds(void)
|
||||
|
||||
void Yap_InitBackMYDDAS_SharedPreds(void)
|
||||
{
|
||||
Yap_InitCPredBack("c_db_preds_conn", 3, sizeof(int),
|
||||
Yap_InitCPredBack("c_db_preds_conn", 4, sizeof(int),
|
||||
c_db_preds_conn_start,
|
||||
c_db_preds_conn_continue, 0);
|
||||
|
||||
|
71
MYDDAS/myddas_structs.h
Normal file
71
MYDDAS/myddas_structs.h
Normal file
@ -0,0 +1,71 @@
|
||||
#ifndef __MYDDAS_STRUCTS_H__
|
||||
#define __MYDDAS_STRUCTS_H__
|
||||
|
||||
struct myddas_global {
|
||||
MYDDAS_UTIL_CONNECTION myddas_top_connections;
|
||||
#ifdef MYDDAS_STATS
|
||||
MYDDAS_GLOBAL_STATS myddas_statistics;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct myddas_table_integers {
|
||||
unsigned int number;
|
||||
struct myddas_table_integers *next;
|
||||
};
|
||||
|
||||
struct myddas_temp_tables{
|
||||
struct myddas_table_integers *table_numbers;
|
||||
struct myddas_table_integers *last_number;
|
||||
char *default_table_name;
|
||||
};
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
/* This strucuture holds some global statistics*/
|
||||
struct myddas_global_stats {
|
||||
unsigned long total_db_row;
|
||||
};
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
struct list_preds {
|
||||
char *pred_module;
|
||||
char *pred_name;
|
||||
short pred_arity;
|
||||
struct list_preds *next;
|
||||
};
|
||||
|
||||
struct list_connection {
|
||||
void *connection;
|
||||
MYDDAS_TEMP_TABLES temporary_tables;
|
||||
|
||||
/*If variable env is NULL, then it's a
|
||||
MySQL connection, if not then it as the pointer
|
||||
to the ODBC enviromment variable */
|
||||
void *odbc_enviromment;
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Total number of Rows returnes from the DataBase Server */
|
||||
unsigned long totalNumberOfRows;
|
||||
|
||||
/* Total Time spent by the DataBase Server
|
||||
processing all querys */
|
||||
unsigned long totalTimeofDBServer;
|
||||
/* Time spent by the DataBase Server, processing
|
||||
the last query */
|
||||
unsigned long lastTimeofDBServer;
|
||||
|
||||
/* Total Time spent by the DataBase Server,
|
||||
transfering all the data to the client */
|
||||
unsigned long totalFromDBServer;
|
||||
/* Time spent by the DataBase Server,
|
||||
transfering the data of the last query */
|
||||
unsigned long lastFromDBServer;
|
||||
|
||||
/* Total Time spent on the db_row function */
|
||||
unsigned long total_db_row;
|
||||
#endif
|
||||
MYDDAS_UTIL_PREDICATE predicates;
|
||||
struct list_connection *next;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -5,36 +5,17 @@
|
||||
#include <stdlib.h>
|
||||
#include "cut_c.h"
|
||||
#include "myddas_util.h"
|
||||
#include "myddas_structs.h"
|
||||
#ifdef MYDDAS_ODBC
|
||||
#include <sql.h>
|
||||
#endif /*MYDDAS_ODBC*/
|
||||
#include "Yap.h"
|
||||
|
||||
static MYDDAS_GLOBAL MYDDAS_GLOBAL_STRUCT = NULL;
|
||||
|
||||
static MYDDAS_UTIL_CONNECTION MYDDAS_TOP = NULL;
|
||||
|
||||
struct list_preds {
|
||||
char *pred_module;
|
||||
char *pred_name;
|
||||
short pred_arity;
|
||||
struct list_preds *next;
|
||||
};
|
||||
|
||||
struct list_connection {
|
||||
void *connection;
|
||||
/*If variable env is NULL, then it's a
|
||||
MySQL connection, if not then it as the pointer
|
||||
to the ODBC enviromment variable*/
|
||||
void *odbc_enviromment;
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Time spent by the DataBase Server */
|
||||
unsigned long totalTimeofDBServer;
|
||||
unsigned long totalNumberOfRows;
|
||||
#endif
|
||||
MYDDAS_UTIL_PREDICATE predicates;
|
||||
struct list_connection *next;
|
||||
};
|
||||
|
||||
|
||||
/* Get's a new number for the temporary tables */
|
||||
static
|
||||
unsigned int myddas_util_get_table_number(MYDDAS_UTIL_CONNECTION);
|
||||
/* Prints a error message */
|
||||
static void
|
||||
myddas_util_error_message(char *,int,char *);
|
||||
@ -63,7 +44,7 @@ myddas_util_delete_predicate_list(MYDDAS_UTIL_PREDICATE);
|
||||
void check_int(){
|
||||
int i;
|
||||
MYDDAS_UTIL_PREDICATE pred = NULL;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_TOP;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
for (i=1 ; top!=NULL ; top=top->next)
|
||||
{
|
||||
printf ("***************\n");
|
||||
@ -115,14 +96,55 @@ myddas_util_set_conn_total_time_DBServer(MYDDAS_UTIL_CONNECTION node ,
|
||||
node->totalTimeofDBServer = totaltime;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_last_time_DBServer(MYDDAS_UTIL_CONNECTION node){
|
||||
return node->lastTimeofDBServer;
|
||||
}
|
||||
void
|
||||
myddas_util_set_conn_last_time_DBServer(MYDDAS_UTIL_CONNECTION node ,
|
||||
unsigned long lasttime){
|
||||
node->lastTimeofDBServer = lasttime;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_last_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION node){
|
||||
return node->lastFromDBServer;
|
||||
}
|
||||
void
|
||||
myddas_util_set_conn_last_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION node ,
|
||||
unsigned long lasttime){
|
||||
node->lastFromDBServer = lasttime;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_total_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION node){
|
||||
return node->totalFromDBServer;
|
||||
}
|
||||
void
|
||||
myddas_util_set_conn_total_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION node ,
|
||||
unsigned long totaltime){
|
||||
node->totalFromDBServer = totaltime;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_total_db_row_function(void){
|
||||
return MYDDAS_GLOBAL_STRUCT->myddas_statistics->total_db_row;
|
||||
}
|
||||
void
|
||||
myddas_util_set_total_db_row_function(unsigned long time){
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_statistics->total_db_row = time;
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
myddas_current_time(void) {
|
||||
/* to get time as Yap */
|
||||
/*
|
||||
double now, interval;
|
||||
cputime_interval(&now, &interval);
|
||||
return ((realtime)now);
|
||||
*/
|
||||
|
||||
Int now, interval;
|
||||
Yap_cputime_interval(&now, &interval);
|
||||
//return ((realtime)now);
|
||||
return (now);
|
||||
|
||||
/*Fine grained time
|
||||
tv_usec -> microseconds [0-999999]
|
||||
*/
|
||||
@ -133,15 +155,32 @@ myddas_current_time(void) {
|
||||
milliseconds -> s/1000
|
||||
microseconds -> s/1000000
|
||||
*/
|
||||
struct timeval tempo;
|
||||
if (!gettimeofday(&tempo, NULL))
|
||||
//returns time in microseconds
|
||||
return (tempo.tv_sec %1000)*1000000+tempo.tv_usec;
|
||||
/* struct timeval tempo; */
|
||||
/* if (!gettimeofday(&tempo, NULL)) */
|
||||
/* //returns time in microseconds */
|
||||
/* return (tempo.tv_sec %1000)*1000000+tempo.tv_usec; */
|
||||
/* //return (tempo.tv_sec %1000)*1000+tempo.tv_usec; */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
/* Type: MYSQL->1 ODBC->2*/
|
||||
short int
|
||||
myddas_util_connection_type(void *con){
|
||||
|
||||
MYDDAS_UTIL_CONNECTION con_node =
|
||||
myddas_util_search_connection(con);
|
||||
|
||||
if (con_node == NULL)
|
||||
return 0;
|
||||
|
||||
if (con_node->odbc_enviromment != NULL) /* ODBC */
|
||||
return 2;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
void *
|
||||
myddas_util_get_pred_next(void *pointer){
|
||||
@ -161,6 +200,12 @@ myddas_util_get_pred_name(void *pointer){
|
||||
return temp->pred_name;
|
||||
}
|
||||
|
||||
char *
|
||||
myddas_util_get_pred_module(void *pointer){
|
||||
MYDDAS_UTIL_PREDICATE temp = (MYDDAS_UTIL_PREDICATE) pointer;
|
||||
return temp->pred_module;
|
||||
}
|
||||
|
||||
void *
|
||||
myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION node){
|
||||
return (void *)(node->predicates);
|
||||
@ -170,7 +215,7 @@ MYDDAS_UTIL_PREDICATE
|
||||
myddas_util_search_predicate(char *pred_name, int pred_arity,
|
||||
char *pred_module){
|
||||
MYDDAS_UTIL_PREDICATE pred=NULL;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_TOP;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
|
||||
for (;top!=NULL;top=top->next)
|
||||
{
|
||||
@ -199,7 +244,7 @@ myddas_util_add_predicate(char *pred_name, int pred_arity,
|
||||
}
|
||||
|
||||
myddas_util_add_predicate_node(new,&(node_conn->predicates));
|
||||
|
||||
|
||||
return node_conn;
|
||||
}
|
||||
|
||||
@ -217,9 +262,9 @@ myddas_util_delete_connection(void *conn){
|
||||
/*Removes the predicates list*/
|
||||
myddas_util_delete_predicate_list(to_delete->predicates);
|
||||
|
||||
if (to_delete == MYDDAS_TOP)
|
||||
if (to_delete == MYDDAS_GLOBAL_STRUCT->myddas_top_connections)
|
||||
{
|
||||
MYDDAS_TOP= to_delete->next;
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_top_connections= to_delete->next;
|
||||
free(to_delete);
|
||||
return;
|
||||
}
|
||||
@ -236,8 +281,13 @@ myddas_util_delete_connection(void *conn){
|
||||
|
||||
MYDDAS_UTIL_CONNECTION
|
||||
myddas_util_search_connection(void *conn){
|
||||
MYDDAS_UTIL_CONNECTION list = MYDDAS_TOP;
|
||||
MYDDAS_UTIL_CONNECTION list = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
|
||||
if (conn == 0) { /* We want all the statistics */
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
for (;list!=NULL;list=list->next)
|
||||
if (list->connection == conn)
|
||||
return list;
|
||||
@ -250,33 +300,50 @@ myddas_util_add_connection(void *conn, void *enviromment){
|
||||
MYDDAS_UTIL_CONNECTION node=NULL;
|
||||
MYDDAS_UTIL_CONNECTION temp=NULL;
|
||||
|
||||
if (MYDDAS_GLOBAL_STRUCT == NULL)
|
||||
{
|
||||
MYDDAS_GLOBAL_STRUCT = (MYDDAS_GLOBAL) malloc (sizeof(struct myddas_global));
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_top_connections = NULL;
|
||||
#ifdef MYDDAS_STATS
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_statistics = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((node = myddas_util_search_connection(conn)) != NULL)
|
||||
{
|
||||
return node;
|
||||
}
|
||||
|
||||
if (MYDDAS_TOP!=NULL)
|
||||
if (MYDDAS_GLOBAL_STRUCT->myddas_top_connections!=NULL)
|
||||
{
|
||||
//put the new connection node on the top of the list
|
||||
temp = myddas_util_initialize_connection(conn,enviromment,MYDDAS_TOP);
|
||||
temp = myddas_util_initialize_connection(conn,enviromment,MYDDAS_GLOBAL_STRUCT->myddas_top_connections);
|
||||
if (temp == NULL)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
myddas_util_error_message("Could not initialize connection node",__LINE__,__FILE__);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
MYDDAS_TOP = temp;
|
||||
return MYDDAS_TOP;
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_top_connections = temp;
|
||||
return MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
}
|
||||
else //The MYDDAS list is empty
|
||||
{
|
||||
#ifdef MYDDAS_STATS
|
||||
/* Allocates the MYDDAS stats
|
||||
global structure */
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_statistics = (MYDDAS_GLOBAL_STATS) malloc (sizeof(struct myddas_global_stats));
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_statistics->total_db_row = 0;
|
||||
#endif /* MYDDAS_STATS */
|
||||
temp = myddas_util_initialize_connection(conn,enviromment,NULL);
|
||||
if (temp == NULL)
|
||||
{
|
||||
myddas_util_error_message("Could not initialize connection node",__LINE__,__FILE__);
|
||||
return NULL;
|
||||
}
|
||||
MYDDAS_TOP = temp;
|
||||
return MYDDAS_TOP;
|
||||
MYDDAS_GLOBAL_STRUCT->myddas_top_connections = temp;
|
||||
return MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +353,7 @@ myddas_util_add_connection(void *conn, void *enviromment){
|
||||
if there is any odbc connections left on the list*/
|
||||
SQLHENV
|
||||
myddas_util_get_odbc_enviromment(SQLHDBC connection){
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_TOP;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
|
||||
for (;top != NULL;top=top->next)
|
||||
if (top->connection == ((void *)connection))
|
||||
@ -296,6 +363,116 @@ myddas_util_get_odbc_enviromment(SQLHDBC connection){
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Dont forget to free the memory on the other side*/
|
||||
char *
|
||||
myddas_util_delete_all_temp_table(){
|
||||
|
||||
if (MYDDAS_GLOBAL_STRUCT == NULL)
|
||||
return NULL;
|
||||
|
||||
MYDDAS_UTIL_CONNECTION node = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
|
||||
if (node->temporary_tables == NULL){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MYDDAS_TEMP_TABLES tables = node->temporary_tables;
|
||||
|
||||
if (tables->table_numbers == NULL){
|
||||
free(tables->default_table_name);
|
||||
free(tables);
|
||||
return NULL; /* No more tables*/
|
||||
}
|
||||
else {
|
||||
int table_number = tables->table_numbers->number;
|
||||
|
||||
struct myddas_table_integers *temporary = tables->table_numbers;
|
||||
tables->table_numbers = tables->table_numbers->next;
|
||||
if (tables->table_numbers == NULL)
|
||||
tables->last_number = NULL;
|
||||
free(temporary);
|
||||
|
||||
int i=0;
|
||||
|
||||
/* Number of Digits of table_number */
|
||||
for (i=1;;i++)
|
||||
if ((table_number / (10*i)) < 10)
|
||||
break;
|
||||
|
||||
int size = strlen(node->temporary_tables->default_table_name);
|
||||
char *table_name = (char *) malloc (sizeof(char) * (i + size + 1));
|
||||
|
||||
sprintf(table_name,"%s%d",
|
||||
node->temporary_tables->default_table_name,table_number);
|
||||
|
||||
return table_name;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dont forget to free the memory on the other side*/
|
||||
char *
|
||||
myddas_util_get_table_name(void *con){
|
||||
|
||||
int table_number;
|
||||
int i=0;
|
||||
|
||||
MYDDAS_UTIL_CONNECTION node = myddas_util_search_connection(con);
|
||||
|
||||
|
||||
if (node->temporary_tables == NULL) {
|
||||
node->temporary_tables =
|
||||
(MYDDAS_TEMP_TABLES) malloc (sizeof(struct myddas_temp_tables));
|
||||
|
||||
node->temporary_tables->last_number = NULL;
|
||||
node->temporary_tables->table_numbers = NULL;
|
||||
|
||||
/* Number of Digits of the connnection pointer */
|
||||
for (i=1;;i++)
|
||||
if ((((int)con) / (10*i)) < 10)
|
||||
break;
|
||||
|
||||
node->temporary_tables->default_table_name =
|
||||
(char *) malloc (sizeof(char *) + i + 1 + 23);
|
||||
sprintf (node->temporary_tables->default_table_name,"$myddas_temporary_table%d",(int)con);
|
||||
}
|
||||
|
||||
table_number = myddas_util_get_table_number(node);
|
||||
|
||||
/* Number of Digits of table_number */
|
||||
for (i=1;;i++)
|
||||
if ((table_number / (10*i)) < 10)
|
||||
break;
|
||||
|
||||
int size = strlen(node->temporary_tables->default_table_name);
|
||||
char *table_name = (char *) malloc (sizeof(char) * (i + size + 1));
|
||||
|
||||
sprintf(table_name,"%s%d",
|
||||
node->temporary_tables->default_table_name,table_number);
|
||||
|
||||
return table_name;
|
||||
}
|
||||
|
||||
static
|
||||
unsigned int myddas_util_get_table_number(MYDDAS_UTIL_CONNECTION node){
|
||||
|
||||
MYDDAS_TEMP_TABLES table = node->temporary_tables;
|
||||
|
||||
if (table->table_numbers == NULL) {
|
||||
table->last_number = (struct myddas_table_integers *) malloc (sizeof(struct myddas_table_integers));
|
||||
table->table_numbers = table->last_number;
|
||||
table->last_number->number = 0;
|
||||
table->last_number->next=NULL;
|
||||
}
|
||||
else {
|
||||
unsigned int last_number = table->last_number->number;
|
||||
table->last_number->next = (struct myddas_table_integers *) malloc (sizeof(struct myddas_table_integers));
|
||||
table->last_number = table->last_number->next;
|
||||
table->last_number->number = ++last_number;
|
||||
table->last_number->next=NULL;
|
||||
}
|
||||
return table->last_number->number;
|
||||
}
|
||||
|
||||
static
|
||||
void myddas_util_error_message(char *message,int line,char *file){
|
||||
#ifdef DEBUG
|
||||
@ -307,7 +484,7 @@ void myddas_util_error_message(char *message,int line,char *file){
|
||||
|
||||
static MYDDAS_UTIL_CONNECTION
|
||||
myddas_util_search_previous_connection(void *conn){
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_TOP;
|
||||
MYDDAS_UTIL_CONNECTION top = MYDDAS_GLOBAL_STRUCT->myddas_top_connections;
|
||||
for(;top->next!=NULL;top=top->next)
|
||||
if (top->next->connection == conn)
|
||||
return top;
|
||||
@ -325,11 +502,16 @@ myddas_util_initialize_connection(void *conn,void *enviromment,
|
||||
}
|
||||
new->predicates=NULL;
|
||||
new->connection=conn;
|
||||
new->temporary_tables=NULL;
|
||||
new->odbc_enviromment=enviromment;
|
||||
new->next=next;
|
||||
#ifdef MYDDAS_STATS
|
||||
new->totalNumberOfRows=0;
|
||||
new->totalTimeofDBServer=0;
|
||||
new->lastTimeofDBServer=0;
|
||||
new->totalFromDBServer=0;
|
||||
new->lastFromDBServer=0;
|
||||
new->total_db_row=0;
|
||||
#endif
|
||||
return new;
|
||||
}
|
||||
@ -372,9 +554,6 @@ myddas_util_add_predicate_node(MYDDAS_UTIL_PREDICATE new,
|
||||
|
||||
}
|
||||
|
||||
/* DUVIDA: nesta estrutura (list_preds) existe um char* que é atribuido
|
||||
por uma funcao do YAP (YAP_AtomOfTerm) na funcao c_db_add_preds.
|
||||
Temos que fazer free deste apontador?*/
|
||||
static void
|
||||
myddas_util_delete_predicate_list(MYDDAS_UTIL_PREDICATE preds_list){
|
||||
MYDDAS_UTIL_PREDICATE to_delete = NULL;
|
||||
|
@ -6,15 +6,27 @@
|
||||
#include <sql.h>
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct list_connection *MYDDAS_UTIL_CONNECTION;
|
||||
typedef struct list_preds *MYDDAS_UTIL_PREDICATE;
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
typedef struct myddas_global *MYDDAS_GLOBAL;
|
||||
#ifdef MYDDAS_STATS
|
||||
typedef struct myddas_global_stats *MYDDAS_GLOBAL_STATS;
|
||||
#endif
|
||||
typedef struct list_connection *MYDDAS_UTIL_CONNECTION;
|
||||
typedef struct list_preds *MYDDAS_UTIL_PREDICATE;
|
||||
typedef struct myddas_temp_tables *MYDDAS_TEMP_TABLES;
|
||||
|
||||
|
||||
char *
|
||||
myddas_util_delete_all_temp_table(void);
|
||||
char *
|
||||
myddas_util_get_table_name(void *);
|
||||
/* Returns the connection type (mysql -> 1 or odbc -> 2) */
|
||||
short int
|
||||
myddas_util_connection_type(void *);
|
||||
|
||||
/* Adds a connection identifier to the MYDDAS connections list*/
|
||||
MYDDAS_UTIL_CONNECTION
|
||||
@ -44,6 +56,8 @@ myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION);
|
||||
void *
|
||||
myddas_util_get_pred_next(void *);
|
||||
char *
|
||||
myddas_util_get_pred_module(void *);
|
||||
char *
|
||||
myddas_util_get_pred_name(void *);
|
||||
int
|
||||
myddas_util_get_pred_arity(void *);
|
||||
@ -54,14 +68,42 @@ int
|
||||
myddas_util_get_conn_total_rows(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_total_rows(MYDDAS_UTIL_CONNECTION,int);
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_total_time_DBServer(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_total_time_DBServer(MYDDAS_UTIL_CONNECTION,unsigned long);
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_last_time_DBServer(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_last_time_DBServer(MYDDAS_UTIL_CONNECTION,unsigned long);
|
||||
unsigned long
|
||||
myddas_util_get_conn_total_time_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_total_time_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION,unsigned long);
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_conn_last_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_last_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION,unsigned long);
|
||||
unsigned long
|
||||
myddas_util_get_conn_total_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION);
|
||||
void
|
||||
myddas_util_set_conn_total_transfering_from_DBServer(MYDDAS_UTIL_CONNECTION,unsigned long);
|
||||
|
||||
unsigned long
|
||||
myddas_util_get_total_db_row_function(void);
|
||||
void
|
||||
myddas_util_set_total_db_row_function(unsigned long);
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned long
|
||||
myddas_current_time(void);
|
||||
#endif
|
||||
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Reference in New Issue
Block a user