warning, postgres
This commit is contained in:
parent
8f90705e26
commit
63c2fa3c6b
@ -22,7 +22,7 @@ YAPLIBDIR=@libdir@/Yap
|
|||||||
CC=@CC@
|
CC=@CC@
|
||||||
YAP_EXTRAS=@YAP_EXTRAS@
|
YAP_EXTRAS=@YAP_EXTRAS@
|
||||||
CFLAGS= $(YAP_EXTRAS) @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../H -I$(srcdir)/../../OPTYap -I$(srcdir)/../../os @MYDDAS_CPPFLAGS@
|
CFLAGS= $(YAP_EXTRAS) @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../H -I$(srcdir)/../../OPTYap -I$(srcdir)/../../os @MYDDAS_CPPFLAGS@
|
||||||
LDFLAGS=@LDFLAGS@
|
LDFLAGS=@LDFLAGS@ @MYDDAS_LDFLAGS@
|
||||||
ECPP=@ECPP@
|
ECPP=@ECPP@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
/* myddas_initialization.c */
|
/* myddas_initialization.c */
|
||||||
MYDDAS_GLOBAL myddas_init_initialize_myddas(void);
|
MYDDAS_GLOBAL myddas_init_initialize_myddas(void);
|
||||||
MYDDAS_UTIL_CONNECTION myddas_init_initialize_connection(void *,void *,MYDDAS_API,MYDDAS_UTIL_CONNECTION);
|
MYDDAS_UTIL_CONNECTION myddas_init_initialize_connection(void *,void *,MYDDAS_API,MYDDAS_UTIL_CONNECTION);
|
||||||
MYDDAS_UTIL_PREDICATE myddas_init_initialize_predicate(char *, int, char *,MYDDAS_UTIL_PREDICATE);
|
MYDDAS_UTIL_PREDICATE myddas_init_initialize_predicate(const char *, int, const char *,MYDDAS_UTIL_PREDICATE);
|
||||||
|
|
||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
/* myddas_statistics.c */
|
/* myddas_statistics.c */
|
||||||
@ -22,8 +22,8 @@ Short myddas_util_connection_type(void *);
|
|||||||
MYDDAS_UTIL_CONNECTION myddas_util_add_connection(void *,void *,MYDDAS_API);
|
MYDDAS_UTIL_CONNECTION myddas_util_add_connection(void *,void *,MYDDAS_API);
|
||||||
MYDDAS_UTIL_CONNECTION myddas_util_search_connection(void *);
|
MYDDAS_UTIL_CONNECTION myddas_util_search_connection(void *);
|
||||||
void myddas_util_delete_connection(void *);
|
void myddas_util_delete_connection(void *);
|
||||||
MYDDAS_UTIL_CONNECTION myddas_util_add_predicate(char * ,Int , char *,void *);
|
MYDDAS_UTIL_CONNECTION myddas_util_add_predicate(const char * ,Int , const char *,void *);
|
||||||
MYDDAS_UTIL_PREDICATE myddas_util_search_predicate(char * ,Int , char *);
|
MYDDAS_UTIL_PREDICATE myddas_util_search_predicate(const char * ,Int , const char *);
|
||||||
void myddas_util_delete_predicate(MYDDAS_UTIL_PREDICATE);
|
void myddas_util_delete_predicate(MYDDAS_UTIL_PREDICATE);
|
||||||
|
|
||||||
/* Get's the number of queries to save */
|
/* Get's the number of queries to save */
|
||||||
@ -36,8 +36,8 @@ SQLHENV myddas_util_get_odbc_enviromment(SQLHDBC);
|
|||||||
|
|
||||||
void * myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION);
|
void * myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION);
|
||||||
void * myddas_util_get_pred_next(void *);
|
void * myddas_util_get_pred_next(void *);
|
||||||
char * myddas_util_get_pred_module(void *);
|
const char * myddas_util_get_pred_module(void *);
|
||||||
char * myddas_util_get_pred_name(void *);
|
const char * myddas_util_get_pred_name(void *);
|
||||||
MyddasInt myddas_util_get_pred_arity(void *);
|
MyddasInt myddas_util_get_pred_arity(void *);
|
||||||
//DELETE THIS WHEN DB_STATS IS COMPLETED
|
//DELETE THIS WHEN DB_STATS IS COMPLETED
|
||||||
MyddasInt get_myddas_top(void);
|
MyddasInt get_myddas_top(void);
|
||||||
|
@ -4,6 +4,7 @@ AC_DEFINE_UNQUOTED(MYDDAS_VERSION, $MYDDAS_VERSION, [myddas release])
|
|||||||
OLD_LIBS="$LIBS"
|
OLD_LIBS="$LIBS"
|
||||||
OLD_CPPFLAGS="$CPPFLAGS"
|
OLD_CPPFLAGS="$CPPFLAGS"
|
||||||
MYDDAS_CPPFLAGS=""
|
MYDDAS_CPPFLAGS=""
|
||||||
|
MYDDAS_LDFLAGS=""
|
||||||
|
|
||||||
AC_ARG_ENABLE(myddas,
|
AC_ARG_ENABLE(myddas,
|
||||||
[ --enable-myddas[[=DIR]] with the MYDDAS library],
|
[ --enable-myddas[[=DIR]] with the MYDDAS library],
|
||||||
@ -13,7 +14,8 @@ AC_ARG_ENABLE(myddas,
|
|||||||
yap_cv_myddas=no
|
yap_cv_myddas=no
|
||||||
else
|
else
|
||||||
yap_cv_myddas=$withval
|
yap_cv_myddas=$withval
|
||||||
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
|
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
|
||||||
|
MYDDAS_LDFLAGS+=" -L${yap_cv_myddas}/lib "
|
||||||
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
|
||||||
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_myddas}/include "
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_myddas}/include "
|
||||||
fi,
|
fi,
|
||||||
@ -28,6 +30,7 @@ AC_ARG_WITH(mysql,
|
|||||||
else
|
else
|
||||||
yap_cv_mysql=$withval
|
yap_cv_mysql=$withval
|
||||||
LDFLAGS="$LDFLAGS -L${yap_cv_mysql}/lib "
|
LDFLAGS="$LDFLAGS -L${yap_cv_mysql}/lib "
|
||||||
|
MYDDAS_LDFLAGS+=" -L${yap_cv_mysql}/lib "
|
||||||
CPPFLAGS="$CPPFLAGS -I${yap_cv_mysql}/include "
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_mysql}/include "
|
||||||
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_mysql}/include "
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_mysql}/include "
|
||||||
fi,
|
fi,
|
||||||
@ -42,6 +45,7 @@ AC_ARG_WITH(odbc,
|
|||||||
else
|
else
|
||||||
yap_cv_odbc=$withval
|
yap_cv_odbc=$withval
|
||||||
LDFLAGS="$LDFLAGS -L${yap_cv_odbc}/lib "
|
LDFLAGS="$LDFLAGS -L${yap_cv_odbc}/lib "
|
||||||
|
MYDDAS_LDFLAGS+=" -L${yap_cv_odbc}/lib "
|
||||||
CPPFLAGS="$CPPFLAGS -I${yap_cv_odbc}/include "
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_odbc}/include "
|
||||||
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_odbc}/include "
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_odbc}/include "
|
||||||
fi,
|
fi,
|
||||||
@ -56,6 +60,7 @@ AC_ARG_WITH(sqlite3,
|
|||||||
else
|
else
|
||||||
yap_cv_sqlite3=$withval
|
yap_cv_sqlite3=$withval
|
||||||
LDFLAGS="$LDFLAGS -L${yap_cv_sqlite3}/lib "
|
LDFLAGS="$LDFLAGS -L${yap_cv_sqlite3}/lib "
|
||||||
|
MYDDAS_LDFLAGS+=" -L${yap_cv_sqlite3}/lib "
|
||||||
CPPFLAGS="$CPPFLAGS -I${yap_cv_sqlite3}/include "
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_sqlite3}/include "
|
||||||
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_sqlite3}/include "
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_sqlite3}/include "
|
||||||
fi,
|
fi,
|
||||||
@ -70,6 +75,7 @@ AC_ARG_WITH(postgres,
|
|||||||
else
|
else
|
||||||
yap_cv_postgres=$withval
|
yap_cv_postgres=$withval
|
||||||
LDFLAGS="$LDFLAGS -L${yap_cv_postgres}/lib "
|
LDFLAGS="$LDFLAGS -L${yap_cv_postgres}/lib "
|
||||||
|
MYDDAS_LDFLAGS+=" -L${yap_cv_postgres}/lib "
|
||||||
CPPFLAGS="$CPPFLAGS -I${yap_cv_postgres}/include "
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_postgres}/include "
|
||||||
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_postgres}/include "
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_postgres}/include "
|
||||||
fi,
|
fi,
|
||||||
@ -188,7 +194,9 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
MYDDAS_LIBS="$LIBS"
|
MYDDAS_LDFLAGS="$LDFLAGS"
|
||||||
|
MYDDAS_LIBS="$LIBS"
|
||||||
|
MYDDAS_LIBS="$LIBS"
|
||||||
LIBS="$OLD_LIBS"
|
LIBS="$OLD_LIBS"
|
||||||
CPPFLAGS="$OLD_CPPFLAGS"
|
CPPFLAGS="$OLD_CPPFLAGS"
|
||||||
else
|
else
|
||||||
@ -206,3 +214,4 @@ AC_SUBST(PKG_MYDDAS)
|
|||||||
AC_SUBST(OBJECTS_MYDDAS)
|
AC_SUBST(OBJECTS_MYDDAS)
|
||||||
AC_SUBST(MYDDAS_CPPFLAGS)
|
AC_SUBST(MYDDAS_CPPFLAGS)
|
||||||
AC_SUBST(MYDDAS_LIBS)
|
AC_SUBST(MYDDAS_LIBS)
|
||||||
|
AC_SUBST(MYDDAS_LDFLAGS)
|
||||||
|
@ -88,8 +88,8 @@ myddas_init_initialize_connection(void *conn,void *enviromment,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MYDDAS_UTIL_PREDICATE
|
MYDDAS_UTIL_PREDICATE
|
||||||
myddas_init_initialize_predicate(char *pred_name, int pred_arity,
|
myddas_init_initialize_predicate(const char *pred_name, int pred_arity,
|
||||||
char *pred_module, MYDDAS_UTIL_PREDICATE next){
|
const char *pred_module, MYDDAS_UTIL_PREDICATE next){
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
MYDDAS_UTIL_PREDICATE new = NULL;
|
MYDDAS_UTIL_PREDICATE new = NULL;
|
||||||
MYDDAS_MALLOC(new,struct myddas_list_preds);
|
MYDDAS_MALLOC(new,struct myddas_list_preds);
|
||||||
|
@ -317,9 +317,9 @@ c_db_odbc_connect( USES_REGS1 ) {
|
|||||||
|
|
||||||
MYDDAS_UTIL_CONNECTION new = NULL;
|
MYDDAS_UTIL_CONNECTION new = NULL;
|
||||||
|
|
||||||
char *driver = AtomName(AtomOfTerm(arg_driver));
|
const char *driver = AtomName(AtomOfTerm(arg_driver));
|
||||||
char *user = AtomName(AtomOfTerm(arg_user));
|
const char *user = AtomName(AtomOfTerm(arg_user));
|
||||||
char *passwd = AtomName(AtomOfTerm(arg_passwd));
|
const char *passwd = AtomName(AtomOfTerm(arg_passwd));
|
||||||
|
|
||||||
SQLHENV henv;
|
SQLHENV henv;
|
||||||
SQLHDBC hdbc;
|
SQLHDBC hdbc;
|
||||||
@ -447,7 +447,7 @@ c_db_odbc_number_of_fields( USES_REGS1 ) {
|
|||||||
Term arg_fields = Deref(ARG3);
|
Term arg_fields = Deref(ARG3);
|
||||||
|
|
||||||
|
|
||||||
char *relation = AtomName(AtomOfTerm(arg_relation));
|
const char *relation = AtomName(AtomOfTerm(arg_relation));
|
||||||
|
|
||||||
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
||||||
SQLHSTMT hstmt;
|
SQLHSTMT hstmt;
|
||||||
@ -487,7 +487,7 @@ c_db_odbc_get_attributes_types( USES_REGS1 ) {
|
|||||||
Term arg_conn = Deref(ARG2);
|
Term arg_conn = Deref(ARG2);
|
||||||
Term arg_types_list = Deref(ARG3);
|
Term arg_types_list = Deref(ARG3);
|
||||||
|
|
||||||
char *relation = AtomName(AtomOfTerm(arg_relation));
|
const char *relation = AtomName(AtomOfTerm(arg_relation));
|
||||||
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
||||||
SQLHSTMT hstmt;
|
SQLHSTMT hstmt;
|
||||||
|
|
||||||
@ -690,7 +690,7 @@ c_db_odbc_number_of_fields_in_query( USES_REGS1 ) {
|
|||||||
Term arg_conn = Deref(ARG2);
|
Term arg_conn = Deref(ARG2);
|
||||||
Term arg_fields = Deref(ARG3);
|
Term arg_fields = Deref(ARG3);
|
||||||
|
|
||||||
char *sql = AtomName(AtomOfTerm(arg_query));
|
const char *sql = AtomName(AtomOfTerm(arg_query));
|
||||||
|
|
||||||
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
||||||
SQLHSTMT hstmt;
|
SQLHSTMT hstmt;
|
||||||
|
@ -428,8 +428,8 @@ c_postgres_query( USES_REGS1 ) {
|
|||||||
Term arg_mode = Deref(ARG4);
|
Term arg_mode = Deref(ARG4);
|
||||||
Term arg_arity = ARG5;
|
Term arg_arity = ARG5;
|
||||||
|
|
||||||
char *sql = AtomName(AtomOfTerm(arg_sql_query));
|
const char *sql = AtomName(AtomOfTerm(arg_sql_query));
|
||||||
char *mode = AtomName(AtomOfTerm(arg_mode));
|
const char *mode = AtomName(AtomOfTerm(arg_mode));
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
PGconn *db = AddressOfTerm(arg_db);
|
PGconn *db = AddressOfTerm(arg_db);
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ c_postgres_number_of_fields( USES_REGS1 ) {
|
|||||||
Term arg_db = Deref(ARG2);
|
Term arg_db = Deref(ARG2);
|
||||||
Term arg_fields = ARG3;
|
Term arg_fields = ARG3;
|
||||||
|
|
||||||
char *relation = AtomName(AtomOfTerm(arg_relation));
|
const char *relation = AtomName(AtomOfTerm(arg_relation));
|
||||||
PGconn *db = AddressOfTerm(arg_db);
|
PGconn *db = AddressOfTerm(arg_db);
|
||||||
const char *stmt;
|
const char *stmt;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
@ -537,16 +537,18 @@ c_postgres_get_attributes_types( USES_REGS1 ) {
|
|||||||
Term arg_types_list = Deref(ARG3);
|
Term arg_types_list = Deref(ARG3);
|
||||||
Term list, head;
|
Term list, head;
|
||||||
|
|
||||||
char *relation = AtomName(AtomOfTerm(arg_relation));
|
const char *relation = AtomName(AtomOfTerm(arg_relation));
|
||||||
PGconn *db = AddressOfTerm(arg_db);
|
PGconn *db = AddressOfTerm(arg_db);
|
||||||
char sql[256];
|
char sql[256];
|
||||||
int row;
|
//int row;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
const char *stmt;
|
const char *stmt;
|
||||||
Int rc = TRUE;
|
Int rc = TRUE;
|
||||||
|
|
||||||
sprintf(sql,"SELECT * FROM TABLE `%s`",relation);
|
sprintf(sql,"SELECT * FROM TABLE `%s`",relation);
|
||||||
|
// Leave data for extraction
|
||||||
|
stmt = AtomName(Yap_LookupAtom(sql));
|
||||||
// Leave data for extraction
|
// Leave data for extraction
|
||||||
GET_POSTGRES (prepare(db, stmt, sql, 0, NULL), res );
|
GET_POSTGRES (prepare(db, stmt, sql, 0, NULL), res );
|
||||||
|
|
||||||
@ -642,7 +644,7 @@ c_postgres_get_fields_properties( USES_REGS1 ) {
|
|||||||
Term head, list;
|
Term head, list;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
char *relation = AtomName(AtomOfTerm(nome_relacao));
|
const char *relation = AtomName(AtomOfTerm(nome_relacao));
|
||||||
char sql[256];
|
char sql[256];
|
||||||
Int num_fields,i;
|
Int num_fields,i;
|
||||||
PGconn *db = AddressOfTerm(arg_db);
|
PGconn *db = AddressOfTerm(arg_db);
|
||||||
@ -821,7 +823,7 @@ c_postgres_row( USES_REGS1 ) {
|
|||||||
PGresult *res;
|
PGresult *res;
|
||||||
while((res = PQgetResult(res_set->db)) != NULL);
|
while((res = PQgetResult(res_set->db)) != NULL);
|
||||||
int i;
|
int i;
|
||||||
if (i == res_set->nrows) {
|
if ((i = res_set->nrows) == 0) {
|
||||||
// no more data
|
// no more data
|
||||||
PQfinish( res_set->db );
|
PQfinish( res_set->db );
|
||||||
free(res_set);
|
free(res_set);
|
||||||
|
@ -154,8 +154,8 @@ c_db_add_preds ( USES_REGS1 ){
|
|||||||
/* pe = RepPredProp(PredPropByFunc(FunctorOfTerm(arg_pred),arg_module)); */
|
/* pe = RepPredProp(PredPropByFunc(FunctorOfTerm(arg_pred),arg_module)); */
|
||||||
|
|
||||||
|
|
||||||
char *nome = AtomName(AtomOfTerm(arg_nome));
|
const char *nome = AtomName(AtomOfTerm(arg_nome));
|
||||||
char *module = AtomName(AtomOfTerm(arg_module));
|
const char *module = AtomName(AtomOfTerm(arg_module));
|
||||||
Int aridade = IntegerOfTerm(arg_aridade);
|
Int aridade = IntegerOfTerm(arg_aridade);
|
||||||
Int *conn = (Int *) IntegerOfTerm(arg_conn);
|
Int *conn = (Int *) IntegerOfTerm(arg_conn);
|
||||||
|
|
||||||
@ -178,8 +178,8 @@ c_db_check_if_exists_pred ( USES_REGS1 ){
|
|||||||
Term arg_module = Deref(ARG3);
|
Term arg_module = Deref(ARG3);
|
||||||
|
|
||||||
|
|
||||||
char *nome = AtomName(AtomOfTerm(arg_nome));
|
const char *nome = AtomName(AtomOfTerm(arg_nome));
|
||||||
char *module = AtomName(AtomOfTerm(arg_module));
|
const char *module = AtomName(AtomOfTerm(arg_module));
|
||||||
Int aridade = IntegerOfTerm(arg_aridade);
|
Int aridade = IntegerOfTerm(arg_aridade);
|
||||||
|
|
||||||
if (myddas_util_search_predicate(nome,aridade,module) == NULL)
|
if (myddas_util_search_predicate(nome,aridade,module) == NULL)
|
||||||
@ -195,8 +195,8 @@ c_db_delete_predicate( USES_REGS1 ){
|
|||||||
Term arg_name = Deref(ARG2);
|
Term arg_name = Deref(ARG2);
|
||||||
Term arg_arity = Deref(ARG3);
|
Term arg_arity = Deref(ARG3);
|
||||||
|
|
||||||
char *module = AtomName(AtomOfTerm(arg_module));
|
const char *module = AtomName(AtomOfTerm(arg_module));
|
||||||
char *name = AtomName(AtomOfTerm(arg_name));
|
const char *name = AtomName(AtomOfTerm(arg_name));
|
||||||
Int arity = IntegerOfTerm(arg_arity);
|
Int arity = IntegerOfTerm(arg_arity);
|
||||||
|
|
||||||
MYDDAS_UTIL_PREDICATE predicate =
|
MYDDAS_UTIL_PREDICATE predicate =
|
||||||
|
@ -28,8 +28,8 @@ struct myddas_global {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct myddas_list_preds {
|
struct myddas_list_preds {
|
||||||
char *pred_module;
|
const char *pred_module;
|
||||||
char *pred_name;
|
const char *pred_name;
|
||||||
short pred_arity;
|
short pred_arity;
|
||||||
//void *pe;
|
//void *pe;
|
||||||
MYDDAS_UTIL_PREDICATE next;
|
MYDDAS_UTIL_PREDICATE next;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/* Search for the predicate in the given predicate list*/
|
/* Search for the predicate in the given predicate list*/
|
||||||
static MYDDAS_UTIL_PREDICATE
|
static MYDDAS_UTIL_PREDICATE
|
||||||
myddas_util_find_predicate(char *, Int , char *, MYDDAS_UTIL_PREDICATE);
|
myddas_util_find_predicate(const char *, Int , const char *, MYDDAS_UTIL_PREDICATE);
|
||||||
/* Deletes a predicate list */
|
/* Deletes a predicate list */
|
||||||
static void
|
static void
|
||||||
myddas_util_delete_predicate_list(MYDDAS_UTIL_PREDICATE);
|
myddas_util_delete_predicate_list(MYDDAS_UTIL_PREDICATE);
|
||||||
@ -58,8 +58,8 @@ myddas_util_connection_type(void *con){
|
|||||||
|
|
||||||
|
|
||||||
MYDDAS_UTIL_PREDICATE
|
MYDDAS_UTIL_PREDICATE
|
||||||
myddas_util_search_predicate(char *pred_name, Int pred_arity,
|
myddas_util_search_predicate(const char *pred_name, Int pred_arity,
|
||||||
char *pred_module){
|
const char *pred_module){
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
MYDDAS_UTIL_PREDICATE pred=NULL;
|
MYDDAS_UTIL_PREDICATE pred=NULL;
|
||||||
MYDDAS_UTIL_CONNECTION top = Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_top_connections;
|
MYDDAS_UTIL_CONNECTION top = Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_top_connections;
|
||||||
@ -75,8 +75,8 @@ myddas_util_search_predicate(char *pred_name, Int pred_arity,
|
|||||||
/* When using this function, we must guarante that this predicate
|
/* When using this function, we must guarante that this predicate
|
||||||
it's unique */
|
it's unique */
|
||||||
MYDDAS_UTIL_CONNECTION
|
MYDDAS_UTIL_CONNECTION
|
||||||
myddas_util_add_predicate(char *pred_name, Int pred_arity,
|
myddas_util_add_predicate(const char *pred_name, Int pred_arity,
|
||||||
char *pred_module, void *con){
|
const char *pred_module, void *con){
|
||||||
|
|
||||||
MYDDAS_UTIL_CONNECTION node_con =
|
MYDDAS_UTIL_CONNECTION node_con =
|
||||||
myddas_util_search_connection(con);
|
myddas_util_search_connection(con);
|
||||||
@ -231,8 +231,8 @@ void myddas_util_error_message(char *message ,Int line,char *file){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static MYDDAS_UTIL_PREDICATE
|
static MYDDAS_UTIL_PREDICATE
|
||||||
myddas_util_find_predicate(char *pred_name, Int pred_arity,
|
myddas_util_find_predicate(const char *pred_name, Int pred_arity,
|
||||||
char *pred_module, MYDDAS_UTIL_PREDICATE list){
|
const char *pred_module, MYDDAS_UTIL_PREDICATE list){
|
||||||
|
|
||||||
for(;list != NULL ; list = list->next)
|
for(;list != NULL ; list = list->next)
|
||||||
if (pred_arity == list->pred_arity &&
|
if (pred_arity == list->pred_arity &&
|
||||||
@ -348,13 +348,13 @@ myddas_util_get_pred_arity(void *pointer){
|
|||||||
return temp->pred_arity;
|
return temp->pred_arity;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
myddas_util_get_pred_name(void *pointer){
|
myddas_util_get_pred_name(void *pointer){
|
||||||
MYDDAS_UTIL_PREDICATE temp = (MYDDAS_UTIL_PREDICATE) pointer;
|
MYDDAS_UTIL_PREDICATE temp = (MYDDAS_UTIL_PREDICATE) pointer;
|
||||||
return temp->pred_name;
|
return temp->pred_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
myddas_util_get_pred_module(void *pointer){
|
myddas_util_get_pred_module(void *pointer){
|
||||||
MYDDAS_UTIL_PREDICATE temp = (MYDDAS_UTIL_PREDICATE) pointer;
|
MYDDAS_UTIL_PREDICATE temp = (MYDDAS_UTIL_PREDICATE) pointer;
|
||||||
return temp->pred_module;
|
return temp->pred_module;
|
||||||
|
Reference in New Issue
Block a user