2005-12-19 13:48:42 +00:00
|
|
|
#ifndef __MYDDAS_STRUCTS_H__
|
|
|
|
#define __MYDDAS_STRUCTS_H__
|
|
|
|
|
2006-01-17 22:54:02 +00:00
|
|
|
#include "myddas_util.h"
|
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
struct myddas_global {
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_top_connections;
|
2006-02-05 02:11:56 +00:00
|
|
|
#ifdef MYDDAS_TOP_LEVEL
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_top_level_connection;
|
|
|
|
#endif
|
2005-12-19 13:48:42 +00:00
|
|
|
#ifdef MYDDAS_STATS
|
|
|
|
MYDDAS_GLOBAL_STATS myddas_statistics;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef MYDDAS_STATS
|
|
|
|
/* This strucuture holds some global statistics*/
|
|
|
|
struct myddas_global_stats {
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME total_db_row;
|
2005-12-19 13:48:42 +00:00
|
|
|
};
|
|
|
|
#endif /* MYDDAS_STATS */
|
|
|
|
|
2006-01-17 22:54:02 +00:00
|
|
|
struct myddas_list_preds {
|
2005-12-19 13:48:42 +00:00
|
|
|
char *pred_module;
|
|
|
|
char *pred_name;
|
|
|
|
short pred_arity;
|
2006-04-30 11:07:44 +01:00
|
|
|
//void *pe;
|
2006-01-17 22:54:02 +00:00
|
|
|
MYDDAS_UTIL_PREDICATE next;
|
|
|
|
MYDDAS_UTIL_PREDICATE previous;
|
2005-12-19 13:48:42 +00:00
|
|
|
};
|
|
|
|
|
2006-01-17 22:54:02 +00:00
|
|
|
struct myddas_list_connection {
|
2005-12-19 13:48:42 +00:00
|
|
|
void *connection;
|
2006-02-05 02:11:56 +00:00
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
/*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 */
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME totalTimeofDBServer;
|
2005-12-19 13:48:42 +00:00
|
|
|
/* Time spent by the DataBase Server, processing
|
|
|
|
the last query */
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME lastTimeofDBServer;
|
2005-12-19 13:48:42 +00:00
|
|
|
|
|
|
|
/* Total Time spent by the DataBase Server,
|
|
|
|
transfering all the data to the client */
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME totalFromDBServer;
|
2005-12-19 13:48:42 +00:00
|
|
|
/* Time spent by the DataBase Server,
|
|
|
|
transfering the data of the last query */
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME lastFromDBServer;
|
2005-12-19 13:48:42 +00:00
|
|
|
|
2006-01-08 16:12:42 +00:00
|
|
|
/* Last bytes transfered from the server */
|
|
|
|
unsigned long totalBytesTransfered;
|
|
|
|
/* Total bytes transfered from the server */
|
|
|
|
unsigned long lastBytesTransfered;
|
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
/* Total Time spent on the db_row function */
|
2006-02-05 02:11:56 +00:00
|
|
|
MYDDAS_STATS_TIME total_db_row;
|
2006-01-08 16:12:42 +00:00
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
/* Number of querys made to the Server*/
|
2006-01-08 16:12:42 +00:00
|
|
|
unsigned long total_querys_made;
|
2005-12-19 13:48:42 +00:00
|
|
|
#endif
|
|
|
|
MYDDAS_UTIL_PREDICATE predicates;
|
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
/* Multi Queries Section */
|
2006-01-17 22:54:02 +00:00
|
|
|
unsigned long total_number_queries;
|
|
|
|
unsigned long actual_number_queries;
|
|
|
|
MYDDAS_UTIL_QUERY *queries;
|
2005-12-19 13:48:42 +00:00
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
/* List Integrety */
|
2006-01-17 22:54:02 +00:00
|
|
|
MYDDAS_UTIL_CONNECTION next;
|
|
|
|
MYDDAS_UTIL_CONNECTION previous;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct myddas_util_query{
|
|
|
|
char *query;
|
|
|
|
MYDDAS_UTIL_QUERY next;
|
|
|
|
};
|
2005-12-19 13:48:42 +00:00
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
|
|
|
|
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
|
|
|
struct myddas_stats_time_struct{
|
|
|
|
enum {time_copy,
|
|
|
|
time_final} type;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
unsigned long tv_sec;
|
|
|
|
unsigned long tv_usec;
|
|
|
|
} time_copy;
|
|
|
|
struct {
|
|
|
|
unsigned short hours;
|
|
|
|
unsigned short minutes; //Max 59
|
|
|
|
unsigned short seconds; //Max 59
|
|
|
|
unsigned short miliseconds; //Max 999
|
|
|
|
unsigned short microseconds; //Max 999
|
|
|
|
} time_final;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
#endif /* MYDDAS_STATS || MYDDAS_TOP_LEVEL */
|
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
#endif
|