Merge branch 'master' of /cygdrive/z/vitor/Yap/yap-6.3
This commit is contained in:
@@ -241,6 +241,8 @@ tokenize_arguments([FirstArg|RestArgs],[TokFirstArg|TokRestArgs]):-
|
||||
%
|
||||
% --------------------------------------------------------------------------------------
|
||||
|
||||
:- dynamic attribute/4.
|
||||
|
||||
query_generation([],_,[]).
|
||||
|
||||
query_generation([Conjunction|Conjunctions],ProjectionTerm,[Query|Queries]):-
|
||||
@@ -1157,9 +1159,9 @@ column_atom(att(RangeVar,Attribute),QueryList,Diff):-
|
||||
column_atom(Attribute,X2,Diff).
|
||||
|
||||
column_atom(rel(Relation,RangeVar),QueryList,Diff):-
|
||||
column_atom('`',QueryList,X0),
|
||||
column_atom('',QueryList,X0),
|
||||
column_atom(Relation,X0,X1),
|
||||
column_atom('` ',X1,X2),
|
||||
column_atom(' ',X1,X2),
|
||||
column_atom(RangeVar,X2,Diff).
|
||||
|
||||
column_atom('$const$'(String),QueryList,Diff):-
|
||||
|
@@ -142,12 +142,6 @@ p2c_putc(const int c) {
|
||||
/*
|
||||
* Function used by YAP to read a char from a string
|
||||
*/
|
||||
static int
|
||||
p2c_getc(void) {
|
||||
if( BUFFER_POS < BUFFER_LEN )
|
||||
return BUFFER_PTR[BUFFER_POS++];
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* Writes a term to a stream.
|
||||
*/
|
||||
@@ -177,7 +171,7 @@ read_term_from_stream(const int fd) {
|
||||
if ( size> BUFFER_SIZE)
|
||||
expand_buffer(size-BUFFER_SIZE);
|
||||
read(fd,BUFFER_PTR,size); // read term from stream
|
||||
return YAP_Read( p2c_getc );
|
||||
return YAP_ReadBuffer( BUFFER_PTR , NULL);
|
||||
}
|
||||
/*********************************************************************************************
|
||||
* Conversion: Prolog Term->char[] and char[]->Prolog Term
|
||||
@@ -229,7 +223,7 @@ string2term(char *const ptr,const size_t *size) {
|
||||
}
|
||||
BUFFER_POS=0;
|
||||
LOCAL_ErrorMessage=NULL;
|
||||
t = YAP_Read(p2c_getc);
|
||||
t = YAP_ReadBuffer( BUFFER_PTR , NULL );
|
||||
if ( t==FALSE ) {
|
||||
write_msg(__FUNCTION__,__FILE__,__LINE__,"FAILED string2term>>>>size:%d %d %s\n",BUFFER_SIZE,strlen(BUFFER_PTR),LOCAL_ErrorMessage);
|
||||
exit(1);
|
||||
|
@@ -30,7 +30,6 @@ static char *rcsid = "$Header: /Users/vitor/Yap/yap-cvsbackup/library/mpi/mpi.c,
|
||||
#include <string.h>
|
||||
#include <mpi.h>
|
||||
|
||||
Term STD_PROTO(YAP_Read, (int (*)(void)));
|
||||
void STD_PROTO(YAP_Write, (Term, void (*)(int), int));
|
||||
|
||||
STATIC_PROTO (Int p_mpi_open, (void));
|
||||
@@ -105,15 +104,6 @@ mpi_putc(Int ch)
|
||||
}
|
||||
}
|
||||
|
||||
static Int
|
||||
mpi_getc(void)
|
||||
{
|
||||
if( bufptr < bufsize ) return buf[bufptr++];
|
||||
else return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* C Predicates
|
||||
@@ -301,7 +291,7 @@ p_mpi_receive() /* mpi_receive(-data, ?orig, ?tag) */
|
||||
/* parse received string into a Prolog term */
|
||||
|
||||
bufptr = 0;
|
||||
t = YAP_Read( mpi_getc );
|
||||
t = YAP_ReadBuffer( buf, NULL );
|
||||
|
||||
if( t == TermNil ) {
|
||||
retv = FALSE;
|
||||
@@ -384,7 +374,7 @@ p_mpi_bcast3() /* mpi_bcast( ?data, +root, +max_size ) */
|
||||
bufptr = 0;
|
||||
|
||||
/* parse received string into a Prolog term */
|
||||
return Yap_unify( YAP_Read(mpi_getc), ARG1 );
|
||||
return Yap_unify( YAP_ReadBuffer( buf, NULL ), ARG1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +454,7 @@ p_mpi_bcast2() /* mpi_bcast( ?data, +root ) */
|
||||
bufstrlen = strlen(buf);
|
||||
bufptr = 0;
|
||||
|
||||
return Yap_unify(YAP_Read( mpi_getc ), ARG1);
|
||||
return Yap_unify(YAP_ReadBuffer( buf, NULL ), ARG1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user