2005-11-22 11:25:59 +00:00
|
|
|
#ifndef __MYDDAS_UTIL_H__
|
|
|
|
#define __MYDDAS_UTIL_H__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef MYDDAS_ODBC
|
|
|
|
#include <sql.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
#ifdef MYDDAS_MYSQL
|
|
|
|
#include <mysql/mysql.h>
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 11:25:59 +00:00
|
|
|
#ifdef MYDDAS_STATS
|
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
typedef struct myddas_global *MYDDAS_GLOBAL;
|
2006-01-17 22:54:02 +00:00
|
|
|
typedef struct myddas_util_query *MYDDAS_UTIL_QUERY;
|
|
|
|
typedef struct myddas_list_connection *MYDDAS_UTIL_CONNECTION;
|
|
|
|
typedef struct myddas_list_preds *MYDDAS_UTIL_PREDICATE;
|
2006-02-05 02:11:56 +00:00
|
|
|
|
|
|
|
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
|
|
|
typedef struct myddas_stats_time_struct *MYDDAS_STATS_TIME;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MYDDAS_STATS
|
|
|
|
typedef struct myddas_global_stats *MYDDAS_GLOBAL_STATS;
|
|
|
|
#endif
|
2005-12-19 13:48:42 +00:00
|
|
|
|
2006-01-17 22:54:02 +00:00
|
|
|
MYDDAS_GLOBAL
|
|
|
|
myddas_util_initialize_myddas(void);
|
2005-12-19 13:48:42 +00:00
|
|
|
|
2006-02-05 02:11:56 +00:00
|
|
|
#ifdef MYDDAS_MYSQL
|
|
|
|
void
|
|
|
|
myddas_util_table_write(MYSQL_RES *);
|
|
|
|
#endif
|
|
|
|
|
2005-12-19 13:48:42 +00:00
|
|
|
/* Returns the connection type (mysql -> 1 or odbc -> 2) */
|
|
|
|
short int
|
|
|
|
myddas_util_connection_type(void *);
|
2005-11-22 11:25:59 +00:00
|
|
|
/* Adds a connection identifier to the MYDDAS connections list*/
|
|
|
|
MYDDAS_UTIL_CONNECTION
|
|
|
|
myddas_util_add_connection(void *,void *);
|
|
|
|
/* Search for the node of the specified connection*/
|
|
|
|
MYDDAS_UTIL_CONNECTION
|
|
|
|
myddas_util_search_connection(void *);
|
|
|
|
/* Deletes a connection node from the MYDDAS connections list*/
|
|
|
|
void
|
|
|
|
myddas_util_delete_connection(void *);
|
|
|
|
|
|
|
|
/* Adds a new predicate to it's connection node list*/
|
|
|
|
MYDDAS_UTIL_CONNECTION
|
|
|
|
myddas_util_add_predicate(char *,int , char *,void *);
|
2006-01-17 22:54:02 +00:00
|
|
|
/* Search for a predicate node*/
|
2005-11-22 11:25:59 +00:00
|
|
|
MYDDAS_UTIL_PREDICATE
|
|
|
|
myddas_util_search_predicate(char *,int , char *);
|
2006-01-17 22:54:02 +00:00
|
|
|
/* Deletes predicate from the prediate list */
|
|
|
|
void
|
|
|
|
myddas_util_delete_predicate(MYDDAS_UTIL_PREDICATE);
|
|
|
|
|
|
|
|
/* Get's the number of queries to save */
|
|
|
|
unsigned long
|
|
|
|
myddas_util_get_total_multi_queries_number(MYDDAS_UTIL_CONNECTION);
|
|
|
|
void
|
|
|
|
myddas_util_set_total_multi_queries_number(MYDDAS_UTIL_CONNECTION,unsigned long);
|
2005-11-22 11:25:59 +00:00
|
|
|
|
|
|
|
#ifdef MYDDAS_ODBC
|
|
|
|
/* Return enviromment identifier*/
|
|
|
|
SQLHENV
|
|
|
|
myddas_util_get_odbc_enviromment(SQLHDBC);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void *
|
|
|
|
myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION);
|
|
|
|
void *
|
|
|
|
myddas_util_get_pred_next(void *);
|
|
|
|
char *
|
2005-12-19 13:48:42 +00:00
|
|
|
myddas_util_get_pred_module(void *);
|
|
|
|
char *
|
2005-11-22 11:25:59 +00:00
|
|
|
myddas_util_get_pred_name(void *);
|
|
|
|
int
|
|
|
|
myddas_util_get_pred_arity(void *);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void check_int(void);
|
|
|
|
#endif
|
|
|
|
|
2006-01-08 16:12:42 +00:00
|
|
|
|
|
|
|
//DELETE THIS WHEN DB_STATS IS COMPLETED
|
|
|
|
int
|
|
|
|
get_myddas_top(void);
|
|
|
|
|
2005-11-22 11:25:59 +00:00
|
|
|
#endif /*__MYDDAS_UTIL_H__*/
|