consult Yap.h to get ocnfig.h
This commit is contained in:
parent
d3796aba5a
commit
f20599478e
@ -14,10 +14,10 @@
|
||||
* comments: Predicates for maintaining MYDDAS *
|
||||
* *
|
||||
*************************************************************************/
|
||||
#include "Yap.h"
|
||||
|
||||
#ifdef USE_MYDDAS
|
||||
|
||||
#include "Yap.h"
|
||||
#include "Yatom.h"
|
||||
#include "cut_c.h"
|
||||
#include "myddas.h"
|
||||
@ -48,8 +48,7 @@ static Int c_db_stats_time( USES_REGS1 );
|
||||
static Int c_db_check(USES_REGS1);
|
||||
#endif
|
||||
|
||||
void Yap_InitMYDDAS_SharedPreds(void)
|
||||
{
|
||||
void Yap_InitMYDDAS_SharedPreds(void) {
|
||||
/* c_db_initialize_myddas */
|
||||
Yap_InitCPred("c_db_initialize_myddas", 0, c_db_initialize_myddas, 0);
|
||||
|
||||
@ -87,38 +86,31 @@ void Yap_InitMYDDAS_SharedPreds(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Yap_InitBackMYDDAS_SharedPreds(void)
|
||||
{
|
||||
void Yap_InitBackMYDDAS_SharedPreds(void) {
|
||||
/* Gives all the predicates associated to a given connection */
|
||||
Yap_InitCPredBack("c_db_preds_conn", 4, sizeof(Int),
|
||||
c_db_preds_conn_start,
|
||||
Yap_InitCPredBack("c_db_preds_conn", 4, sizeof(Int), c_db_preds_conn_start,
|
||||
c_db_preds_conn_continue, 0);
|
||||
/* Gives all the connections stored on the MYDDAS Structure*/
|
||||
Yap_InitCPredBack("c_db_connection", 1, sizeof(Int),
|
||||
c_db_connection_start,
|
||||
Yap_InitCPredBack("c_db_connection", 1, sizeof(Int), c_db_connection_start,
|
||||
c_db_connection_continue, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Initialize all of the MYDDAS global structures */
|
||||
static Int
|
||||
c_db_initialize_myddas( USES_REGS1 ){
|
||||
static Int c_db_initialize_myddas(USES_REGS1) {
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER = myddas_init_initialize_myddas();
|
||||
#ifdef MYDDAS_STATS
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER = myddas_stats_initialize_global_stats(Yap_REGS.MYDDAS_GLOBAL_POINTER);
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER =
|
||||
myddas_stats_initialize_global_stats(Yap_REGS.MYDDAS_GLOBAL_POINTER);
|
||||
#endif /* MYDDAS_STATS */
|
||||
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 ( USES_REGS1 ){
|
||||
static Int c_db_connection_type(USES_REGS1) {
|
||||
Term arg_con = Deref(ARG1);
|
||||
Term arg_type = ARG2;
|
||||
|
||||
@ -143,8 +135,7 @@ c_db_connection_type ( USES_REGS1 ){
|
||||
}
|
||||
|
||||
/* db_add_preds: PredName * Arity * Module * Connection*/
|
||||
static Int
|
||||
c_db_add_preds ( USES_REGS1 ){
|
||||
static Int c_db_add_preds(USES_REGS1) {
|
||||
Term arg_nome = Deref(ARG1);
|
||||
Term arg_aridade = Deref(ARG2);
|
||||
Term arg_module = Deref(ARG3);
|
||||
@ -153,16 +144,15 @@ c_db_add_preds ( USES_REGS1 ){
|
||||
/* PredEntry *pe; */
|
||||
/* pe = RepPredProp(PredPropByFunc(FunctorOfTerm(arg_pred),arg_module)); */
|
||||
|
||||
|
||||
const char *nome = AtomName(AtomOfTerm(arg_nome));
|
||||
const char *module = AtomName(AtomOfTerm(arg_module));
|
||||
Int aridade = IntegerOfTerm(arg_aridade);
|
||||
Int *conn = (Int *)IntegerOfTerm(arg_conn);
|
||||
|
||||
if (myddas_util_add_predicate(nome,aridade,module,conn) == NULL)
|
||||
{
|
||||
if (myddas_util_add_predicate(nome, aridade, module, conn) == NULL) {
|
||||
#ifdef DEBUG
|
||||
printf ("ERROR : Could not add Predicate: Line: %d File: %s\n",__LINE__,__FILE__);
|
||||
printf("ERROR : Could not add Predicate: Line: %d File: %s\n", __LINE__,
|
||||
__FILE__);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
@ -170,14 +160,11 @@ c_db_add_preds ( USES_REGS1 ){
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Int
|
||||
c_db_check_if_exists_pred ( USES_REGS1 ){
|
||||
static Int c_db_check_if_exists_pred(USES_REGS1) {
|
||||
Term arg_nome = Deref(ARG1);
|
||||
Term arg_aridade = Deref(ARG2);
|
||||
Term arg_module = Deref(ARG3);
|
||||
|
||||
|
||||
const char *nome = AtomName(AtomOfTerm(arg_nome));
|
||||
const char *module = AtomName(AtomOfTerm(arg_module));
|
||||
Int aridade = IntegerOfTerm(arg_aridade);
|
||||
@ -188,9 +175,7 @@ c_db_check_if_exists_pred ( USES_REGS1 ){
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Int
|
||||
c_db_delete_predicate( USES_REGS1 ){
|
||||
static Int c_db_delete_predicate(USES_REGS1) {
|
||||
Term arg_module = Deref(ARG1);
|
||||
Term arg_name = Deref(ARG2);
|
||||
Term arg_arity = Deref(ARG3);
|
||||
@ -209,34 +194,30 @@ c_db_delete_predicate( USES_REGS1 ){
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Int
|
||||
c_db_multi_queries_number( USES_REGS1 ){
|
||||
static Int c_db_multi_queries_number(USES_REGS1) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
Term arg_number = Deref(ARG2);
|
||||
|
||||
Int *conn = (Int *)IntegerOfTerm(arg_conn);
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
myddas_util_search_connection(conn);
|
||||
MYDDAS_UTIL_CONNECTION node = myddas_util_search_connection(conn);
|
||||
|
||||
if (node == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (IsVarTerm(arg_number)) {
|
||||
Yap_unify(arg_number,MkIntegerTerm(((Int)myddas_util_get_total_multi_queries_number(node))+1));
|
||||
}
|
||||
else {
|
||||
Yap_unify(arg_number,
|
||||
MkIntegerTerm(
|
||||
((Int)myddas_util_get_total_multi_queries_number(node)) + 1));
|
||||
} else {
|
||||
Int number = IntegerOfTerm(arg_number);
|
||||
number--;
|
||||
myddas_util_set_total_multi_queries_number(node, number);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
static Int
|
||||
c_db_connection_start( USES_REGS1 ){
|
||||
static Int c_db_connection_start(USES_REGS1) {
|
||||
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_top_connections;
|
||||
@ -246,16 +227,14 @@ c_db_connection_start( USES_REGS1 ){
|
||||
return (c_db_connection_continue(PASS_REGS1));
|
||||
}
|
||||
|
||||
static Int
|
||||
c_db_connection_continue( USES_REGS1 ){
|
||||
static Int c_db_connection_continue(USES_REGS1) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
|
||||
MYDDAS_UTIL_CONNECTION node;
|
||||
node = (MYDDAS_UTIL_CONNECTION)IntegerOfTerm(EXTRA_CBACK_ARG(1, 1));
|
||||
|
||||
/* There is no connections */
|
||||
if (node == NULL)
|
||||
{
|
||||
if (node == NULL) {
|
||||
cut_fail();
|
||||
return FALSE;
|
||||
}
|
||||
@ -264,21 +243,17 @@ c_db_connection_continue( USES_REGS1 ){
|
||||
EXTRA_CBACK_ARG(1, 1) = (CELL)MkIntegerTerm((Int)(node->next));
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
/* db_preds_conn : Connection(+) * Pred_name(-) * Pred_arity */
|
||||
static Int
|
||||
c_db_preds_conn_start ( USES_REGS1 ){
|
||||
static Int c_db_preds_conn_start(USES_REGS1) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
|
||||
Int *conn = (Int *)IntegerOfTerm(arg_conn);
|
||||
MYDDAS_UTIL_CONNECTION node =
|
||||
myddas_util_search_connection(conn);
|
||||
MYDDAS_UTIL_CONNECTION node = myddas_util_search_connection(conn);
|
||||
|
||||
/* Caso a ligacao já tenha sido apagada*/
|
||||
if (node == NULL)
|
||||
{
|
||||
if (node == NULL) {
|
||||
cut_fail();
|
||||
return FALSE;
|
||||
}
|
||||
@ -290,8 +265,7 @@ c_db_preds_conn_start ( USES_REGS1 ){
|
||||
}
|
||||
|
||||
/* db_preds_conn : Connection(+) * Pred_name(-) * Pred_arity*/
|
||||
static Int
|
||||
c_db_preds_conn_continue ( USES_REGS1 ){
|
||||
static Int c_db_preds_conn_continue(USES_REGS1) {
|
||||
Term module = Deref(ARG2);
|
||||
Term name = Deref(ARG3);
|
||||
Term arity = Deref(ARG4);
|
||||
@ -299,33 +273,31 @@ c_db_preds_conn_continue ( USES_REGS1 ){
|
||||
void *pointer;
|
||||
pointer = (void *)IntegerOfTerm(EXTRA_CBACK_ARG(4, 1));
|
||||
|
||||
if (pointer != NULL)
|
||||
{
|
||||
EXTRA_CBACK_ARG(4,1)=(CELL) MkIntegerTerm((Int)myddas_util_get_pred_next(pointer));
|
||||
if (pointer != NULL) {
|
||||
EXTRA_CBACK_ARG(4, 1) =
|
||||
(CELL)MkIntegerTerm((Int)myddas_util_get_pred_next(pointer));
|
||||
|
||||
if (!Yap_unify(module, MkAtomTerm(Yap_LookupAtom(myddas_util_get_pred_module(pointer))))){
|
||||
if (!Yap_unify(module, MkAtomTerm(Yap_LookupAtom(
|
||||
myddas_util_get_pred_module(pointer))))) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!Yap_unify(name,MkAtomTerm(Yap_LookupAtom(myddas_util_get_pred_name(pointer))))){
|
||||
if (!Yap_unify(name, MkAtomTerm(Yap_LookupAtom(
|
||||
myddas_util_get_pred_name(pointer))))) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!Yap_unify(arity, MkIntegerTerm((Int)myddas_util_get_pred_arity(pointer)))){
|
||||
if (!Yap_unify(arity,
|
||||
MkIntegerTerm((Int)myddas_util_get_pred_arity(pointer)))) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cut_fail();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
static Int
|
||||
c_db_check( USES_REGS1 ){
|
||||
static Int c_db_check(USES_REGS1) {
|
||||
check_int();
|
||||
return TRUE;
|
||||
}
|
||||
@ -333,8 +305,7 @@ c_db_check( USES_REGS1 ){
|
||||
|
||||
#ifdef MYDDAS_STATS
|
||||
|
||||
static Int
|
||||
c_db_stats_walltime( USES_REGS1 ){
|
||||
static Int c_db_stats_walltime(USES_REGS1) {
|
||||
Term arg_time = Deref(ARG1);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -343,16 +314,14 @@ c_db_stats_walltime( USES_REGS1 ){
|
||||
Yap_unify(arg_time, MkIntegerTerm((Int)myddas_stats_walltime()));
|
||||
return TRUE;
|
||||
#ifdef DEBUG
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
printf("ERROR: c_db_stats_walltime got a variable\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static Int
|
||||
c_db_stats_translate( USES_REGS1 ){
|
||||
static Int c_db_stats_translate(USES_REGS1) {
|
||||
Term arg_start = Deref(ARG1);
|
||||
Term arg_end = Deref(ARG2);
|
||||
|
||||
@ -385,16 +354,14 @@ c_db_stats_translate( USES_REGS1 ){
|
||||
|
||||
return TRUE;
|
||||
#ifdef DEBUG
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
printf("ERROR: c_db_stats_translate got a variable\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static Int
|
||||
c_db_stats_time( USES_REGS1 ){
|
||||
static Int c_db_stats_time(USES_REGS1) {
|
||||
Term arg_reference = Deref(ARG1);
|
||||
Term arg_time = Deref(ARG2);
|
||||
|
||||
@ -408,8 +375,7 @@ c_db_stats_time( USES_REGS1 ){
|
||||
|
||||
switch (struc->type) {
|
||||
|
||||
case integer:
|
||||
{
|
||||
case integer: {
|
||||
Functor functor = Yap_MkFunctor(Yap_LookupAtom("myddas_integer"), 2);
|
||||
Term integer_number[1];
|
||||
MyddasULInt integer;
|
||||
@ -417,7 +383,8 @@ c_db_stats_time( USES_REGS1 ){
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("number"), 1);
|
||||
integer = struc->u.integer.integer;
|
||||
number[0] = MkIntegerTerm(integer);
|
||||
integer_number[0] = Yap_MkApplTerm(unit,1,number);;
|
||||
integer_number[0] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
count_number[0] = MkIntegerTerm(struc->count);
|
||||
integer_number[1] = Yap_MkApplTerm(functor_count, 1, count_number);
|
||||
@ -425,8 +392,7 @@ c_db_stats_time( USES_REGS1 ){
|
||||
break;
|
||||
}
|
||||
|
||||
case time_str:
|
||||
{
|
||||
case time_str: {
|
||||
MYDDAS_STATS_TIME time = struc->u.time_str.time_str;
|
||||
|
||||
Functor functor = Yap_MkFunctor(Yap_LookupAtom("myddas_time"), 6);
|
||||
@ -436,27 +402,32 @@ c_db_stats_time( USES_REGS1 ){
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("hours"), 1);
|
||||
time_number = MYDDAS_STATS_TIME_HOURS(time);
|
||||
number[0] = MkIntegerTerm(time_number);
|
||||
time_numbers[0] = Yap_MkApplTerm(unit,1,number);;
|
||||
time_numbers[0] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("minutes"), 1);
|
||||
time_number = MYDDAS_STATS_TIME_MINUTES(time);
|
||||
number[0] = MkIntegerTerm(time_number);
|
||||
time_numbers[1] = Yap_MkApplTerm(unit,1,number);;
|
||||
time_numbers[1] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("seconds"), 1);
|
||||
time_number = MYDDAS_STATS_TIME_SECONDS(time);
|
||||
number[0] = MkIntegerTerm(time_number);
|
||||
time_numbers[2] = Yap_MkApplTerm(unit,1,number);;
|
||||
time_numbers[2] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("miliseconds"), 1);
|
||||
time_number = MYDDAS_STATS_TIME_MILISECONDS(time);
|
||||
number[0] = MkIntegerTerm(time_number);
|
||||
time_numbers[3] = Yap_MkApplTerm(unit,1,number);;
|
||||
time_numbers[3] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
unit = Yap_MkFunctor(Yap_LookupAtom("microseconds"), 1);
|
||||
time_number = MYDDAS_STATS_TIME_MICROSECONDS(time);
|
||||
number[0] = MkIntegerTerm(time_number);
|
||||
time_numbers[4] = Yap_MkApplTerm(unit,1,number);;
|
||||
time_numbers[4] = Yap_MkApplTerm(unit, 1, number);
|
||||
;
|
||||
|
||||
count_number[0] = MkIntegerTerm(struc->count);
|
||||
time_numbers[5] = Yap_MkApplTerm(functor_count, 1, count_number);
|
||||
@ -480,8 +451,7 @@ c_db_stats_time( USES_REGS1 ){
|
||||
}
|
||||
|
||||
// Returns the stats of this module in a list
|
||||
static Int
|
||||
c_db_stats( USES_REGS1 ) {
|
||||
static Int c_db_stats(USES_REGS1) {
|
||||
Term arg_conn = Deref(ARG1);
|
||||
Term arg_list = Deref(ARG2);
|
||||
|
||||
@ -553,7 +523,8 @@ c_db_stats( USES_REGS1 ) {
|
||||
Yap_unify(head, MkIntegerTerm((MyddasInt)str));
|
||||
#ifdef DEBUG
|
||||
MYDDAS_STATS_CON_GET_TOTAL_TIME_TRANSFERING(node, time);
|
||||
printf ("Refence to time Spent by the Server, transfering all the results SQL Query\n");
|
||||
printf("Refence to time Spent by the Server, transfering all the results SQL "
|
||||
"Query\n");
|
||||
MYDDAS_STATS_PRINT_TIME_STRUCT(time);
|
||||
printf("\n\n");
|
||||
#endif
|
||||
@ -567,7 +538,8 @@ c_db_stats( USES_REGS1 ) {
|
||||
Yap_unify(head, MkIntegerTerm((MyddasInt)str));
|
||||
#ifdef DEBUG
|
||||
MYDDAS_STATS_CON_GET_LAST_TIME_TRANSFERING(node, time);
|
||||
printf ("Reference to time Spent by the Server, transfering the result of the last SQL Query\n");
|
||||
printf("Reference to time Spent by the Server, transfering the result of the "
|
||||
"last SQL Query\n");
|
||||
MYDDAS_STATS_PRINT_TIME_STRUCT(time);
|
||||
printf("\n\n");
|
||||
#endif
|
||||
@ -577,7 +549,8 @@ c_db_stats( USES_REGS1 ) {
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
|
||||
str = myddas_stats_get_stat(Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->stats,1);
|
||||
str = myddas_stats_get_stat(
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->stats, 1);
|
||||
|
||||
Yap_unify(head, MkIntegerTerm((MyddasInt)str));
|
||||
#ifdef DEBUG
|
||||
@ -629,7 +602,8 @@ c_db_stats( USES_REGS1 ) {
|
||||
head = HeadOfTerm(list);
|
||||
list = TailOfTerm(list);
|
||||
|
||||
str = myddas_stats_get_stat(Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->stats,2);
|
||||
str = myddas_stats_get_stat(
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->stats, 2);
|
||||
Yap_unify(head, MkIntegerTerm((Int)str));
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -658,23 +632,19 @@ c_db_stats( USES_REGS1 ) {
|
||||
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
|
||||
/* Function to delete all the temporary tables */
|
||||
/* from the mysql server */
|
||||
void Yap_MYDDAS_delete_all_myddas_structs(void)
|
||||
{
|
||||
void Yap_MYDDAS_delete_all_myddas_structs(void) {
|
||||
CACHE_REGS
|
||||
|
||||
/* NAO ESQUECER DE FAZER ISTO TB PARA O DB_CLOSE*/
|
||||
MYDDAS_GLOBAL global =
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER;
|
||||
MYDDAS_GLOBAL global = Yap_REGS.MYDDAS_GLOBAL_POINTER;
|
||||
|
||||
/* In case that the MYDDAS module isn't loaded */
|
||||
if (global == NULL)
|
||||
return;
|
||||
|
||||
MYDDAS_UTIL_CONNECTION connections =
|
||||
global->myddas_top_connections;
|
||||
MYDDAS_UTIL_CONNECTION connections = global->myddas_top_connections;
|
||||
|
||||
/* Delete all connections */
|
||||
for (; connections != NULL; connections = connections->next)
|
||||
@ -690,9 +660,11 @@ void Yap_MYDDAS_delete_all_myddas_structs(void)
|
||||
#ifdef DEBUG
|
||||
MyddasULInt nr;
|
||||
MYDDAS_MEMORY_MALLOC_NR(nr);
|
||||
printf ("Number of times malloc was called in MYDDAS: " UInt_FORMAT " \n",(UInt)nr);
|
||||
printf("Number of times malloc was called in MYDDAS: " UInt_FORMAT " \n",
|
||||
(UInt)nr);
|
||||
MYDDAS_MEMORY_FREE_NR(nr);
|
||||
printf ("Number of times free was called in MYDDAS : " UInt_FORMAT " \n",(UInt)nr);
|
||||
printf("Number of times free was called in MYDDAS : " UInt_FORMAT " \n",
|
||||
(UInt)nr);
|
||||
|
||||
MYDDAS_MEMORY_MALLOC_SIZE(nr);
|
||||
printf("Total memory allocated in MYDDAS: " UInt_FORMAT " \n", (UInt)nr);
|
||||
@ -701,10 +673,7 @@ void Yap_MYDDAS_delete_all_myddas_structs(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
init_myddas(void)
|
||||
{
|
||||
void init_myddas(void) {
|
||||
CACHE_REGS
|
||||
#if defined MYDDAS_ODBC
|
||||
Yap_InitBackMYDDAS_ODBCPreds();
|
||||
@ -727,7 +696,8 @@ init_myddas(void)
|
||||
#if defined USE_MYDDAS
|
||||
Yap_InitMYDDAS_SharedPreds();
|
||||
#endif
|
||||
#if defined MYDDAS_TOP_LEVEL && defined MYDDAS_MYSQL // && defined HAVE_LIBREADLINE
|
||||
#if defined MYDDAS_TOP_LEVEL && \
|
||||
defined MYDDAS_MYSQL // && defined HAVE_LIBREADLINE
|
||||
Yap_InitMYDDAS_TopLevelPreds();
|
||||
#endif
|
||||
#if USE_MYDDAS
|
||||
@ -736,7 +706,8 @@ init_myddas(void)
|
||||
Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL;
|
||||
Yap_PutValue(AtomMyddasVersionName,
|
||||
MkAtomTerm(Yap_LookupAtom(stringify(MYDDAS_VERSION))));
|
||||
Yap_HaltRegisterHook((HaltHookFunc)Yap_MYDDAS_delete_all_myddas_structs,NULL);
|
||||
Yap_HaltRegisterHook((HaltHookFunc)Yap_MYDDAS_delete_all_myddas_structs,
|
||||
NULL);
|
||||
#undef stringify
|
||||
#undef _stringify
|
||||
Yap_MYDDAS_delete_all_myddas_structs();
|
||||
@ -750,10 +721,8 @@ c_db_initialize_myddas( PASS_REGS1 );
|
||||
|
||||
int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved);
|
||||
|
||||
int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved) {
|
||||
switch (reason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
@ -767,6 +736,4 @@ int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* USE_MYDDAS*/
|
||||
|
Reference in New Issue
Block a user