a question of size
This commit is contained in:
parent
53822922c8
commit
98a5538f45
@ -184,9 +184,7 @@ LookupAtom(const unsigned char *atom) { /* lookup atom in atom table */
|
|||||||
#endif
|
#endif
|
||||||
/* add new atom to start of chain */
|
/* add new atom to start of chain */
|
||||||
size_t asz = strlen((const char *)atom);
|
size_t asz = strlen((const char *)atom);
|
||||||
|
ae = (AtomEntry *)Yap_AllocAtomSpace((sizeof *ae) + asz+1);
|
||||||
ae = (AtomEntry *)Yap_AllocAtomSpace((sizeof *ae) +
|
|
||||||
asz+4);
|
|
||||||
if (ae == NULL) {
|
if (ae == NULL) {
|
||||||
WRITE_UNLOCK(HashChain[hash].AERWLock);
|
WRITE_UNLOCK(HashChain[hash].AERWLock);
|
||||||
return NIL;
|
return NIL;
|
||||||
@ -194,7 +192,7 @@ LookupAtom(const unsigned char *atom) { /* lookup atom in atom table */
|
|||||||
NOfAtoms++;
|
NOfAtoms++;
|
||||||
na = AbsAtom(ae);
|
na = AbsAtom(ae);
|
||||||
ae->PropsOfAE = NIL;
|
ae->PropsOfAE = NIL;
|
||||||
stpncpy((char *)ae->StrOfAE, (const char *)atom, asz+1);
|
strcpy(ae->StrOfAE, (const char *)atom);
|
||||||
|
|
||||||
ae->NextOfAE = a;
|
ae->NextOfAE = a;
|
||||||
HashChain[hash].Entry = na;
|
HashChain[hash].Entry = na;
|
||||||
|
15
C/atomic.c
15
C/atomic.c
@ -800,7 +800,8 @@ restart_aux:
|
|||||||
ReleaseAndReturn(FALSE);
|
ReleaseAndReturn(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Int cont_atom_concat3(USES_REGS1) {
|
static Int
|
||||||
|
cont_atom_concat3(USES_REGS1) {
|
||||||
Term t3;
|
Term t3;
|
||||||
Atom ats[2];
|
Atom ats[2];
|
||||||
Int i, max;
|
Int i, max;
|
||||||
@ -858,7 +859,7 @@ restart_aux:
|
|||||||
ot = ARG1;
|
ot = ARG1;
|
||||||
} else if (g3) {
|
} else if (g3) {
|
||||||
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
||||||
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_AtomToLength(t3 PASS_REGS));
|
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_AtomToUnicodeLength(t3 PASS_REGS));
|
||||||
ReleaseAndReturn(cont_atom_concat3(PASS_REGS1));
|
ReleaseAndReturn(cont_atom_concat3(PASS_REGS1));
|
||||||
} else {
|
} else {
|
||||||
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
@ -948,7 +949,7 @@ restart_aux:
|
|||||||
ot = ARG1;
|
ot = ARG1;
|
||||||
} else if (g3) {
|
} else if (g3) {
|
||||||
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
||||||
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_AtomicToLength(t3 PASS_REGS));
|
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_AtomicToUnicodeLength(t3 PASS_REGS));
|
||||||
return cont_atomic_concat3(PASS_REGS1);
|
return cont_atomic_concat3(PASS_REGS1);
|
||||||
} else {
|
} else {
|
||||||
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
@ -1032,7 +1033,7 @@ restart_aux:
|
|||||||
ot = ARG1;
|
ot = ARG1;
|
||||||
} else if (g3) {
|
} else if (g3) {
|
||||||
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
|
||||||
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_StringToLength(t3 PASS_REGS));
|
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_StringToUnicodeLength(t3 PASS_REGS));
|
||||||
pop_text_stack(l);
|
pop_text_stack(l);
|
||||||
return cont_string_concat3(PASS_REGS1);
|
return cont_string_concat3(PASS_REGS1);
|
||||||
} else {
|
} else {
|
||||||
@ -1482,7 +1483,7 @@ static Int atom_length(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
restart_aux:
|
restart_aux:
|
||||||
len = Yap_AtomicToLength(t1 PASS_REGS);
|
len = Yap_AtomToUnicodeLength(t1 PASS_REGS);
|
||||||
if (len != (size_t)-1)
|
if (len != (size_t)-1)
|
||||||
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
||||||
/* error handling */
|
/* error handling */
|
||||||
@ -1523,7 +1524,7 @@ static Int atomic_length(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
restart_aux:
|
restart_aux:
|
||||||
len = Yap_AtomicToLength(t1 PASS_REGS);
|
len = Yap_AtomicToUnicodeLength(t1 PASS_REGS);
|
||||||
if (len != (size_t)-1)
|
if (len != (size_t)-1)
|
||||||
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
||||||
/* error handling */
|
/* error handling */
|
||||||
@ -1552,7 +1553,7 @@ static Int string_length(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
restart_aux:
|
restart_aux:
|
||||||
t1 = Deref(ARG1);
|
t1 = Deref(ARG1);
|
||||||
len = Yap_AtomicToLength(t1 PASS_REGS);
|
len = Yap_StringToUnicodeLength(t1 PASS_REGS);
|
||||||
if (len != (size_t)-1)
|
if (len != (size_t)-1)
|
||||||
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
ReleaseAndReturn(Yap_unify(ARG2, MkIntegerTerm(len)));
|
||||||
/* error handling */
|
/* error handling */
|
||||||
|
141
C/text.c
141
C/text.c
@ -188,18 +188,18 @@ static Term Globalize(Term v USES_REGS) {
|
|||||||
static Int SkipListCodes(unsigned char **bufp, Term *l, Term **tailp,
|
static Int SkipListCodes(unsigned char **bufp, Term *l, Term **tailp,
|
||||||
Int *atoms, bool *wide, seq_tv_t *inp USES_REGS) {
|
Int *atoms, bool *wide, seq_tv_t *inp USES_REGS) {
|
||||||
Int length = 0;
|
Int length = 0;
|
||||||
Term *s; /* slow */
|
|
||||||
Term v; /* temporary */
|
Term v; /* temporary */
|
||||||
*wide = false;
|
*wide = false;
|
||||||
unsigned char *st0 = *bufp, *st;
|
unsigned char *st0 = *bufp, *st;
|
||||||
|
bool atomst;
|
||||||
|
size_t max_lim = 1024;
|
||||||
|
|
||||||
if (!st0) {
|
if (!st0) {
|
||||||
st0 = Malloc(0);
|
st0 = Malloc(1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_derefa(v, l, derefa_unk, derefa_nonvar);
|
do_derefa(v, l, derefa_unk, derefa_nonvar);
|
||||||
*tailp = l;
|
*tailp = l;
|
||||||
s = l;
|
|
||||||
|
|
||||||
*bufp = st = st0;
|
*bufp = st = st0;
|
||||||
|
|
||||||
@ -208,66 +208,61 @@ static Int SkipListCodes(unsigned char **bufp, Term *l, Term **tailp,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (IsPairTerm(*l)) {
|
if (IsPairTerm(*l)) {
|
||||||
Term hd0 = HeadOfTerm(*l);
|
Term hd0 = HeadOfTerm(*l);
|
||||||
if (IsVarTerm(hd0)) {
|
if (IsVarTerm(hd0)) {
|
||||||
return -INSTANTIATION_ERROR;
|
|
||||||
}
|
|
||||||
// are we looking for atoms/codes?
|
|
||||||
// whatever the case, we should be consistent throughout,
|
|
||||||
// so we should be consistent with the first arg.
|
|
||||||
if (*atoms == 1) {
|
|
||||||
if (!IsIntegerTerm(hd0)) {
|
|
||||||
return -INSTANTIATION_ERROR;
|
|
||||||
}
|
|
||||||
} else if (*atoms == 2) {
|
|
||||||
if (!IsAtomTerm(hd0)) {
|
|
||||||
return -TYPE_ERROR_ATOM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
int ch;
|
|
||||||
length++;
|
|
||||||
{
|
|
||||||
Term hd = Deref(RepPair(*l)[0]);
|
|
||||||
if (IsVarTerm(hd)) {
|
|
||||||
return -INSTANTIATION_ERROR;
|
return -INSTANTIATION_ERROR;
|
||||||
} else if (IsAtomTerm(hd)) {
|
}
|
||||||
(*atoms)++;
|
// are we looking for atoms/codes?
|
||||||
if (*atoms < length) {
|
// whatever the case, we should be consistent throughout,
|
||||||
*tailp = l;
|
// so we should be consistent with the first arg.
|
||||||
return -REPRESENTATION_ERROR_CHARACTER_CODE;
|
if (st > st0+max_lim) {
|
||||||
} else {
|
max_lim += 2048;
|
||||||
AtomEntry *ae = RepAtom(AtomOfTerm(hd));
|
*bufp = st0 = Realloc(st0,max_lim);
|
||||||
st = stpcpy(st, ae->StrOfAE);
|
}
|
||||||
}
|
if (IsAtomTerm(hd0)) {
|
||||||
} else if (IsIntegerTerm(hd)) {
|
atomst = true;
|
||||||
ch = IntegerOfTerm(hd);
|
|
||||||
if (*atoms)
|
} else {
|
||||||
length = -REPRESENTATION_ERROR_CHARACTER;
|
atomst = false;
|
||||||
else if (ch < 0) {
|
|
||||||
*tailp = l;
|
|
||||||
length = -REPRESENTATION_ERROR_CHARACTER_CODE;
|
|
||||||
} else {
|
|
||||||
*wide |= ch > 0x80;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
length = -TYPE_ERROR_INTEGER;
|
|
||||||
}
|
|
||||||
if (length < 0) {
|
|
||||||
*tailp = l;
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
// now copy char to buffer
|
|
||||||
int chsz = put_utf8(st, ch);
|
|
||||||
if (chsz > 0) {
|
|
||||||
st += chsz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
l = RepPair(*l) + 1;
|
while ( IsPairTerm(*l)) {
|
||||||
do_derefa(v, l, derefa2_unk, derefa2_nonvar);
|
int ch;
|
||||||
} while (*l != *s && IsPairTerm(*l));
|
length++;
|
||||||
|
{
|
||||||
|
Term hd = Deref(RepPair(*l)[0]);
|
||||||
|
if (IsVarTerm(hd)) {
|
||||||
|
return -INSTANTIATION_ERROR;
|
||||||
|
} else if (IsAtomTerm(hd)) {
|
||||||
|
if (!atomst) {
|
||||||
|
return -REPRESENTATION_ERROR_CHARACTER;
|
||||||
|
} else {
|
||||||
|
AtomEntry *ae = RepAtom(AtomOfTerm(hd));
|
||||||
|
st = (unsigned char *) stpcpy( ( char *)st, ae->StrOfAE);
|
||||||
|
}
|
||||||
|
} else if (IsIntegerTerm(hd)) {
|
||||||
|
ch = IntegerOfTerm(hd);
|
||||||
|
if (atomst)
|
||||||
|
return -REPRESENTATION_ERROR_CHARACTER;
|
||||||
|
else if (ch < 0) {
|
||||||
|
*tailp = l;
|
||||||
|
return -REPRESENTATION_ERROR_CHARACTER_CODE;
|
||||||
|
} else {
|
||||||
|
st += put_utf8(st,ch);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return -TYPE_ERROR_INTEGER;
|
||||||
|
}
|
||||||
|
if (length < 0) {
|
||||||
|
*tailp = l;
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
l = RepPair(*l) + 1;
|
||||||
|
do_derefa(v, l, derefa2_unk, derefa2_nonvar);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (IsVarTerm(*l)) {
|
if (IsVarTerm(*l)) {
|
||||||
return -INSTANTIATION_ERROR;
|
return -INSTANTIATION_ERROR;
|
||||||
@ -315,7 +310,7 @@ static unsigned char *wchar2utf8(seq_tv_t *inp, size_t *lengp) {
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *slice(size_t min, size_t max, unsigned char *buf USES_REGS);
|
static void *slice(size_t min, size_t max, const unsigned char *buf USES_REGS);
|
||||||
|
|
||||||
static unsigned char *to_buffer(unsigned char *buf, Term t, seq_tv_t *inp,
|
static unsigned char *to_buffer(unsigned char *buf, Term t, seq_tv_t *inp,
|
||||||
bool *widep, Int *atoms,
|
bool *widep, Int *atoms,
|
||||||
@ -537,11 +532,10 @@ static Term write_strings(unsigned char *s0, seq_tv_t *out,
|
|||||||
Term t = init_tstring(PASS_REGS1);
|
Term t = init_tstring(PASS_REGS1);
|
||||||
LOCAL_TERM_ERROR(t, 2 * max);
|
LOCAL_TERM_ERROR(t, 2 * max);
|
||||||
unsigned char *buf = buf_from_tstring(HR);
|
unsigned char *buf = buf_from_tstring(HR);
|
||||||
strcpy( (char *)buf, s )
|
strcpy( (char *)buf, s );
|
||||||
;
|
|
||||||
if (max+1 < min) {
|
if (max+1 < min) {
|
||||||
LOCAL_TERM_ERROR(t, 2 * min);
|
LOCAL_TERM_ERROR(t, 2 * min);
|
||||||
memset(buf+min, max, '\0');
|
memset(buf+min, '\0', max);
|
||||||
buf += min;
|
buf += min;
|
||||||
} else {
|
} else {
|
||||||
buf += max+1;
|
buf += max+1;
|
||||||
@ -911,19 +905,6 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmp_Text(const unsigned char *s1, const unsigned char *s2, int l) {
|
|
||||||
const unsigned char *w1 = s1;
|
|
||||||
utf8proc_int32_t chr1, chr2;
|
|
||||||
const unsigned char *w2 = s2;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < l; i++) {
|
|
||||||
w2 += get_utf8(w2, -1, &chr2);
|
|
||||||
w1 += get_utf8(w1, -1, &chr1);
|
|
||||||
if (chr1 - chr2)
|
|
||||||
return chr1 - chr2;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned char *concat(int n, void *sv[] USES_REGS) {
|
static unsigned char *concat(int n, void *sv[] USES_REGS) {
|
||||||
void *buf;
|
void *buf;
|
||||||
@ -947,7 +928,7 @@ static unsigned char *concat(int n, void *sv[] USES_REGS) {
|
|||||||
return buf0;
|
return buf0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *slice(size_t min, size_t max, unsigned char *buf USES_REGS) {
|
static void *slice(size_t min, size_t max, const unsigned char *buf USES_REGS) {
|
||||||
unsigned char *nbuf = Malloc((max - min) * 4 + 1);
|
unsigned char *nbuf = Malloc((max - min) * 4 + 1);
|
||||||
const unsigned char *ptr = skip_utf8(buf, min);
|
const unsigned char *ptr = skip_utf8(buf, min);
|
||||||
unsigned char *nptr = nbuf;
|
unsigned char *nptr = nbuf;
|
||||||
@ -1018,7 +999,7 @@ bool Yap_Splice_Text(int n, size_t cuts[], seq_tv_t *inp,
|
|||||||
u_l1 = u_l - u_l0;
|
u_l1 = u_l - u_l0;
|
||||||
|
|
||||||
buf1 = slice(u_l0, u_l, buf PASS_REGS);
|
buf1 = slice(u_l0, u_l, buf PASS_REGS);
|
||||||
b_l1 = strlen(buf1);
|
b_l1 = strlen((const char *)buf1);
|
||||||
bool rc = write_Text(buf1, outv + 1, b_l1 PASS_REGS);
|
bool rc = write_Text(buf1, outv + 1, b_l1 PASS_REGS);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
return false;
|
return false;
|
||||||
@ -1032,7 +1013,7 @@ bool Yap_Splice_Text(int n, size_t cuts[], seq_tv_t *inp,
|
|||||||
u_l1 = strlen_utf8(buf1);
|
u_l1 = strlen_utf8(buf1);
|
||||||
b_l0 = b_l - b_l1;
|
b_l0 = b_l - b_l1;
|
||||||
u_l0 = u_l - u_l1;
|
u_l0 = u_l - u_l1;
|
||||||
if (bcmp(skip_utf8((const char *)buf, b_l0), buf1, b_l1) !=
|
if (bcmp(skip_utf8((const unsigned char *)buf, b_l0), buf1, b_l1) !=
|
||||||
0) {
|
0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,6 @@ int Yap_FormatFloat(Float f, char **s, size_t sz) {
|
|||||||
wglb.lw = separator;
|
wglb.lw = separator;
|
||||||
wglb.stream = GLOBAL_Stream + sno;
|
wglb.stream = GLOBAL_Stream + sno;
|
||||||
wrputf(f, &wglb);
|
wrputf(f, &wglb);
|
||||||
wrputc('\0', wglb.stream);
|
|
||||||
so = Yap_MemExportStreamPtr(sno);
|
so = Yap_MemExportStreamPtr(sno);
|
||||||
*s = Malloc( strlen(so) )+1;
|
*s = Malloc( strlen(so) )+1;
|
||||||
strcpy(*s, so );
|
strcpy(*s, so );
|
||||||
|
@ -12,9 +12,10 @@ string(REGEX REPLACE "^LOCAL[^(]*[(][ \t]*([^,]+)[ \t]*,[ \t]*([^),]+).*" "#de
|
|||||||
list( APPEND tmp2 ${i2} "\n")
|
list( APPEND tmp2 ${i2} "\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
file( WRITE ${CMAKE_TOP_BINARY_DIR}/dlocals.h ${tmp2})
|
file( WRITE ${CMAKE_TOP_BINARY_DIR}/dlocals.h ${tmp2})
|
||||||
|
|
||||||
|
add_custom_command( OUTPUT ${CMAKE_TOP_BINARY_DIR}/dlocals.h
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E COPY ${CMAKE_TOP_BINARY_DIR}/deflocals.h ${CMAKE_TOP_BINARY_DIR}/dlocals.h
|
||||||
|
DEPENDS locals.h )
|
||||||
|
|
||||||
|
|
||||||
install (FILES ${PL_SOURCES}
|
|
||||||
DESTINATION ${libpl}/pl
|
|
||||||
)
|
|
||||||
|
2062
H/YapText.h
2062
H/YapText.h
File diff suppressed because it is too large
Load Diff
@ -376,6 +376,7 @@ static void AdjustSwitchTable__(op_numbers op, yamop *table,
|
|||||||
startcode += 2;
|
startcode += 2;
|
||||||
}
|
}
|
||||||
/* adjust fail code */
|
/* adjust fail code */
|
||||||
|
|
||||||
startcode[1] = (CELL)CodeAddrAdjust((CODEADDR)startcode[1]);
|
startcode[1] = (CELL)CodeAddrAdjust((CODEADDR)startcode[1]);
|
||||||
} break;
|
} break;
|
||||||
case _if_cons: {
|
case _if_cons: {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -379,8 +379,8 @@ typedef void (*YAP_halt_hook)(int exit_code, void *closure);
|
|||||||
/* each type has a tag */
|
/* each type has a tag */
|
||||||
typedef YAP_Int YAP_opaque_tag_t;
|
typedef YAP_Int YAP_opaque_tag_t;
|
||||||
|
|
||||||
typedef YAP_Bool (*YAP_Opaque_CallOnFail)(YAP_Term);
|
typedef YAP_Bool (*YAP_Opaque_CallOnFail)(void *);
|
||||||
typedef YAP_Bool (*YAP_Opaque_CallOnCut)(YAP_Term);
|
typedef YAP_Bool (*YAP_Opaque_CallOnCut)(void *);
|
||||||
typedef YAP_Bool (*YAP_Opaque_CallOnWrite)(FILE *, YAP_opaque_tag_t, void *,
|
typedef YAP_Bool (*YAP_Opaque_CallOnWrite)(FILE *, YAP_opaque_tag_t, void *,
|
||||||
int);
|
int);
|
||||||
typedef YAP_Int (*YAP_Opaque_CallOnGCMark)(YAP_opaque_tag_t, void *, YAP_Term *,
|
typedef YAP_Int (*YAP_Opaque_CallOnGCMark)(YAP_opaque_tag_t, void *, YAP_Term *,
|
||||||
@ -390,7 +390,7 @@ typedef YAP_Bool (*YAP_Opaque_CallOnGCRelocate)(YAP_opaque_tag_t, void *,
|
|||||||
/// opaque variables can interact with the system
|
/// opaque variables can interact with the system
|
||||||
typedef struct YAP_opaque_handler_struct {
|
typedef struct YAP_opaque_handler_struct {
|
||||||
YAP_Opaque_CallOnCut cut_handler; //< called at cut, which may be a forward
|
YAP_Opaque_CallOnCut cut_handler; //< called at cut, which may be a forward
|
||||||
// cut or an exception.
|
//cut or an exception.
|
||||||
YAP_Opaque_CallOnFail
|
YAP_Opaque_CallOnFail
|
||||||
fail_handler; //< called at exit, it can be used to cleanup resources
|
fail_handler; //< called at exit, it can be used to cleanup resources
|
||||||
YAP_Opaque_CallOnWrite write_handler; //< text representation
|
YAP_Opaque_CallOnWrite write_handler; //< text representation
|
||||||
|
@ -1089,6 +1089,7 @@ bool Yap_initStream(int sno, FILE *fd, const char *name, Term file_name,
|
|||||||
|
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
char buf[YAP_FILENAME_MAX + 1];
|
char buf[YAP_FILENAME_MAX + 1];
|
||||||
|
memset(buf, 0, YAP_FILENAME_MAX + 1);
|
||||||
name = Yap_guessFileName(fd, sno, buf, YAP_FILENAME_MAX);
|
name = Yap_guessFileName(fd, sno, buf, YAP_FILENAME_MAX);
|
||||||
if (name)
|
if (name)
|
||||||
st->name = Yap_LookupAtom(name);
|
st->name = Yap_LookupAtom(name);
|
||||||
|
@ -286,7 +286,7 @@ form:
|
|||||||
+ symbols, including `(`, `)`, `,`, `;`
|
+ symbols, including `(`, `)`, `,`, `;`
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static Int scan_to_list(USE_ARGS1) {
|
static Int scan_to_list(USES_ARGS1) {
|
||||||
int inp_stream;
|
int inp_stream;
|
||||||
Term tpos, tout;
|
Term tpos, tout;
|
||||||
|
|
||||||
|
19
os/streams.c
19
os/streams.c
@ -300,7 +300,7 @@ has_reposition(int sno,
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *Yap_guessFileName(FILE *file, int sno, char *nameb, size_t max) {
|
char *Yap_guessFileName(FILE *file, int sno, char *nameb, size_t max) {
|
||||||
size_t maxs = Yap_Max(255, max);
|
size_t maxs = Yap_Max(1024, max);
|
||||||
if (!nameb) {
|
if (!nameb) {
|
||||||
nameb = malloc(maxs + 1);
|
nameb = malloc(maxs + 1);
|
||||||
}
|
}
|
||||||
@ -315,25 +315,30 @@ char *Yap_guessFileName(FILE *file, int sno, char *nameb, size_t max) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if __linux__
|
#if __linux__
|
||||||
char path[256];
|
char *path= malloc(1024);
|
||||||
if (snprintf(path, 255, "/proc/self/fd/%d", f) && readlink(path, nameb, max))
|
if (snprintf(path, 1023, "/proc/self/fd/%d", f) && readlink(path, nameb, maxs)) {
|
||||||
return nameb;
|
free(path);
|
||||||
|
return nameb;
|
||||||
|
}
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
if (fcntl(f, F_GETPATH, nameb) != -1) {
|
if (fcntl(f, F_GETPATH, nameb) != -1) {
|
||||||
return nameb;
|
return nameb;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
TCHAR path[MAX_PATH + 1];
|
TCHAR path= malloc(MAX_PATH + 1);
|
||||||
if (!GetFullPathName(path, MAX_PATH, path, NULL))
|
if (!GetFullPathName(path, MAX_PATH, path, NULL)) {
|
||||||
|
free(path);
|
||||||
return NULL;
|
return NULL;
|
||||||
else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
unsigned char *ptr = (unsigned char *)nameb;
|
unsigned char *ptr = (unsigned char *)nameb;
|
||||||
for (i = 0; i < strlen(path); i++)
|
for (i = 0; i < strlen(path); i++)
|
||||||
ptr += put_utf8(ptr, path[i]);
|
ptr += put_utf8(ptr, path[i]);
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
free(path);
|
||||||
return nameb;
|
return nameb;
|
||||||
}
|
}
|
||||||
|
free(path);
|
||||||
#endif
|
#endif
|
||||||
if (!StreamName(sno)) {
|
if (!StreamName(sno)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -13,6 +13,11 @@ set (SQLITE3_FOUND ON CACHE PRIVATE "")
|
|||||||
|
|
||||||
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
add_definitions(-DSQLITE_FCNTL_MMAP_SIZE=0 )
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA=1 )
|
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA=1 )
|
||||||
|
|
||||||
add_definitions(-DSQLITE_ENABLE_JSON1=1 )
|
add_definitions(-DSQLITE_ENABLE_JSON1=1 )
|
||||||
@ -27,39 +32,39 @@ SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 )
|
|||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
|
|
||||||
include_directories( .. src/Android/jni/sqlite src/Android/jni/sqlite/nativehelper )
|
include_directories( .. src/Android/jni/sqlite src/Android/jni/sqlite/nativehelper )
|
||||||
|
|
||||||
|
|
||||||
set(YAPSQLITE3_SOURCES
|
set(YAPSQLITE3_SOURCES
|
||||||
${YAPSQLITE3_SOURCES}
|
${YAPSQLITE3_SOURCES}
|
||||||
src/Android/jni/sqlite/JNIHelp.cpp
|
src/Android/jni/sqlite/JNIHelp.cpp
|
||||||
src/Android/jni/sqlite/JniConstants.cpp
|
src/Android/jni/sqlite/JniConstants.cpp
|
||||||
src/Android/jni/sqlite/android_database_SQLiteCommon.cpp
|
src/Android/jni/sqlite/android_database_SQLiteCommon.cpp
|
||||||
src/Android/jni/sqlite/android_database_SQLiteCommon.h
|
src/Android/jni/sqlite/android_database_SQLiteCommon.h
|
||||||
src/Android/jni/sqlite/android_database_SQLiteConnection.cpp
|
src/Android/jni/sqlite/android_database_SQLiteConnection.cpp
|
||||||
src/Android/jni/sqlite/android_database_SQLiteDebug.cpp
|
src/Android/jni/sqlite/android_database_SQLiteDebug.cpp
|
||||||
src/Android/jni/sqlite/android_database_SQLiteGlobal.cpp
|
src/Android/jni/sqlite/android_database_SQLiteGlobal.cpp
|
||||||
src/Android/jni/sqlite/nativehelper/jni.h
|
src/Android/jni/sqlite/nativehelper/jni.h
|
||||||
src/Android/jni/sqlite/nativehelper/JniConstants.h
|
src/Android/jni/sqlite/nativehelper/JniConstants.h
|
||||||
src/Android/jni/sqlite/nativehelper/JNIHelp.h
|
src/Android/jni/sqlite/nativehelper/JNIHelp.h
|
||||||
src/Android/jni/sqlite/nativehelper/ScopedLocalRef.h
|
src/Android/jni/sqlite/nativehelper/ScopedLocalRef.h
|
||||||
)
|
)
|
||||||
|
|
||||||
endif (ANDROID)
|
endif (ANDROID)
|
||||||
|
|
||||||
add_lib( Yapsqlite3
|
add_lib( Yapsqlite3
|
||||||
${YAPSQLITE3_SOURCES} )
|
${YAPSQLITE3_SOURCES} )
|
||||||
|
|
||||||
MY_set_target_properties(Yapsqlite3
|
MY_set_target_properties(Yapsqlite3
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
# RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION}
|
# RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION}
|
||||||
# SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION}
|
# SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION}
|
||||||
POSITION_INDEPENDENT_CODE TRUE
|
POSITION_INDEPENDENT_CODE TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Yapsqlite3 libYap)
|
target_link_libraries(Yapsqlite3 libYap)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
target_link_libraries(Yapsqlite3 android log)
|
target_link_libraries(Yapsqlite3 android log)
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
"""A setuptools based setup module.
|
#!/usr/bin/env python
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
See:
|
# Copyright (c) IPython Development Team.
|
||||||
https://packaging.python.org/en/latest/distributing.html
|
# Distributed under the terms of the Modified BSD License.
|
||||||
https://github.com/pypa/sampleproject
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import setuptools
|
||||||
"""
|
|
||||||
|
|
||||||
# Always prefer setuptools over distutils
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools.extension import Extension
|
from setuptools.extension import Extension
|
||||||
# To use a consistent encoding
|
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from os import path, makedirs, walk
|
from os import path, makedirs, walk
|
||||||
from shutil import copytree, rmtree, copy2, move
|
from shutil import copytree, rmtree, copy2, move
|
||||||
@ -19,81 +16,165 @@ from pathlib import Path
|
|||||||
import platform
|
import platform
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
my_extra_link_args = []
|
# the name of the package
|
||||||
if platform.system() == 'Darwin':
|
name = 'YAP4PY'
|
||||||
my_extra_link_args = ['-Wl,-rpath','-Wl,']
|
|
||||||
so = 'dylib'
|
|
||||||
#or dll in glob('yap/dlls/*'):
|
|
||||||
# move( dll ,'lib' )
|
|
||||||
pls = []
|
|
||||||
for (r,d,fs) in walk('yap/pl'):
|
|
||||||
for f in fs:
|
|
||||||
pls += [os.path.join(r, f)]
|
|
||||||
for (r,d,fs) in walk('yap'):
|
|
||||||
for f in fs:
|
|
||||||
pls += [os.path.join(r, f)]
|
|
||||||
# for f in glob( 'lib*.*' ):
|
|
||||||
# ofile.write(f+"\n")
|
|
||||||
cplus=['../../../CXX/yapi.cpp']
|
|
||||||
py2yap=['../../../packages/python/python.c',
|
|
||||||
'../../../packages/python/pl2py.c',
|
|
||||||
'../../../packages/python/pybips.c',
|
|
||||||
'../../../packages/python/py2pl.c',
|
|
||||||
'../../../packages/python/pl2pl.c',
|
|
||||||
'../../../packages/python/pypreds.c'
|
|
||||||
]
|
|
||||||
python_sources = ['yapPYTHON_wrap.cxx']+py2yap+cplus
|
|
||||||
here = path.abspath(path.dirname(__file__))
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Minimal Python version sanity check
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
v = sys.version_info
|
||||||
|
if v[:2] < (2, 7) or (v[0] >= 3 and v[:2] < (3, 3)):
|
||||||
|
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
|
||||||
|
print(error, file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
PY3 = (sys.version_info[0] >= 3)
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# get on with it
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
from codecs import open
|
||||||
|
from os import path, makedirs, walk
|
||||||
|
from shutil import copytree, rmtree, copy2, move
|
||||||
|
from glob import glob
|
||||||
|
from pathlib import Path
|
||||||
|
import platform
|
||||||
|
import os.path
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
pjoin = os.path.join
|
||||||
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
#pkg_root = pjoin(here, name)
|
||||||
|
|
||||||
|
sys.path.insert(0, "/home/vsc/github/yap-6.3/packages/python/swig")
|
||||||
|
|
||||||
|
my_extra_link_args = []
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
local_libs = []
|
||||||
|
win_libs = ['wsock32','ws2_32']
|
||||||
|
my_extra_link_args = ['-Wl,-export-all-symbols']
|
||||||
|
else:
|
||||||
|
# if platform.system() == 'Darwin':
|
||||||
|
my_extra_link_args = ['-Wl,-rpath', '-Wl,']
|
||||||
|
win_libs = []
|
||||||
|
local_libs = ['YAP++','Py4YAP']
|
||||||
|
# or dll in glob('yap/dlls/*'):
|
||||||
|
# move( dll ,'lib' )
|
||||||
|
|
||||||
|
native_sources = ["yap.i"]
|
||||||
|
|
||||||
|
for i in '/home/vsc/github/yap-6.3/packages/python/swig/yap4py/yapi.py;/home/vsc/github/yap-6.3/packages/python/swig/yap4py/__init__.py;/home/vsc/github/yap-6.3/packages/python/swig/yap4py/__main__.py'.split(";"):
|
||||||
|
copy2(i, 'yap4py')
|
||||||
|
for i in '/home/vsc/github/yap-6.3/packages/python/python.pl;/home/vsc/github/yap-6.3/library/INDEX.pl;/home/vsc/github/yap-6.3/library/apply.yap;/home/vsc/github/yap-6.3/library/apply_macros.yap;/home/vsc/github/yap-6.3/library/arg.yap;/home/vsc/github/yap-6.3/library/assoc.yap;/home/vsc/github/yap-6.3/library/atts.yap;/home/vsc/github/yap-6.3/library/autoloader.yap;/home/vsc/github/yap-6.3/library/avl.yap;/home/vsc/github/yap-6.3/library/bhash.yap;/home/vsc/github/yap-6.3/library/charsio.yap;/home/vsc/github/yap-6.3/library/clauses.yap;/home/vsc/github/yap-6.3/library/coinduction.yap;/home/vsc/github/yap-6.3/library/dbqueues.yap;/home/vsc/github/yap-6.3/library/dbusage.yap;/home/vsc/github/yap-6.3/library/dgraphs.yap;/home/vsc/github/yap-6.3/library/exo_interval.yap;/home/vsc/github/yap-6.3/library/expand_macros.yap;/home/vsc/github/yap-6.3/library/gensym.yap;/home/vsc/github/yap-6.3/library/hacks.yap;/home/vsc/github/yap-6.3/library/heaps.yap;/home/vsc/github/yap-6.3/library/lambda.pl;/home/vsc/github/yap-6.3/library/lineutils.yap;/home/vsc/github/yap-6.3/library/listing.yap;/home/vsc/github/yap-6.3/library/lists.yap;/home/vsc/github/yap-6.3/library/log2md.yap;/home/vsc/github/yap-6.3/library/nb.yap;/home/vsc/github/yap-6.3/library/ordsets.yap;/home/vsc/github/yap-6.3/library/mapargs.yap;/home/vsc/github/yap-6.3/library/maplist.yap;/home/vsc/github/yap-6.3/library/maputils.yap;/home/vsc/github/yap-6.3/library/matlab.yap;/home/vsc/github/yap-6.3/library/matrix.yap;/home/vsc/github/yap-6.3/library/prandom.yap;/home/vsc/github/yap-6.3/library/queues.yap;/home/vsc/github/yap-6.3/library/random.yap;/home/vsc/github/yap-6.3/library/range.yap;/home/vsc/github/yap-6.3/library/rbtrees.yap;/home/vsc/github/yap-6.3/library/regexp.yap;/home/vsc/github/yap-6.3/library/readutil.yap;/home/vsc/github/yap-6.3/library/rltree.yap;/home/vsc/github/yap-6.3/library/sockets.yap;/home/vsc/github/yap-6.3/library/splay.yap;/home/vsc/github/yap-6.3/library/stringutils.yap;/home/vsc/github/yap-6.3/library/system.yap;/home/vsc/github/yap-6.3/library/terms.yap;/home/vsc/github/yap-6.3/library/tries.yap;/home/vsc/github/yap-6.3/library/itries.yap;/home/vsc/github/yap-6.3/library/timeout.yap;/home/vsc/github/yap-6.3/library/trees.yap;/home/vsc/github/yap-6.3/library/ugraphs.yap;/home/vsc/github/yap-6.3/library/undgraphs.yap;/home/vsc/github/yap-6.3/library/varnumbers.yap;/home/vsc/github/yap-6.3/library/wdgraphs.yap;/home/vsc/github/yap-6.3/library/wgraphs.yap;/home/vsc/github/yap-6.3/library/wundgraphs.yap;/home/vsc/github/yap-6.3/library/lam_mpi.yap;/home/vsc/github/yap-6.3/library/ypp.yap;/home/vsc/github/yap-6.3/library/ytest.yap;/home/vsc/github/yap-6.3/library/c_alarms.yap;/home/vsc/github/yap-6.3/library/flags.yap;/home/vsc/github/yap-6.3/library/block_diagram.yap;/home/vsc/github/yap-6.3/packages/real/real.pl;/home/vsc/github/yap-6.3/packages/python/swig/prolog/jupyter.yap;/home/vsc/github/yap-6.3/packages/python/swig/prolog/yapi.yap'.split(";") + '/home/vsc/github/yap-6.3/swi/library/aggregate.pl;/home/vsc/github/yap-6.3/swi/library/base64.pl;/home/vsc/github/yap-6.3/swi/library/broadcast.pl;/home/vsc/github/yap-6.3/swi/library/ctypes.pl;/home/vsc/github/yap-6.3/swi/library/date.pl;/home/vsc/github/yap-6.3/swi/library/debug.pl;/home/vsc/github/yap-6.3/swi/library/edit.pl;/home/vsc/github/yap-6.3/swi/library/error.pl;/home/vsc/github/yap-6.3/swi/library/main.pl;/home/vsc/github/yap-6.3/swi/library/menu.pl;/home/vsc/github/yap-6.3/swi/library/nb_set.pl;/home/vsc/github/yap-6.3/swi/library/occurs.yap;/home/vsc/github/yap-6.3/swi/library/operators.pl;/home/vsc/github/yap-6.3/swi/library/option.pl;/home/vsc/github/yap-6.3/swi/library/pairs.pl;/home/vsc/github/yap-6.3/swi/library/plunit.pl;/home/vsc/github/yap-6.3/swi/library/predicate_options.pl;/home/vsc/github/yap-6.3/swi/library/predopts.pl;/home/vsc/github/yap-6.3/swi/library/prolog_clause.pl;/home/vsc/github/yap-6.3/swi/library/prolog_colour.pl;/home/vsc/github/yap-6.3/swi/library/prolog_source.pl;/home/vsc/github/yap-6.3/swi/library/prolog_xref.pl;/home/vsc/github/yap-6.3/swi/library/pure_input.pl;/home/vsc/github/yap-6.3/swi/library/quasi_quotations.pl;/home/vsc/github/yap-6.3/swi/library/quintus.pl;/home/vsc/github/yap-6.3/swi/library/record.pl;/home/vsc/github/yap-6.3/swi/library/settings.pl;/home/vsc/github/yap-6.3/swi/library/shlib.pl;/home/vsc/github/yap-6.3/swi/library/thread_pool.pl;/home/vsc/github/yap-6.3/swi/library/unix.pl;/home/vsc/github/yap-6.3/swi/library/url.pl;/home/vsc/github/yap-6.3/swi/library/utf8.pl;/home/vsc/github/yap-6.3/swi/library/win_menu.pl;/home/vsc/github/yap-6.3/swi/library/www_browser.pl;/home/vsc/github/yap-6.3/swi/library/dcg/basics.pl'.split(";") :
|
||||||
|
copy2(i, 'yap4py/prolog')
|
||||||
|
for i in '/home/vsc/github/yap-6.3/os/edio.yap;/home/vsc/github/yap-6.3/os/chartypes.yap'.split(";") :
|
||||||
|
copy2(i, 'yap4py/prolog/os')
|
||||||
|
for i in '/home/vsc/github/yap-6.3/pl/absf.yap;/home/vsc/github/yap-6.3/pl/arith.yap;/home/vsc/github/yap-6.3/pl/arithpreds.yap;/home/vsc/github/yap-6.3/pl/arrays.yap;/home/vsc/github/yap-6.3/pl/atoms.yap;/home/vsc/github/yap-6.3/pl/attributes.yap;/home/vsc/github/yap-6.3/pl/boot.yap;/home/vsc/github/yap-6.3/pl/bootlists.yap;/home/vsc/github/yap-6.3/pl/callcount.yap;/home/vsc/github/yap-6.3/pl/checker.yap;/home/vsc/github/yap-6.3/pl/consult.yap;/home/vsc/github/yap-6.3/pl/control.yap;/home/vsc/github/yap-6.3/pl/corout.yap;/home/vsc/github/yap-6.3/pl/dbload.yap;/home/vsc/github/yap-6.3/pl/debug.yap;/home/vsc/github/yap-6.3/pl/depth_bound.yap;/home/vsc/github/yap-6.3/pl/dialect.yap;/home/vsc/github/yap-6.3/pl/directives.yap;/home/vsc/github/yap-6.3/pl/eam.yap;/home/vsc/github/yap-6.3/pl/error.yap;/home/vsc/github/yap-6.3/pl/errors.yap;/home/vsc/github/yap-6.3/pl/eval.yap;/home/vsc/github/yap-6.3/pl/flags.yap;/home/vsc/github/yap-6.3/pl/grammar.yap;/home/vsc/github/yap-6.3/pl/ground.yap;/home/vsc/github/yap-6.3/pl/hacks.yap;/home/vsc/github/yap-6.3/pl/init.yap;/home/vsc/github/yap-6.3/pl/listing.yap;/home/vsc/github/yap-6.3/pl/load_foreign.yap;/home/vsc/github/yap-6.3/pl/messages.yap;/home/vsc/github/yap-6.3/pl/meta.yap;/home/vsc/github/yap-6.3/pl/modules.yap;/home/vsc/github/yap-6.3/pl/newmod.yap;/home/vsc/github/yap-6.3/pl/os.yap;/home/vsc/github/yap-6.3/pl/pathconf.yap;/home/vsc/github/yap-6.3/pl/preddecls.yap;/home/vsc/github/yap-6.3/pl/preddyns.yap;/home/vsc/github/yap-6.3/pl/preds.yap;/home/vsc/github/yap-6.3/pl/profile.yap;/home/vsc/github/yap-6.3/pl/protect.yap;/home/vsc/github/yap-6.3/pl/qly.yap;/home/vsc/github/yap-6.3/pl/save.yap;/home/vsc/github/yap-6.3/pl/setof.yap;/home/vsc/github/yap-6.3/pl/signals.yap;/home/vsc/github/yap-6.3/pl/sort.yap;/home/vsc/github/yap-6.3/pl/spy.yap;/home/vsc/github/yap-6.3/pl/statistics.yap;/home/vsc/github/yap-6.3/pl/strict_iso.yap;/home/vsc/github/yap-6.3/pl/swi.yap;/home/vsc/github/yap-6.3/pl/tabling.yap;/home/vsc/github/yap-6.3/pl/threads.yap;/home/vsc/github/yap-6.3/pl/udi.yap;/home/vsc/github/yap-6.3/pl/undefined.yap;/home/vsc/github/yap-6.3/pl/utils.yap;/home/vsc/github/yap-6.3/pl/yapor.yap;/home/vsc/github/yap-6.3/pl/yio.yap'.split(";") :
|
||||||
|
copy2(i, 'yap4py/prolog/pl')
|
||||||
|
my_libs0 = '/home/vsc/github/yap-6.3/packages/python/*YAPPython*.so;/home/vsc/github/yap-6.3/packages/python/*Py4YAP*.so;/home/vsc/github/yap-6.3/*libYap*.so;/home/vsc/github/yap-6.3/packages/myddas/sqlite3/*Yapsqlite3*.so;/home/vsc/github/yap-6.3/packages/myddas/mysql/*Yapmysql*.so;/home/vsc/github/yap-6.3/packages/myddas/odbc/*Yapodbc*.so;/home/vsc/github/yap-6.3/CXX/*YAP++*.so;/home/vsc/github/yap-6.3/library/matrix/*matrix*.so;/home/vsc/github/yap-6.3/library/random/*yap_random*.so;/home/vsc/github/yap-6.3/library/regex/*regexp*.so;/home/vsc/github/yap-6.3/library/rltree/*yap_rl*.so;/home/vsc/github/yap-6.3/library/system/*sys*.so;/home/vsc/github/yap-6.3/library/tries/*tries*.so;/home/vsc/github/yap-6.3/library/tries/*itries*.so;/home/vsc/github/yap-6.3/packages/raptor/*libxml2*.so;/home/vsc/github/yap-6.3/packages/raptor/*raptor*.so;/home/vsc/github/yap-6.3/packages/CLPBN/horus/*horus*.so;/home/vsc/github/yap-6.3/packages/gecode/*gecode_yap*.so;/home/vsc/github/yap-6.3/packages/real/*real*.so;/home/vsc/github/yap-6.3/packages/jpl/src/c/*jplYap*.so;/home/vsc/github/yap-6.3/packages/swi-minisat2/C/*minisat2*.so;/home/vsc/github/yap-6.3/library/lammpi/*yap_mpi*.so'.split(";")+['/home/vsc/github/yap-6.3/startup.yss']
|
||||||
|
my_libs = []
|
||||||
|
for i in my_libs0:
|
||||||
|
my_libs = glob(i) + my_libs
|
||||||
|
for i in my_libs:
|
||||||
|
copy2(i, 'yap4py')
|
||||||
|
bpy2yap = []
|
||||||
|
here = path.abspath(path.dirname(__file__))
|
||||||
|
#gmp_dir = path.abspath(path.dirname("/usr/lib/x86_64-linux-gnu/libgmp.so"))
|
||||||
|
#python_libdir = path.abspath(path.dirname("/usr/lib/x86_64-linux-gnu/libpython2.7.so")
|
||||||
# Get the long description from the README file
|
# Get the long description from the README file
|
||||||
|
|
||||||
extensions=[Extension('_yap', python_sources,
|
|
||||||
define_macros = [('MAJOR_VERSION', '1'),
|
|
||||||
|
extensions = [Extension('_yap', native_sources,
|
||||||
|
define_macros=[('MAJOR_VERSION', '1'),
|
||||||
('MINOR_VERSION', '0'),
|
('MINOR_VERSION', '0'),
|
||||||
('_YAP_NOT_INSTALLED_', '1'),
|
('_YAP_NOT_INSTALLED_', '1'),
|
||||||
('YAP_PYTHON', '1')],
|
('YAP_PYTHON', '1'),
|
||||||
runtime_library_dirs=['yap4py','/usr/local/lib','/usr/local/bin'],
|
('_GNU_SOURCE', '1')],
|
||||||
swig_opts=['-modern', '-c++', '-py3','-I../../..//CXX'],
|
runtime_library_dirs=['yap4py', '/usr/local/lib', '/usr/local/bin', '', ''],
|
||||||
library_dirs=['../../..','../../../CXX','../../packages/python',"/usr/local/lib/Yap","/usr/local/bin", '.'],
|
swig_opts=['-modern', '-c++', '-py3',
|
||||||
extra_link_args=my_extra_link_args,
|
'-DX_API', '-I/home/vsc/github/yap-6.3/CXX', '-I/home/vsc/github/yap-6.3/include',
|
||||||
extra_compile_args=['-g'],
|
'-I/home/vsc/github/yap-6.3/H', '-I/home/vsc/github/yap-6.3/H/generated',
|
||||||
libraries=['Yap','/usr/local/lib/libgmp.dylib'],
|
'-I/home/vsc/github/yap-6.3/os', '-I/home/vsc/github/yap-6.3/OPTYap',
|
||||||
include_dirs=['../../..',
|
'-I/home/vsc/github/yap-6.3/packages/python'],
|
||||||
'/usr/local/include',
|
library_dirs=['../../..', '../../../CXX', '..', "/usr/local/bin"],
|
||||||
'../../../H',
|
extra_link_args=my_extra_link_args,
|
||||||
'../../../H/generated',
|
libraries=['Yap','gmp']+win_libs+local_libs,
|
||||||
'../../../OPTYap',
|
include_dirs=['../../..',
|
||||||
'../../../os',
|
'/usr/include/x86_64-linux-gnu',
|
||||||
'../../../include',
|
'/home/vsc/github/yap-6.3/H',
|
||||||
'../../../CXX', '.']
|
'/home/vsc/github/yap-6.3/H/generated',
|
||||||
)]
|
'/home/vsc/github/yap-6.3/OPTYap',
|
||||||
|
'/home/vsc/github/yap-6.3/os',
|
||||||
|
'/home/vsc/github/yap-6.3/packages/python',
|
||||||
|
'/home/vsc/github/yap-6.3/include',
|
||||||
|
'/home/vsc/github/yap-6.3/CXX', '.']
|
||||||
|
)]#
|
||||||
|
|
||||||
setup(
|
packages = packages = setuptools.find_packages('/home/vsc/github/yap-6.3/packages/python/swig')
|
||||||
name='YAP4Py',
|
|
||||||
version='6.3.5',
|
|
||||||
description='The YAP Prolog compiler as a Python Library',
|
|
||||||
url='https://github.com/vscosta/yap-6.3',
|
|
||||||
author='Vitor Santos Costa',
|
|
||||||
author_email='vsc@dcc.fc.up.pt',
|
|
||||||
license='Artistic',
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 4 - Beta',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'Topic :: Software Development :: Build Tools',
|
|
||||||
'License :: OSI Approved :: Artistic License',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
|
|
||||||
'Programming Language :: Python :: 3.4',
|
|
||||||
'Programming Language :: Python :: 3.5',
|
|
||||||
'Programming Language :: Python :: 3.6',
|
package_data = {
|
||||||
'Programming Language :: Python :: 3.7'],
|
'yap4py/prolog': 'prolog/*.*',
|
||||||
keywords=['Logic Programing'],
|
'': '*.*'
|
||||||
#spackage_data={'': ['yap']},
|
}
|
||||||
|
|
||||||
|
version_ns = {'__version__': '6.3.5', 'minor-version': '6', 'minor-version': '3', 'patch': '5'}
|
||||||
|
|
||||||
|
setup_args = dict(
|
||||||
|
name=name,
|
||||||
|
version=version_ns['__version__'],
|
||||||
|
scripts=glob(pjoin('scripts', '*')),
|
||||||
|
packages=packages,
|
||||||
|
py_modules=['yap','yap4py'],
|
||||||
|
package_data=package_data,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
ext_modules = extensions,
|
requirements=[
|
||||||
py_modules = ['yap'],
|
'm2w64-gmp',
|
||||||
zip_safe=False,
|
'm2-msys2-keyring',
|
||||||
eager_resources = ['yap4py'],
|
'm2-msys2-launcher-git',
|
||||||
packages=['yap4py'] # find_packages()
|
'm2-msys2-runtime',
|
||||||
#package_dir = {'':'yap4py'}
|
],
|
||||||
|
description="YAP in Python",
|
||||||
|
author='YAP Development Team',
|
||||||
|
author_email='ipython-dev@scipy.org',
|
||||||
|
url='http://ipython.org',
|
||||||
|
license='BSD',
|
||||||
|
ext_modules=extensions,
|
||||||
|
platforms="Linux, Mac OS X, Windows",
|
||||||
|
keywords=['Interactive', 'Interpreter', 'Shell', 'Web'],
|
||||||
|
classifiers=[
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
'Intended Audience :: System Administrators',
|
||||||
|
'Intended Audience :: Science/Research',
|
||||||
|
'License :: OSI Approved :: BSD License',
|
||||||
|
'Programming Language :: Python',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv):
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools_args = {}
|
||||||
|
install_requires = setuptools_args['install_requires'] = [
|
||||||
|
]
|
||||||
|
|
||||||
|
extras_require = setuptools_args['extras_require'] = {
|
||||||
|
'test:python_version=="2.7"': ['mock'],
|
||||||
|
'test': ['nose_warnings_filters', 'nose-timer'],
|
||||||
|
}
|
||||||
|
|
||||||
|
if 'setuptools' in sys.modules:
|
||||||
|
setup_args.update(setuptools_args)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
setup(**setup_args)
|
||||||
|
BIN
packages/python/yap_kernel/yap_kernel/resources/logo-32x32.png
Normal file → Executable file
BIN
packages/python/yap_kernel/yap_kernel/resources/logo-32x32.png
Normal file → Executable file
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
packages/python/yap_kernel/yap_kernel/resources/logo-64x64.png
Normal file → Executable file
BIN
packages/python/yap_kernel/yap_kernel/resources/logo-64x64.png
Normal file → Executable file
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 6.8 KiB |
@ -412,7 +412,7 @@ be lost.
|
|||||||
'$undefined'(G, M), !,
|
'$undefined'(G, M), !,
|
||||||
'$get_undefined_pred'(G, M, Goal, NM), NM \= M,
|
'$get_undefined_pred'(G, M, Goal, NM), NM \= M,
|
||||||
'$spycall'(Goal, NM, CP, expanded).
|
'$spycall'(Goal, NM, CP, expanded).
|
||||||
'$spycall'(G, M, CP, _) :-
|
'$spycall'(G, M, _CP, _) :-
|
||||||
/* get goal no. */
|
/* get goal no. */
|
||||||
'__NB_getval__'('$spy_gn',L,fail),
|
'__NB_getval__'('$spy_gn',L,fail),
|
||||||
/* bump it */
|
/* bump it */
|
||||||
|
Reference in New Issue
Block a user