You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(72) |
Jul
(30) |
Aug
(31) |
Sep
(41) |
Oct
(22) |
Nov
(70) |
Dec
(98) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(194) |
Feb
(127) |
Mar
(47) |
Apr
(83) |
May
(154) |
Jun
(149) |
Jul
(49) |
Aug
(64) |
Sep
(98) |
Oct
(104) |
Nov
(99) |
Dec
(109) |
| 2003 |
Jan
(72) |
Feb
(105) |
Mar
(76) |
Apr
(66) |
May
(20) |
Jun
(51) |
Jul
(67) |
Aug
(16) |
Sep
(24) |
Oct
(52) |
Nov
(43) |
Dec
(92) |
| 2004 |
Jan
(16) |
Feb
(145) |
Mar
(137) |
Apr
(140) |
May
(29) |
Jun
(214) |
Jul
(167) |
Aug
(202) |
Sep
(188) |
Oct
(228) |
Nov
(283) |
Dec
(250) |
| 2005 |
Jan
(107) |
Feb
(162) |
Mar
(100) |
Apr
(110) |
May
(144) |
Jun
(19) |
Jul
(23) |
Aug
(127) |
Sep
(20) |
Oct
(76) |
Nov
(85) |
Dec
(171) |
| 2006 |
Jan
(86) |
Feb
(134) |
Mar
(213) |
Apr
(70) |
May
(81) |
Jun
(25) |
Jul
(6) |
Aug
(36) |
Sep
(20) |
Oct
(21) |
Nov
(368) |
Dec
(164) |
| 2007 |
Jan
(239) |
Feb
(126) |
Mar
(148) |
Apr
(24) |
May
(48) |
Jun
(238) |
Jul
(18) |
Aug
(13) |
Sep
(59) |
Oct
(73) |
Nov
(224) |
Dec
(39) |
| 2008 |
Jan
(53) |
Feb
(92) |
Mar
(134) |
Apr
(81) |
May
(53) |
Jun
(210) |
Jul
(31) |
Aug
(38) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2009 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 15:36:42
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv29327/C
Modified Files:
errors.c
Log Message:
in Abort: don't check args for empty string
Index: errors.c
===================================================================
RCS file: /cvsroot/yap/C/errors.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- errors.c 2001/06/27 13:22:30 1.5
+++ errors.c 2001/06/27 15:36:38 1.6
@@ -212,7 +212,7 @@
va_start (ap, format);
PrologMode &= ~AbortMode;
- if (format)
+ if (format || !strcmp(format,""))
{
char ch;
while ((ch = *format++)!=0)
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 15:14:05
|
Update of /cvsroot/yap/m4 In directory usw-pr-cvs1:/tmp/cvs-serv22549/m4 Modified Files: Tags_64bits.h.m4 Log Message: Fix MAX_ABS_INT Index: Tags_64bits.h.m4 =================================================================== RCS file: /cvsroot/yap/m4/Tags_64bits.h.m4,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Tags_64bits.h.m4 2001/04/09 19:53:46 1.1.1.1 +++ Tags_64bits.h.m4 2001/06/27 15:14:02 1.2 @@ -44,7 +44,7 @@ #define MaskPrim /* 0x0ffffff8L */ ((((UInt)1) << (SHIFT_HIGH_TAG))-8) #define NumberTag /* 0x30000001L */ MKTAG(0x1,1) #define AtomTag /* 0x10000001L */ MKTAG(0x0,1) -#define MAX_ABS_INT /* 0xfe00000LL */ (((UInt)1) << (63-(2+4))) +#define MAX_ABS_INT /* 0xfe00000LL */ (((Int)1) << (63-(2+4))) /* bits that should not be used by anyone but us */ #define YAP_PROTECTED_MASK 0xe000000000000000L |
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 15:00:17
|
Update of /cvsroot/yap/m4 In directory usw-pr-cvs1:/tmp/cvs-serv17585/m4 Modified Files: Yap.h.m4 Log Message: Fix IntInBnd and MAX_ABS_INT for 64 bit machines Index: Yap.h.m4 =================================================================== RCS file: /cvsroot/yap/m4/Yap.h.m4,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Yap.h.m4 2001/06/27 13:22:30 1.6 +++ Yap.h.m4 2001/06/27 15:00:10 1.7 @@ -639,8 +639,8 @@ #ifdef TAGS_FAST_OPS #define IntInBnd(X) (Unsigned( ( (Int)(X) >> (32-7) ) + 1) <= 1) #else -#define IntInBnd(X) ( (X) < (MAX_ABS_INT) && \ - (X) > (-MAX_ABS_INT)-1 ) +#define IntInBnd(X) ( (X) < MAX_ABS_INT && \ + (X) > -MAX_ABS_INT-1L ) #endif #endif #ifdef C_PROLOG |
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 13:22:34
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv21951/C
Modified Files:
absmi.c errors.c init.c iopreds.c sysbits.c
Log Message:
More interrupt handling cleanups!
Index: absmi.c
===================================================================
RCS file: /cvsroot/yap/C/absmi.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- absmi.c 2001/06/22 17:53:36 1.9
+++ absmi.c 2001/06/27 13:22:30 1.10
@@ -1977,7 +1977,7 @@
* *cannot* fail before having woken up all suspended goals.
*/
/* make sure we are here because of an awoken goal */
- if (CFREG == Unsigned(LCL0) && !(PrologMode & AbortMode)) {
+ if (CFREG == Unsigned(LCL0) && !(PrologMode & (InterruptMode|AbortMode))) {
Term WGs;
Term my_goal;
@@ -2051,11 +2051,17 @@
}
else {
#endif
- if (PrologMode & AbortMode) {
- PrologMode &= ~AbortMode;
+ if (PrologMode & (AbortMode|InterruptMode)) {
CFREG = CalculateStackGap();
/* same instruction */
- if (ProcessSIGINT() < 0) Abort("");
+ if (PrologMode & InterruptMode) {
+ PrologMode &= ~InterruptMode;
+ ProcessSIGINT();
+ }
+ if (PrologMode & AbortMode) {
+ PrologMode &= ~AbortMode;
+ Abort("");
+ }
JMPNext();
}
#if SHADOW_S
Index: errors.c
===================================================================
RCS file: /cvsroot/yap/C/errors.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- errors.c 2001/06/22 17:53:36 1.4
+++ errors.c 2001/06/27 13:22:30 1.5
@@ -211,6 +211,7 @@
va_list ap;
va_start (ap, format);
+ PrologMode &= ~AbortMode;
if (format)
{
char ch;
Index: init.c
===================================================================
RCS file: /cvsroot/yap/C/init.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- init.c 2001/06/22 17:53:36 1.8
+++ init.c 2001/06/27 13:22:30 1.9
@@ -138,7 +138,8 @@
/********* Prolog State ********************************************/
-int PrologMode = BootMode;
+prolog_exec_mode PrologMode = BootMode;
+int CritLocks = 0;
#if PUSH_REGS
REGSTORE standard_regs;
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- iopreds.c 2001/06/22 17:53:36 1.16
+++ iopreds.c 2001/06/27 13:22:30 1.17
@@ -1196,26 +1196,23 @@
strncpy (Prompt, RepAtom (*AtPrompt)->StrOfAE, MAX_PROMPT);
newline = FALSE;
}
- in_getc = TRUE;
#if HAVE_SIGINTERRUPT
siginterrupt(SIGINT, TRUE);
#endif
+ in_getc = TRUE;
ch = YP_fgetc(s->u.file.file);
+ in_getc = FALSE;
#if HAVE_SIGINTERRUPT
siginterrupt(SIGINT, FALSE);
#endif
- in_getc = FALSE;
- if (PrologMode & AbortMode) {
- PrologMode &= ~AbortMode;
- CreepFlag = CalculateStackGap();
- if (ProcessSIGINT() < 0) Abort("");
- newline = TRUE;
- goto restart;
- } else if (ch == -1 && errno == EINTR) {
- errno = 0;
- PrologMode &= ~AbortMode;
- if (ProcessSIGINT() < 0) Abort("");
+ if (PrologMode & InterruptMode) {
+ PrologMode &= ~InterruptMode;
+ ProcessSIGINT();
newline = TRUE;
+ if (PrologMode & AbortMode) {
+ PrologMode &= ~AbortMode;
+ Abort("");
+ }
goto restart;
}
return(console_post_process_read_char(ch, s, sno));
Index: sysbits.c
===================================================================
RCS file: /cvsroot/yap/C/sysbits.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sysbits.c 2001/06/22 20:26:55 1.7
+++ sysbits.c 2001/06/27 13:22:30 1.8
@@ -1076,7 +1076,7 @@
/* we can't do a direct abort, so ask the system to do
it for us */
p_creep();
- PutValue(AtomThrow, MkAtomTerm(AtomTrue));
+ PrologMode |= AbortMode;
return(-1);
case 'c':
/* continue */
@@ -1177,16 +1177,6 @@
{
int ch, out;
-#if HAVE_ISATTY
- if (!isatty(0)) {
- InteractSIGINT('e');
- }
-#if !HAVE_LIBREADLINE
- if (in_getc) {
- return(0);
- }
-#endif
-#endif
do {
#if HAVE_LIBREADLINE
if (_line != (char *) NULL && _line != (char *) EOF)
@@ -1227,10 +1217,22 @@
#endif
{
my_signal(SIGINT, HandleSIGINT);
-#if (_MSC_VER || defined(__MINGW32__))
- printf("hello\n");
- return;
+#if HAVE_ISATTY
+ if (!isatty(0)) {
+ InteractSIGINT('e');
+ }
#endif
+#if !HAVE_LIBREADLINE
+ if (in_getc) {
+ PrologMode |= InterruptMode;
+ return;
+ }
+#endif
+ if (PrologMode & CritMode) {
+ /* delay processing if we are messing with the Code space */
+ PrologMode |= InterruptMode;
+ return;
+ }
#ifdef HAVE_SETBUF
/* make sure we are not waiting for the end of line */
YP_setbuf (stdin, NULL);
@@ -1301,7 +1303,7 @@
case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
p_creep();
- PrologMode |= AbortMode;
+ PrologMode |= InterruptMode;
return(TRUE);
default:
return(FALSE);
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 13:22:34
|
Update of /cvsroot/yap/m4
In directory usw-pr-cvs1:/tmp/cvs-serv21951/m4
Modified Files:
Yap.h.m4
Log Message:
More interrupt handling cleanups!
Index: Yap.h.m4
===================================================================
RCS file: /cvsroot/yap/m4/Yap.h.m4,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Yap.h.m4 2001/06/22 17:53:36 1.5
+++ Yap.h.m4 2001/06/27 13:22:30 1.6
@@ -754,14 +754,16 @@
/********* Prolog may be in several modes *******************************/
-#define BootMode 1 /* if booting or restoring */
-#define UserMode 2 /* Normal mode */
-#define CritMode 4 /* If we are meddling with the heap */
-#define FullLMode 8 /* to access the hidden atoms chain */
-#define AbortMode 16 /* expecting to abort */
-#define InterruptMode 32 /* under an interrupt */
+typedef enum {
+ BootMode = 1, /* if booting or restoring */
+ UserMode = 2, /* Normal mode */
+ CritMode = 4, /* If we are meddling with the heap */
+ AbortMode = 8, /* expecting to abort */
+ InterruptMode = 16 /* under an interrupt */
+} prolog_exec_mode;
-extern int PrologMode;
+extern prolog_exec_mode PrologMode;
+extern int CritLocks;
#if SIZEOF_INT_P==4
#if defined(YAPOR) || defined(TABLING)
@@ -802,17 +804,46 @@
GLOBAL_LOCKS_who_locked_heap = worker_id; \
} \
PrologMode |= CritMode; \
+ CritLocks++; \
}
#define YAPLeaveCriticalSection() \
{ \
- if ((PrologMode ^= CritMode) & AbortMode) Abort((char *)NIL); \
- GLOBAL_LOCKS_who_locked_heap = MAX_WORKERS; \
- UNLOCK(GLOBAL_LOCKS_heap_access); \
+ CritLocks--; \
+ if (!CritLocks) { \
+ PrologMode &= ~CritMode; \
+ if (PrologMode & InterruptMode) { \
+ PrologMode &= ~InterruptMode; \
+ ProcessSIGINT(); \
+ } \
+ if (PrologMode & AbortMode) { \
+ PrologMode &= ~AbortMode; \
+ Abort(""); \
+ } \
+ GLOBAL_LOCKS_who_locked_heap = MAX_WORKERS; \
+ UNLOCK(GLOBAL_LOCKS_heap_access); \
+ } \
}
#else
-#define YAPEnterCriticalSection() PrologMode |= CritMode;
-#define YAPLeaveCriticalSection() \
- if((PrologMode ^= CritMode) & AbortMode) Abort((char *)NIL);
+#define YAPEnterCriticalSection() \
+ { \
+ PrologMode |= CritMode; \
+ CritLocks++; \
+ }
+#define YAPLeaveCriticalSection() \
+ { \
+ CritLocks--; \
+ if (!CritLocks) { \
+ PrologMode &= ~CritMode; \
+ if (PrologMode & InterruptMode) { \
+ PrologMode &= ~InterruptMode; \
+ ProcessSIGINT(); \
+ } \
+ if (PrologMode & AbortMode) { \
+ PrologMode &= ~AbortMode; \
+ Abort(""); \
+ } \
+ } \
+ }
#endif /* YAPOR */
/* when we are calling the InitStaff procedures */
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 13:22:33
|
Update of /cvsroot/yap In directory usw-pr-cvs1:/tmp/cvs-serv21951 Modified Files: changes4.3.html Log Message: More interrupt handling cleanups! |
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 12:48:04
|
Update of /cvsroot/yap In directory usw-pr-cvs1:/tmp/cvs-serv13390 Modified Files: Makefile.in Log Message: order .c files |
|
From: Vitor S. C. <vs...@us...> - 2001-06-27 12:48:00
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv13086/C
Modified Files:
heapgc.c
Log Message:
Fix c-stack overflow for very deep nested terms.
Index: heapgc.c
===================================================================
RCS file: /cvsroot/yap/C/heapgc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- heapgc.c 2001/06/18 18:23:14 1.20
+++ heapgc.c 2001/06/27 12:46:35 1.21
@@ -129,8 +129,6 @@
#endif
-/* #define DB_SEARCH_METHOD 1 */
-
/* global variables for garbage collection */
#ifndef DEBUG
@@ -164,11 +162,8 @@
STATIC_PROTO(void marking_phase, (tr_fr_ptr, CELL *, yamop *, CELL *));
STATIC_PROTO(void compaction_phase, (tr_fr_ptr, CELL *, yamop *, CELL *));
STATIC_PROTO(void pop_registers, (Int, yamop *));
-#if DB_SEARCH_METHOD
-#else
STATIC_PROTO(void store_ref_in_dbtable, (DBRef));
STATIC_PROTO(DBRef find_ref_in_dbtable, (DBRef));
-#endif
STATIC_PROTO(void init_dbtable, (tr_fr_ptr));
STATIC_PROTO(void mark_db_fixed, (CELL *));
STATIC_PROTO(void mark_regs, (tr_fr_ptr));
@@ -191,6 +186,43 @@
/* support for hybrid garbage collection scheme */
+typedef struct {
+ CELL *v;
+ int nof;
+} cont;
+
+static cont *cont_top0, *cont_top;
+
+inline static void
+PUSH_CONTINUATION(CELL *v, int nof) {
+ cont *x;
+ if (nof == 0) return;
+ x = cont_top;
+ x++;
+ if ((ADDR)x > TrailTop-1024)
+ growtrail(64 * 1024L);
+ x->v = v;
+ x->nof = nof;
+ cont_top = x;
+}
+
+#define POP_CONTINUATION() { \
+ if (cont_top == cont_top0) \
+ return; \
+ else { \
+ int nof = cont_top->nof; \
+ cont *x = cont_top; \
+ \
+ current = x->v; \
+ if (nof == 1) \
+ cont_top = --x; \
+ else { \
+ x->nof = nof-1; \
+ x->v = current+1; \
+ } \
+ } \
+ goto begin; }
+
#ifdef HYBRID_SCHEME
static CELL_PTR *iptop;
@@ -412,127 +444,6 @@
#endif
-#if DB_SEARCH_METHOD
-
-/* In this method we store first pointers to the DB, and when we find an entry
- in the trail we go and see if anyone is pointing at it. We try to be efficient
- space-wise, by removing entries to code that does not need them
-*/
-
-typedef struct DB_entry {
- CELL *addr;
- struct DB_entry *next;
-} *dbentry;
-
-#define MAX_DB_ENTRIES 1024
-
-static dbentry db_vec, free_entries;
-
-static dbentry dbtable[MAX_DB_ENTRIES];
-
-static int dbscale;
-
-static CODEADDR MyHpBase;
-
-static int
-dbslot(CELL *ptr)
-{
- return((Addr(ptr)-Addr(MyHpBase))/dbscale);
-}
-
-static dbentry
-new_dbvec_entry(void)
-{
- dbentry val;
- if (free_entries != NULL) {
- val = free_entries;
- free_entries = free_entries->next;
- return(val);
- }
- val = db_vec;
- db_vec++;
- return(val);
-}
-
-static void
-add_new_dbuse(CELL *ptr)
-{
- int off = dbslot(ptr);
- dbentry prev = NULL;
- dbentry curr = dbtable[off];
-
- while (curr != NULL && curr->addr < ptr) {
- prev = curr;
- curr = curr->next;
- }
- if (curr == NULL) {
- dbentry db_entry = new_dbvec_entry();
- db_entry->addr = ptr;
- db_entry->next = NULL;
- dbtable[off] = db_entry;
- return;
- } else if (curr->addr > ptr) {
- dbentry db_entry = new_dbvec_entry();
- db_entry->addr = ptr;
- db_entry->next = curr;
- if (prev == NULL) {
- dbtable[off] = db_entry;
- } else {
- prev->next = db_entry;
- }
- }
-}
-
-static void
-mark_db_fixed(CELL *trail_ptr) {
- add_new_dbuse(trail_ptr);
-}
-
-
-/* there are two cases: either off0 == offf or offf > off0 */
-static int
-found_dbentries(CELL *beg, CELL *end)
-{
- int off0 = dbslot(beg);
- int offf = dbslot(end);
- int off = off0;
- int found = FALSE;
- dbentry prev = NULL;
- dbentry curr = dbtable[off];
-
- while (curr != NULL && curr->addr < beg) {
- prev = curr;
- curr = curr->next;
- }
- do {
- while (curr != NULL) {
- if (curr->addr > end) {
- return(found);
- } else {
- dbentry nexte = curr->next;
- found = TRUE;
- if (prev == NULL)
- dbtable[off] = nexte;
- else
- prev->next = nexte;
- curr->next = free_entries;
- free_entries = curr;
- curr = nexte;
- }
- }
- if (off < offf) {
- off++;
- prev = NULL;
- curr = dbtable[off];
- } else
- return(found);
- } while (TRUE);
-}
-
-
-
-#else
-
/* straightforward binary tree scheme that, given a key, finds a
matching dbref */
@@ -608,16 +519,8 @@
el->Flags |= GcFoundMask;
}
-#endif
-
static void
init_dbtable(tr_fr_ptr trail_ptr) {
-#if DB_SEARCH_METHOD
- MyHpBase = HeapBase;
- db_vec = (dbentry)TR;
- free_entries = NULL;
- dbscale = ((Addr(HeapTop)-Addr(MyHpBase))+MAX_DB_ENTRIES-1)/MAX_DB_ENTRIES;
-#else
db_vec0 = db_vec = (dbentry)TR;
while (trail_ptr > (tr_fr_ptr)TrailBase) {
register CELL trail_cell;
@@ -659,13 +562,12 @@
/* could not find any entries: probably using LOG UPD semantics */
db_vec0 = NULL;
}
-#endif
}
#ifdef DEBUG
#define INSTRUMENT_GC 1
-#define CHECK_CHOICEPOINTS 1
+/*#define CHECK_CHOICEPOINTS 1 */
#ifdef INSTRUMENT_GC
typedef enum {
@@ -836,12 +738,12 @@
CELL_PTR next;
register CELL ccur;
unsigned int arity;
- unsigned int i;
begin:
ccur = *current;
- if (MARKED(ccur))
- return;
+ if (MARKED(ccur)) {
+ POP_CONTINUATION();
+ }
MARK(current);
total_marked++;
PUSH_POINTER(current);
@@ -861,7 +763,7 @@
#endif
*next = (CELL)current;
*current = MARK_CELL((CELL)current);
- return;
+ POP_CONTINUATION();
} else {
/* can't help here */
#ifdef INSTRUMENT_GC
@@ -908,19 +810,19 @@
else
inc_var(current, next);
#endif
- return;
+ POP_CONTINUATION();
} else if (IsPairTerm(ccur)) {
#ifdef INSTRUMENT_GC
inc_vars_of_type(current,gc_list);
#endif
if (ONHEAP(next)) {
- mark_variable(next);
- current = next + 1;
+ PUSH_CONTINUATION(next+1,1);
+ current = next;
goto begin;
} else if (ONCODE(next)) {
mark_db_fixed(RepPair(ccur));
}
- return;
+ POP_CONTINUATION();
} else if (IsApplTerm(ccur)) {
register CELL cnext = *next;
@@ -938,12 +840,12 @@
} else {
mark_db_fixed(next);
}
- return;
+ POP_CONTINUATION();
}
if ( MARKED(cnext) || !ONHEAP(next) )
- return;
+ POP_CONTINUATION();
- if (next < H0) return;
+ if (next < H0) POP_CONTINUATION();
if (IsExtensionFunctor((Functor)cnext)) {
switch (cnext) {
case (CELL)FunctorLongInt:
@@ -952,7 +854,7 @@
PUSH_POINTER(next);
PUSH_POINTER(next+1);
PUSH_POINTER(next+2);
- return;
+ POP_CONTINUATION();
case (CELL)FunctorDouble:
MARK(next);
total_marked += 2+SIZEOF_DOUBLE/SIZEOF_LONG_INT;
@@ -962,7 +864,7 @@
#if SIZEOF_DOUBLE==2*SIZEOF_LONG_INT
PUSH_POINTER(next+3);
#endif
- return;
+ POP_CONTINUATION();
#ifdef USE_GMP
case (CELL)FunctorBigInt:
MARK(next);
@@ -979,10 +881,10 @@
PUSH_POINTER(next+i);
PUSH_POINTER(next+i);
}
- return;
+ POP_CONTINUATION();
#endif
default:
- return;
+ POP_CONTINUATION();
}
}
#ifdef INSTRUMENT_GC
@@ -992,9 +894,8 @@
MARK(next);
++total_marked;
PUSH_POINTER(next);
- for (i = 1; i < arity; ++i)
- mark_variable(next + i);
- current = next + arity;
+ current = next+1;
+ PUSH_CONTINUATION(current+1,arity-1);
goto begin;
}
#ifdef INSTRUMENT_GC
@@ -1003,6 +904,7 @@
else
inc_vars_of_type(current, gc_int);
#endif
+ POP_CONTINUATION();
}
void
@@ -1250,35 +1152,7 @@
#endif
}
} else if (IsPairTerm(trail_cell)) {
-#if DB_SEARCH_METHOD
- CELL *pt0 = RepPair(trail_cell);
-
-#ifdef FROZEN_REGS /* TRAIL */
- /* avoid frozen segments */
- if (
-#ifdef SBA
- (ADDR) pt0 >= HeapTop
-#else
- (ADDR) pt0 >= TrailBase
-#endif
- ) {
- trail_ptr = (tr_fr_ptr) pt0;
- continue;
- }
-#endif /* FROZEN_REGS */
- /* DB pointer */
- CELL flags = Flags((CELL)pt0);
- /* for the moment, if all references to the term in the stacks
- are only pointers, reset the flag */
- if (FlagOn(DBClMask, flags) && !FlagOn(LogUpdMask, flags)) {
- if (FlagOn(DBNoVars, flags)) {
- DBRef entry = (DBRef) ((CODEADDR)pt0 - (CELL) &(((DBRef) NIL)->Flags));
- if (found_dbentries(entry->Contents,
- entry->Contents+entry->NOfCells))
- entry->Flags |= GcFoundMask;
- }
- }
-#endif
+ /* do nothing */
}
#if MULTI_ASSIGNMENT_VARIABLES
else {
@@ -1705,16 +1579,6 @@
gc_B = gc_B->cp_b;
}
}
-#if DB_SEARCH_METHOD
-#if DEBUG
- {
- int i;
- for (i=0; i<MAX_DB_ENTRIES; i++)
- if (dbtable[i] != NULL)
- fprintf(YP_stderr, "oops at entry %d: %p\n", i, dbtable[i]->addr);
- }
-#endif
-#endif
/* first, whatever we dumped on the trail. Easier just to do
the registers separately? */
for (trail_ptr = old_TR; trail_ptr < TR; trail_ptr++) {
@@ -2591,6 +2455,7 @@
current_B = B;
#endif
init_dbtable(old_TR);
+ cont_top0 = cont_top = (cont *)db_vec;
/* These two must be marked first so that our trail optimisation won't lose
values */
mark_regs(old_TR); /* active registers & trail */
@@ -2679,9 +2544,6 @@
Int effectiveness = 0;
int gc_trace = FALSE;
-#ifdef HYBRID_SCHEME
- iptop = (CELL_PTR *)H;
-#endif
#ifdef INSTRUMENT_GC
{
int i;
@@ -2703,7 +2565,7 @@
}
#endif
#ifdef DEBUG
- check_global();
+ // check_global();
#endif
if (GetValue(AtomGcTrace) != TermNil)
gc_trace = 1;
@@ -2720,9 +2582,21 @@
YP_fprintf(YP_stderr, "[GC] Trail:%8ld cells (%p-%p)\n",
(unsigned long int)(TR-(tr_fr_ptr)TrailBase),TrailBase,TR);
}
+ if (HeapTop >= GlobalBase - MinHeapGap) {
+ *--ASP = (CELL)current_env;
+ if (!growheap(FALSE)) {
+ Abort("[ SYSTEM ERROR: YAP could not grow heap before garbage collection ]\n");
+ return(FALSE);
+ }
+ current_env = (CELL *)*ASP;
+ ASP++;
+ }
time_start = cputime();
total_marked = 0;
discard_trail_entries = 0;
+#ifdef HYBRID_SCHEME
+ iptop = (CELL_PTR *)H;
+#endif
/* get the number of active registers */
YAPEnterCriticalSection();
old_TR = TR;
@@ -2756,8 +2630,8 @@
TR = old_TR;
pop_registers(predarity, nextop);
TR = new_TR;
- c_time = cputime();
YAPLeaveCriticalSection();
+ c_time = cputime();
if (gc_verbose) {
YP_fprintf(YP_stderr, "[GC] Compress: took %g sec\n", (double)(c_time-time_start)/1000);
}
@@ -2770,7 +2644,7 @@
(unsigned long int)(ASP-H));
}
#ifdef DEBUG
- check_global();
+ // check_global();
#endif
return(effectiveness);
}
@@ -2848,7 +2722,7 @@
while (gc_margin >= gap && !growstack(gc_margin))
gc_margin = gc_margin/2;
#ifdef DEBUG
- check_global();
+ // check_global();
#endif
return(gc_margin >= gap);
}
|
|
From: Stasinos T. K. <sta...@us...> - 2001-06-26 09:40:38
|
Update of /cvsroot/yap/m4 In directory usw-pr-cvs1:/tmp/cvs-serv23692 Modified Files: Yatom.h.m4 Log Message: fixes the HP cc MkIntegerTerm bug and brings the code inline with the C-Interface documentation Index: Yatom.h.m4 =================================================================== RCS file: /cvsroot/yap/m4/Yatom.h.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Yatom.h.m4 2001/06/06 19:10:51 1.2 +++ Yatom.h.m4 2001/06/26 09:40:34 1.3 @@ -41,7 +41,7 @@ Constructor(Prop, AbsFunctor, FunctorEntry *, p, p) #endif -Inline(ArityOfFunctor, unsigned int, Functor, Fun, ((FunctorEntry *)Fun)->ArityOfFE) +Inline(ArityOfFunctor, Int, Functor, Fun, ((FunctorEntry *)Fun)->ArityOfFE) Inline(NameOfFunctor, Atom, Functor, Fun, ((FunctorEntry *)Fun)->NameOfFE) Inline(IsFunctorProperty, PropFlags, int, flags, (flags == FunctorProperty) ) |
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 20:26:58
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv14549/C
Modified Files:
sysbits.c
Log Message:
don't need to throw catch.
Index: sysbits.c
===================================================================
RCS file: /cvsroot/yap/C/sysbits.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sysbits.c 2001/06/22 17:53:36 1.6
+++ sysbits.c 2001/06/22 20:26:55 1.7
@@ -1301,7 +1301,6 @@
case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
p_creep();
- PutValue(AtomThrow, MkAtomTerm(AtomTrue));
PrologMode |= AbortMode;
return(TRUE);
default:
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 19:50:29
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv6498/C
Modified Files:
stdpreds.c
Log Message:
get rid of has_tabling
Index: stdpreds.c
===================================================================
RCS file: /cvsroot/yap/C/stdpreds.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- stdpreds.c 2001/06/22 17:53:36 1.5
+++ stdpreds.c 2001/06/22 19:50:26 1.6
@@ -2078,16 +2078,6 @@
}
-static Int
-p_has_tabling(void)
-{
-#ifdef TABLING
- return(TRUE);
-#else
- return(FALSE);
-#endif
-}
-
static Int
p_set_yap_flags(void)
{
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 19:44:33
|
Update of /cvsroot/yap
In directory usw-pr-cvs1:/tmp/cvs-serv4812
Modified Files:
README.nt configure configure.in
Log Message:
extra improvements in configure scripts
Index: configure
===================================================================
RCS file: /cvsroot/yap/configure,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- configure 2001/06/22 17:53:36 1.8
+++ configure 2001/06/22 19:44:26 1.9
@@ -4122,7 +4122,7 @@
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile LGPL/win32cons/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -4232,7 +4232,7 @@
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile LGPL/win32cons/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
Index: configure.in
===================================================================
RCS file: /cvsroot/yap/configure.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- configure.in 2001/06/22 17:53:36 1.8
+++ configure.in 2001/06/22 19:44:26 1.9
@@ -619,7 +619,7 @@
mkdir -p CHR
mkdir -p CLPQR
-AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile LGPL/win32cons/Makefile)
+AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile)
make depend
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 19:44:32
|
Update of /cvsroot/yap/docs
In directory usw-pr-cvs1:/tmp/cvs-serv4812/docs
Modified Files:
yap.tex
Log Message:
extra improvements in configure scripts
Index: yap.tex
===================================================================
RCS file: /cvsroot/yap/docs/yap.tex,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- yap.tex 2001/06/19 17:47:45 1.20
+++ yap.tex 2001/06/22 19:44:26 1.21
@@ -675,6 +675,8 @@
@code{/PROGRA~1/Yap} in the standard Makefile. This string will usually
be expanded into @code{c:\Program Files\Yap} by Windows.
+The cygwin environment does not provide @t{gm}. You can fecth a dll for
+the @t{gmp} library from @url{http://www.sf.net/projects/mingwrep}.
@end table
@node Compiling Under Visual C++, Tuning for SGI cc, Tuning for GCC, Machine Options
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 18:13:14
|
Update of /cvsroot/yap In directory usw-pr-cvs1:/tmp/cvs-serv5241 Modified Files: Makefile.in Log Message: get the libraries right for mingw32/cygwin. |
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 17:53:40
|
Update of /cvsroot/yap/pl
In directory usw-pr-cvs1:/tmp/cvs-serv1211/pl
Modified Files:
boot.yap debug.yap
Log Message:
fixes tohandle interrupts ^C in Windows.
Improvements to configure scripts for WIN32 configurations.
--with-readline= option for configure
Index: boot.yap
===================================================================
RCS file: /cvsroot/yap/pl/boot.yap,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- boot.yap 2001/06/11 15:12:07 1.10
+++ boot.yap 2001/06/22 17:53:36 1.11
@@ -1160,11 +1160,6 @@
'$erase_catch_elements'(I),
fail.
-'$erase_catch_elements'(catch(X, J, P), I, Catch) :-
- J >= I, !,
- '$erase_catch_elements'(P, I, Catch).
-'$erase_catch_elements'(Catch, _, Catch).
-
'$catch_call'(X,G,I,NX) :-
array_element('$catch_queue', 0, OldCatch),
update_array('$catch_queue', 0, catch(X,I,OldCatch)),
@@ -1222,6 +1217,11 @@
'$erase_catch_elements'(OldCatch, I, Catch),
update_array('$catch_queue', 0, Catch).
+'$erase_catch_elements'(catch(X, J, P), I, Catch) :-
+ J >= I, !,
+ '$erase_catch_elements'(P, I, Catch).
+'$erase_catch_elements'(Catch, _, Catch).
+
'$system_catch_call'(X,G,I, NX) :-
array_element('$catch_queue', 0, OldCatch),
update_array('$catch_queue', 0, catch(X,I,OldCatch)),
Index: debug.yap
===================================================================
RCS file: /cvsroot/yap/pl/debug.yap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- debug.yap 2001/06/06 19:10:51 1.2
+++ debug.yap 2001/06/22 17:53:36 1.3
@@ -756,6 +756,7 @@
'$execute'(M:Goal).
'$creep'(G) :-
'$get_value'('$throw', true), !,
+ '$set_value'('$throw', false),
abort.
'$creep'([Module|'$trace'(P,G,L)]) :- !,
( Module=prolog -> '$trace'(P,G,L);
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv1211/C
Modified Files:
absmi.c arith0.c dbase.c errors.c init.c iopreds.c save.c
scanner.c stdpreds.c sysbits.c tracer.c ypsocks.c
Log Message:
fixes tohandle interrupts ^C in Windows.
Improvements to configure scripts for WIN32 configurations.
--with-readline= option for configure
Index: absmi.c
===================================================================
RCS file: /cvsroot/yap/C/absmi.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- absmi.c 2001/06/18 18:31:19 1.8
+++ absmi.c 2001/06/22 17:53:36 1.9
@@ -1978,9 +1978,11 @@
*/
/* make sure we are here because of an awoken goal */
if (CFREG == Unsigned(LCL0) && !(PrologMode & AbortMode)) {
- Term WGs = ReadTimedVar(WokenGoals);
- Term my_goal = AbsAppl(H);
+ Term WGs;
+ Term my_goal;
+ WGs = ReadTimedVar(WokenGoals);
+ my_goal = AbsAppl(H);
if (WGs != TermNil) {
#if SHADOW_S
/* save S for ModuleName() */
@@ -2049,6 +2051,13 @@
}
else {
#endif
+ if (PrologMode & AbortMode) {
+ PrologMode &= ~AbortMode;
+ CFREG = CalculateStackGap();
+ /* same instruction */
+ if (ProcessSIGINT() < 0) Abort("");
+ JMPNext();
+ }
#if SHADOW_S
S = SREG;
#endif
@@ -2100,7 +2109,6 @@
H += 2;
CFREG = CalculateStackGap();
SREG = (CELL *) (Unsigned(CreepCode) - sizeof(SMALLUNSGN));
-
#ifdef COROUTINING
}
#endif
Index: arith0.c
===================================================================
RCS file: /cvsroot/yap/C/arith0.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- arith0.c 2001/04/09 19:53:31 1.1.1.1
+++ arith0.c 2001/06/22 17:53:36 1.2
@@ -86,6 +86,7 @@
#define NAN (0.0/0.0)
#endif
+
static E_FUNC
p_nan(E_ARGS)
{
Index: dbase.c
===================================================================
RCS file: /cvsroot/yap/C/dbase.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dbase.c 2001/06/08 19:10:43 1.5
+++ dbase.c 2001/06/22 17:53:36 1.6
@@ -3818,12 +3818,14 @@
} else
father_key = (db_queue *)DBRefOfTerm(Father);
x = StoreTermInDB(Deref(ARG2), 2);
+ x->Parent = NULL;
WRITE_LOCK(father_key->QRWLock);
- if (father_key->LastInQueue != NIL)
+ if (father_key->LastInQueue != NULL)
father_key->LastInQueue->Parent = (DBProp)x;
father_key->LastInQueue = x;
- if (father_key->FirstInQueue == NIL)
+ if (father_key->FirstInQueue == NULL) {
father_key->FirstInQueue = x;
+ }
WRITE_UNLOCK(father_key->QRWLock);
return(TRUE);
}
@@ -3873,7 +3875,7 @@
} else
father_key = (db_queue *)DBRefOfTerm(Father);
WRITE_LOCK(father_key->QRWLock);
- if ((cur_instance = father_key->FirstInQueue) == NIL) {
+ if ((cur_instance = father_key->FirstInQueue) == NULL) {
/* an empty queue automatically goes away */
if (father_key == DBQueues)
DBQueues = father_key->next;
Index: errors.c
===================================================================
RCS file: /cvsroot/yap/C/errors.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- errors.c 2001/05/21 20:00:05 1.3
+++ errors.c 2001/06/22 17:53:36 1.4
@@ -249,22 +249,20 @@
#ifdef DEBUGX
DumpActiveGoals();
#endif /* DEBUG */
- if (PrologMode & BootMode)
- {
- exit_yap (1, NIL);
- }
- else
- {
- CreepFlag = CalculateStackGap();
+ if (PrologMode & BootMode) {
+ exit_yap (1, NIL);
+ } else {
+ PutValue(AtomThrow, MkAtomTerm(AtomFalse));
+ CreepFlag = CalculateStackGap();
#if PUSH_REGS
- restore_absmi_regs(&standard_regs);
+ restore_absmi_regs(&standard_regs);
#endif
#if defined(__GNUC__) && defined(hppa)
- /* siglongjmp resets the TR hardware register */
- save_TR();
+ /* siglongjmp resets the TR hardware register */
+ save_TR();
#endif
- siglongjmp (RestartEnv, 1);
- }
+ siglongjmp (RestartEnv, 1);
+ }
}
Index: init.c
===================================================================
RCS file: /cvsroot/yap/C/init.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- init.c 2001/06/08 19:10:43 1.7
+++ init.c 2001/06/22 17:53:36 1.8
@@ -747,6 +747,12 @@
#endif /* YAPOR */
#endif /* TABLING */
heap_regs->failcode = opcode(_op_fail);
+ heap_regs->failcode_1 = opcode(_op_fail);
+ heap_regs->failcode_2 = opcode(_op_fail);
+ heap_regs->failcode_3 = opcode(_op_fail);
+ heap_regs->failcode_4 = opcode(_op_fail);
+ heap_regs->failcode_5 = opcode(_op_fail);
+ heap_regs->failcode_6 = opcode(_op_fail);
heap_regs->trustfailcode = opcode(_trust_fail);
@@ -941,6 +947,8 @@
heap_regs->functor_change_module = MkFunctor (LookupAtom("$change_module"), 1);
heap_regs->functor_current_module = MkFunctor (LookupAtom("$current_module"), 1);
heap_regs->functor_mod_switch = MkFunctor (LookupAtom("$mod_switch"), 2);
+ heap_regs->functor_u_minus = MkFunctor (heap_regs->atom_minus, 1);
+ heap_regs->functor_u_plus = MkFunctor (heap_regs->atom_plus, 1);
heap_regs->functor_v_bar = MkFunctor(LookupAtom("|"), 2);
heap_regs->functor_var = MkFunctor(AtomVar, 1);
#ifdef EUROTRA
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- iopreds.c 2001/06/12 17:25:28 1.15
+++ iopreds.c 2001/06/22 17:53:36 1.16
@@ -51,6 +51,9 @@
#if HAVE_STRING_H
#include <string.h>
#endif
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
#if HAVE_FCNTL_H
/* for O_BINARY and O_TEXT in WIN32 */
#include <fcntl.h>
@@ -77,6 +80,18 @@
/* if we botched in a LongIO operation */
jmp_buf IOBotch;
+int in_getc = FALSE;
+
+int sigint_pending = FALSE;
+
+#if HAVE_LIBREADLINE
+jmp_buf readline_jmpbuf;
+
+#if _MSC_VER || defined(__MINGW32__)
+FILE *rl_instream, *rl_outstream;
+#endif
+#endif
+
typedef struct
{
union {
@@ -319,8 +334,8 @@
#endif /* USE_SOCKET */
#if _MSC_VER || defined(__MINGW32__)
{
- struct stat buf;
- if (fstat(fileno(s->u.file.file), &buf) == -1) {
+ struct _stat buf;
+ if (_fstat(YP_fileno(s->u.file.file), &buf) == -1) {
return;
}
if (buf.st_mode & S_IFCHR) {
@@ -768,6 +783,10 @@
InitReadline(void) {
ReadlineBuf = (char *)AllocAtomSpace(READLINE_OUT_BUF_MAX+1);
ReadlinePos = ReadlineBuf;
+#if _MSC_VER || defined(__MINGW32__)
+ rl_instream = stdin;
+ rl_outstream = stdout;
+#endif
}
static int
@@ -813,6 +832,10 @@
register int ch;
if (ttyptr == NIL) {
+ if (setjmp(readline_jmpbuf) < 0) {
+ Abort("");
+ }
+ in_getc = TRUE;
/* Do it the gnu way */
YP_fflush (YP_stdout);
/* Only sends a newline if we are at the start of a line */
@@ -845,10 +868,8 @@
}
newline=FALSE;
strncpy (Prompt, RepAtom (*AtPrompt)->StrOfAE, MAX_PROMPT);
+ in_getc = FALSE;
/* window of vulnerability closed */
- if (PrologMode & AbortMode) {
- Abort ((char *) NULL);
- }
if (_line == NULL || _line == (char *) EOF)
return(console_post_process_read_char(EOF, s, sno));
if (_line[0] != '\0' && _line[1] != '\0')
@@ -1156,18 +1177,15 @@
return(ch);
}
-#ifdef _WIN32
-int in_getc = FALSE;
-#endif
-
/* send a prompt, and use the system for internal buffering. Speed is
not of the essence here !!! */
static int
ConsoleGetc(int sno)
{
register StreamDesc *s = &Stream[sno];
- register int ch;
+ char ch;
+ restart:
if (newline) {
char *cptr = Prompt, ch;
@@ -1178,20 +1196,28 @@
strncpy (Prompt, RepAtom (*AtPrompt)->StrOfAE, MAX_PROMPT);
newline = FALSE;
}
-#if defined(__MINGW32__) || _MSC_VER
- next_getc:
in_getc = TRUE;
-#endif
- ch = YP_getc (s->u.file.file);
-#if defined(__MINGW32__) || _MSC_VER
- if (!in_getc) {
- ProcessSIGINT();
- if (PrologMode & AbortMode) {
- Abort((char *)NULL);
- } else
- goto next_getc;
- }
+#if HAVE_SIGINTERRUPT
+ siginterrupt(SIGINT, TRUE);
#endif
+ ch = YP_fgetc(s->u.file.file);
+#if HAVE_SIGINTERRUPT
+ siginterrupt(SIGINT, FALSE);
+#endif
+ in_getc = FALSE;
+ if (PrologMode & AbortMode) {
+ PrologMode &= ~AbortMode;
+ CreepFlag = CalculateStackGap();
+ if (ProcessSIGINT() < 0) Abort("");
+ newline = TRUE;
+ goto restart;
+ } else if (ch == -1 && errno == EINTR) {
+ errno = 0;
+ PrologMode &= ~AbortMode;
+ if (ProcessSIGINT() < 0) Abort("");
+ newline = TRUE;
+ goto restart;
+ }
return(console_post_process_read_char(ch, s, sno));
}
@@ -1393,8 +1419,13 @@
binary_file(char *file_name)
{
#if HAVE_STAT
+#if _MSC_VER || defined(__MINGW32__)
+ struct _stat ss;
+ if (_stat(file_name, &ss) != 0) {
+#else
struct stat ss;
if (stat(file_name, &ss) != 0) {
+#endif
/* ignore errors while checking a file */
return(FALSE);
}
Index: save.c
===================================================================
RCS file: /cvsroot/yap/C/save.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- save.c 2001/06/08 19:10:43 1.10
+++ save.c 2001/06/22 17:53:36 1.11
@@ -873,6 +873,12 @@
#endif /* YAPOR */
#endif /* TABLING */
heap_regs->failcode = opcode(_op_fail);
+ heap_regs->failcode_1 = opcode(_op_fail);
+ heap_regs->failcode_2 = opcode(_op_fail);
+ heap_regs->failcode_3 = opcode(_op_fail);
+ heap_regs->failcode_4 = opcode(_op_fail);
+ heap_regs->failcode_5 = opcode(_op_fail);
+ heap_regs->failcode_6 = opcode(_op_fail);
heap_regs->trustfailcode = opcode(_trust_fail);
heap_regs->yescode = opcode(_Ystop);
#ifdef YAPOR
@@ -1089,6 +1095,8 @@
heap_regs->functor_change_module = FuncAdjust(heap_regs->functor_change_module);
heap_regs->functor_current_module = FuncAdjust(heap_regs->functor_current_module);
heap_regs->functor_mod_switch = FuncAdjust(heap_regs->functor_mod_switch);
+ heap_regs->functor_u_minus = FuncAdjust(heap_regs->functor_u_minus);
+ heap_regs->functor_u_plus = FuncAdjust(heap_regs->functor_u_plus);
heap_regs->functor_v_bar = FuncAdjust(heap_regs->functor_v_bar);
heap_regs->functor_var = FuncAdjust(heap_regs->functor_var);
#ifdef EUROTRA
Index: scanner.c
===================================================================
RCS file: /cvsroot/yap/C/scanner.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- scanner.c 2001/04/17 21:07:41 1.2
+++ scanner.c 2001/06/22 17:53:36 1.3
@@ -51,14 +51,6 @@
C <= (SU)) || (C >= 'a' && C <= (SL)))
#define my_isupper(C) ( C >= 'A' && C <= 'Z' )
-#ifndef INFINITY
-#define INFINITY (1.0/0.0)
-#endif
-
-#ifndef NAN
-#define NAN (0.0/0.0)
-#endif
-
STATIC_PROTO(void my_ungetch, (void));
STATIC_PROTO(int my_getch, (void));
STATIC_PROTO(Term float_send, (char *));
@@ -224,7 +216,7 @@
/* we have an overflow at s */
static Term
-read_int_overflow(const char *s, Int base)
+read_int_overflow(const char *s, Int base, Int val)
{
#ifdef USE_GMP
/* try to scan it as a bignum */
@@ -234,7 +226,7 @@
return(MkBigIntTerm(new));
#else
/* try to scan it as a float */
- return(float_send((char *)s));
+ return(MkIntegerTerm(val));
#endif
}
@@ -434,7 +426,7 @@
my_ungetch();
*--sp = '\0';
if (has_overflow)
- return(read_int_overflow(s,base));
+ return(read_int_overflow(s,base,val));
return (MkIntegerTerm(val));
}
do
@@ -465,12 +457,12 @@
*sp = '\0';
/* skip base */
if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
- return(read_int_overflow(s+2,16));
+ return(read_int_overflow(s+2,16,val));
if (s[1] == '\'')
- return(read_int_overflow(s+2,base));
+ return(read_int_overflow(s+2,base,val));
if (s[2] == '\'')
- return(read_int_overflow(s+3,base));
- return(read_int_overflow(s,base));
+ return(read_int_overflow(s+3,base,val));
+ return(read_int_overflow(s,base,val));
} else
return (MkIntegerTerm(val));
}
@@ -1172,7 +1164,7 @@
*/
#endif
if (has_overflow)
- t->TokInfo = read_int_overflow(TokImage,base);
+ t->TokInfo = read_int_overflow(TokImage,base,val);
else
t->TokInfo = MkIntegerTerm(val);
t->TokPos = TokenPos;
@@ -1274,13 +1266,13 @@
*sp = '\0';
/* skip base */
if (TokImage[0] == '0' && (TokImage[1] == 'x' || TokImage[1] == 'X'))
- TokenInfo = read_int_overflow(TokImage+2,16);
+ TokenInfo = read_int_overflow(TokImage+2,16,val);
else if (TokImage[1] == '\'')
- TokenInfo = read_int_overflow(TokImage+2,base);
+ TokenInfo = read_int_overflow(TokImage+2,base,val);
else if (TokImage[2] == '\'')
- TokenInfo = read_int_overflow(TokImage+3,base);
+ TokenInfo = read_int_overflow(TokImage+3,base,val);
else
- TokenInfo = read_int_overflow(TokImage,base);
+ TokenInfo = read_int_overflow(TokImage,base,val);
} else
TokenInfo = (CELL) MkIntegerTerm(val);
}
Index: stdpreds.c
===================================================================
RCS file: /cvsroot/yap/C/stdpreds.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- stdpreds.c 2001/05/28 19:54:53 1.4
+++ stdpreds.c 2001/06/22 17:53:36 1.5
@@ -304,14 +304,6 @@
}
-#ifndef INFINITY
-#define INFINITY (1.0/0.0)
-#endif
-
-#ifndef NAN
-#define NAN (0.0/0.0)
-#endif
-
static Term
get_num(char *t)
{
@@ -1249,7 +1241,7 @@
/* make sure we won't go creeping around */
CreepFlag = CalculateStackGap();
yap_flags[SPY_CREEP_FLAG] = 0;
- Error(PURE_ABORT,TermNil,"");
+ Abort("");
return(FALSE);
}
@@ -2084,6 +2076,7 @@
return(FALSE);
#endif
}
+
static Int
p_has_tabling(void)
Index: sysbits.c
===================================================================
RCS file: /cvsroot/yap/C/sysbits.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sysbits.c 2001/06/12 17:25:28 1.5
+++ sysbits.c 2001/06/22 17:53:36 1.6
@@ -652,7 +652,7 @@
#include <time.h>
/* since the point YAP was started */
-static struct timeb StartOfWTimes;
+static struct _timeb StartOfWTimes;
/* since last call to walltime */
#define LastWtime (*(struct timeb *)LastWtimePtr)
@@ -661,7 +661,7 @@
static void
InitWTime (void)
{
- ftime(&StartOfWTimes);
+ _ftime(&StartOfWTimes);
}
static void
@@ -675,9 +675,9 @@
Int
walltime (void)
{
- struct timeb tp;
+ struct _timeb tp;
- ftime(&tp);
+ _ftime(&tp);
if (StartOfWTimes.millitm > tp.millitm)
return((tp.time - StartOfWTimes.time - 1) * 1000 +
(StartOfWTimes.millitm - tp.millitm));
@@ -688,9 +688,9 @@
void walltime_interval(Int *now,Int *interval)
{
- struct timeb tp;
+ struct _timeb tp;
- ftime(&tp);
+ _ftime(&tp);
*now = (tp.time - StartOfWTimes.time) * 1000 +
(tp.millitm - StartOfWTimes.millitm);
*interval = (tp.time - LastWtime.time) * 1000 +
@@ -1068,151 +1068,157 @@
static char *_line = NULL;
#endif
-void
+static int
+InteractSIGINT(char ch) {
+ switch (ch) {
+ case 'a':
+ /* abort computation */
+ /* we can't do a direct abort, so ask the system to do
+ it for us */
+ p_creep();
+ PutValue(AtomThrow, MkAtomTerm(AtomTrue));
+ return(-1);
+ case 'c':
+ /* continue */
+ return(1);
+ case 'e':
+ /* exit */
+ exit_yap(0, "");
+ return(-1);
+ case 't':
+ /* start tracing */
+ PutValue (LookupAtom ("debug"), MkIntTerm (1));
+ PutValue (LookupAtom ("spy_sl"), MkIntTerm (0));
+ PutValue (LookupAtom ("spy_creep"), MkIntTerm (1));
+ p_creep ();
+ return(1);
+#ifdef LOW_LEVEL_TRACER
+ case 'T':
+ toggle_low_level_trace();
+ return(1);
+#endif
+ case 'd':
+ /* enter debug mode */
+ PutValue (LookupAtom ("debug"), MkIntTerm (1));
+ return(1);
+ case 's':
+ /* show some statistics */
+#if SHORT_INTS==0
+ YP_fprintf(YP_stderr, "aux. stack: %d ", Unsigned (AuxTop) -
+ Unsigned (LCL0 + 1));
+ if (Unsigned (AuxSp) <= Unsigned (LCL0))
+ YP_fprintf(YP_stderr, "( 0 bytes used)\n");
+ else
+ YP_fprintf(YP_stderr, "( %d bytes used)\n",
+ Unsigned (AuxSp) - Unsigned (LCL0 + 1));
+ YP_fprintf(YP_stderr, "heap space: %d ", Unsigned (AuxTop) -
+ Unsigned (HeapBase));
+ YP_fprintf(YP_stderr, "( %d bytes used for heap",
+ Unsigned (HeapUsed));
+ YP_fprintf(YP_stderr, " and %d bytes used for trail)\n",
+ Unsigned (TR) - Unsigned (TrailBase));
+ YP_fprintf(YP_stderr, "stack space: %d ", Unsigned (LCL0) -
+ Unsigned (H0));
+ YP_fprintf(YP_stderr, "( %d bytes used for local",
+ Unsigned (LCL0) - Unsigned (ASP));
+ YP_fprintf(YP_stderr, " and %d bytes used for global)\n",
+ Unsigned (H) - Unsigned (H0));
+#else
+ YP_fprintf(YP_stderr, "aux. stack: %ld ", Unsigned (AuxTop) -
+ Unsigned (LCL0 + 1));
+ if (Unsigned (AuxSp) <= Unsigned (LCL0))
+ YP_fprintf(YP_stderr, "( 0 bytes used)\n");
+ else
+ YP_fprintf(YP_stderr, "( %ld bytes used)\n",
+ Unsigned (AuxSp) - Unsigned (LCL0 + 1));
+ YP_fprintf(YP_stderr, "heap space: %ld ", Unsigned (AuxTop) -
+ Unsigned (HeapBase));
+ YP_fprintf(YP_stderr, "( %ld bytes used for heap",
+ Unsigned (HeapUsed));
+ YP_fprintf(YP_stderr, " and %ld bytes used for trail)\n",
+ Unsigned (TR) - Unsigned (TrailBase));
+ YP_fprintf(YP_stderr, "stack space: %ld ", Unsigned (LCL0) -
+ Unsigned (H0));
+ YP_fprintf(YP_stderr, "( %ld bytes used for local",
+ Unsigned (LCL0) - Unsigned (ASP));
+ YP_fprintf(YP_stderr, " and %ld bytes used for global)\n",
+ Unsigned (H) - Unsigned (H0));
+#endif
+#if SHORT_INTS
+ YP_fprintf(YP_stderr, "Runtime: %lds.\n", runtime ());
+ YP_fprintf(YP_stderr, "Cputime: %lds.\n", cputime ());
+ YP_fprintf(YP_stderr, "Walltime: %lds.\n", walltime ());
+#else
+ YP_fprintf(YP_stderr, "Runtime: %ds.\n", runtime ());
+ YP_fprintf(YP_stderr, "Cputime: %ds.\n", cputime ());
+ YP_fprintf(YP_stderr, "Walltime: %ds.\n", walltime ());
+#endif
+ return(1);
+ case EOF:
+ return(0);
+ break;
+ case 'h':
+ case '?':
+ default:
+ /* show an helpful message */
+ YP_fprintf(YP_stderr, "Please press one of:\n");
+ YP_fprintf(YP_stderr, " a for abort\n c for continue\n d for debug\n");
+ YP_fprintf(YP_stderr, " e for exit\n t for trace\n s for statistics\n");
+ return(0);
+ }
+}
+
+/*
+ This function talks to the user about a signal. We assume we are in
+ the context of the main Prolog thread (trivial in Unix, but hard in WIN32)
+*/
+int
ProcessSIGINT(void)
{
+ int ch, out;
- while (TRUE) {
- int ch;
-#ifdef MPW
- int ch0;
+#if HAVE_ISATTY
+ if (!isatty(0)) {
+ InteractSIGINT('e');
+ }
+#if !HAVE_LIBREADLINE
+ if (in_getc) {
+ return(0);
+ }
#endif
-
+#endif
+ do {
#if HAVE_LIBREADLINE
if (_line != (char *) NULL && _line != (char *) EOF)
free (_line);
_line = readline ("Action (h for help): ");
- if (_line == (char *)NULL || _line == (char *)EOF)
+ if (_line == (char *)NULL || _line == (char *)EOF) {
+ ch = EOF;
continue;
+ }
ch = _line[0];
#else
- YP_fprintf(YP_stderr, "\nAction (h for help): ");
- ch = YP_getchar ( );
- while ((YP_getchar()) != '\n');
-#endif
- switch (ch)
- {
- case 'a':
- /* abort computation, but take care in case we are within readline
- code */
- if (!(PrologMode & CritMode))
- {
-#if HAVE_SIGPROCMASK
- sigset_t sig_set;
- sigemptyset(&sig_set);
- sigaddset(&sig_set, SIGINT);
- sigprocmask(SIG_UNBLOCK, &sig_set, NULL);
-#elif HAVE_SIGGETMASK
- sigsetmask (siggetmask () ^ (1 << (SIGINT - 1)));
-#endif
-#ifdef VAX
- VaxFixFrame (CritMode);
-#endif
- /* we cannot abort until we finish readline :-( */
- if (!(PrologMode & CritMode)) {
-#if defined(__MINGW32__) || _MSC_VER
- /* we can't do a direct abort, so ask the system to do it for us */
- p_creep();
- PutValue(AtomThrow, MkAtomTerm(AtomTrue));
-#else
- Abort ((char *) NULL);
-#endif
-#if HAVE_LIBREADLINE
- }
-#endif
- }
- PrologMode |= AbortMode;
- return;
- case 'c':
- /* continue */
- return;
- case 'e':
- /* exit */
- exit_yap(0, "");
- case 't':
- /* start tracing */
- PutValue (LookupAtom ("debug"), MkIntTerm (1));
- PutValue (LookupAtom ("spy_sl"), MkIntTerm (0));
- PutValue (LookupAtom ("spy_creep"), MkIntTerm (1));
- p_creep ();
- return;
-#ifdef LOW_LEVEL_TRACER
- case 'T':
- toggle_low_level_trace();
- return;
-#endif
- case 'd':
- /* enter debug mode */
- PutValue (LookupAtom ("debug"), MkIntTerm (1));
- return;
- case 's':
- /* show some statistics */
-#if SHORT_INTS==0
- YP_fprintf(YP_stderr, "aux. stack: %d ", Unsigned (AuxTop) -
- Unsigned (LCL0 + 1));
- if (Unsigned (AuxSp) <= Unsigned (LCL0))
- YP_fprintf(YP_stderr, "( 0 bytes used)\n");
- else
- YP_fprintf(YP_stderr, "( %d bytes used)\n",
- Unsigned (AuxSp) - Unsigned (LCL0 + 1));
- YP_fprintf(YP_stderr, "heap space: %d ", Unsigned (AuxTop) -
- Unsigned (HeapBase));
- YP_fprintf(YP_stderr, "( %d bytes used for heap",
- Unsigned (HeapUsed));
- YP_fprintf(YP_stderr, " and %d bytes used for trail)\n",
- Unsigned (TR) - Unsigned (TrailBase));
- YP_fprintf(YP_stderr, "stack space: %d ", Unsigned (LCL0) -
- Unsigned (H0));
- YP_fprintf(YP_stderr, "( %d bytes used for local",
- Unsigned (LCL0) - Unsigned (ASP));
- YP_fprintf(YP_stderr, " and %d bytes used for global)\n",
- Unsigned (H) - Unsigned (H0));
-#else
- YP_fprintf(YP_stderr, "aux. stack: %ld ", Unsigned (AuxTop) -
- Unsigned (LCL0 + 1));
- if (Unsigned (AuxSp) <= Unsigned (LCL0))
- YP_fprintf(YP_stderr, "( 0 bytes used)\n");
- else
- YP_fprintf(YP_stderr, "( %ld bytes used)\n",
- Unsigned (AuxSp) - Unsigned (LCL0 + 1));
- YP_fprintf(YP_stderr, "heap space: %ld ", Unsigned (AuxTop) -
- Unsigned (HeapBase));
- YP_fprintf(YP_stderr, "( %ld bytes used for heap",
- Unsigned (HeapUsed));
- YP_fprintf(YP_stderr, " and %ld bytes used for trail)\n",
- Unsigned (TR) - Unsigned (TrailBase));
- YP_fprintf(YP_stderr, "stack space: %ld ", Unsigned (LCL0) -
- Unsigned (H0));
- YP_fprintf(YP_stderr, "( %ld bytes used for local",
- Unsigned (LCL0) - Unsigned (ASP));
- YP_fprintf(YP_stderr, " and %ld bytes used for global)\n",
- Unsigned (H) - Unsigned (H0));
-#endif
-#if SHORT_INTS
- YP_fprintf(YP_stderr, "Runtime: %lds.\n", runtime ());
- YP_fprintf(YP_stderr, "Cputime: %lds.\n", cputime ());
- YP_fprintf(YP_stderr, "Walltime: %lds.\n", walltime ());
-#else
- YP_fprintf(YP_stderr, "Runtime: %ds.\n", runtime ());
- YP_fprintf(YP_stderr, "Cputime: %ds.\n", cputime ());
- YP_fprintf(YP_stderr, "Walltime: %ds.\n", walltime ());
-#endif
- break;
- case EOF:
- /* ignore end of file */
- break;
- case 'h':
- case '?':
- default:
- /* show an helpful message */
- YP_fprintf(YP_stderr, "Please press one of:\n");
- YP_fprintf(YP_stderr, " a for abort\n c for continue\n d for debug\n");
- YP_fprintf(YP_stderr, " e for exit\n t for trace\n s for statistics\n");
- break;
- }
+ /* ask for a new line */
+ fprintf(stderr, "Action (h for help): ");
+ ch = getc(stdin);
+ /* first process up to end of line */
+ while ((fgetc(stdin)) != '\n');
+#endif
+ } while (!(out = InteractSIGINT(ch)));
+ if (out < 0)
+ sigint_pending = out;
+#if HAVE_LIBREADLINE
+ if (in_getc) {
+ longjmp(readline_jmpbuf, (out < 0 ? -1 : 1));
}
+#endif
+ return(out);
}
+/* This function is called from the signal handler to process signals.
+ We assume we are within the context of the signal handler, whatever
+ that might be
+*/
static RETSIGTYPE
#if defined(__svr4__)
HandleSIGINT (int sig, siginfo_t *x, ucontext_t *y)
@@ -1220,22 +1226,15 @@
HandleSIGINT (int sig)
#endif
{
-#if defined(__MINGW32__) || _MSC_VER
- extern int in_getc;
-
- if (in_getc) {
- /* YP_ungetc(YP_stdin,'\n');
- PrologMode |= InterruptMode; */
- in_getc = FALSE;
- return;
- }
-#else
+ my_signal(SIGINT, HandleSIGINT);
+#if (_MSC_VER || defined(__MINGW32__))
+ printf("hello\n");
+ return;
+#endif
#ifdef HAVE_SETBUF
/* make sure we are not waiting for the end of line */
YP_setbuf (stdin, NULL);
#endif
- my_signal(SIGINT, HandleSIGINT);
-#endif
if (snoozing)
{
snoozing = FALSE;
@@ -1266,6 +1265,7 @@
* 6 possibilities : abort, continue, trace, debug, help, exit
*/
+#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT)
static RETSIGTYPE
#if defined(__svr4__)
ReceiveSignal (int s, siginfo_t *x, ucontext_t *y)
@@ -1292,20 +1292,21 @@
exit (FALSE);
}
}
+#endif
-#if _MSC_VER || defined(__MINGW32__)
-static BOOL WINAPI MSCHandleSignal(DWORD dwCtrlType) {
+#if (_MSC_VER || defined(__MINGW32__))
+static BOOL WINAPI
+MSCHandleSignal(DWORD dwCtrlType) {
switch(dwCtrlType) {
case CTRL_C_EVENT:
- HandleSIGINT(SIGINT);
- break;
case CTRL_BREAK_EVENT:
- HandleSIGINT(SIGINT);
- break;
+ p_creep();
+ PutValue(AtomThrow, MkAtomTerm(AtomTrue));
+ PrologMode |= AbortMode;
+ return(TRUE);
default:
- exit_yap(1, "[ SYSTEM ERROR: Received Termination Event ]\n");
+ return(FALSE);
}
- return(TRUE);
}
#endif
@@ -1313,31 +1314,27 @@
static void
InitSignals (void)
{
+#if !defined(LIGHT) && !_MSC_VER && !defined(__MINGW32__) && !defined(LIGHT)
+ my_signal (SIGQUIT, ReceiveSignal);
+ my_signal (SIGKILL, ReceiveSignal);
+ my_signal(SIGALRM, HandleALRM);
+#endif
#if _MSC_VER || defined(__MINGW32__)
+ signal (SIGINT, SIG_IGN);
SetConsoleCtrlHandler(MSCHandleSignal,TRUE);
#else
my_signal (SIGINT, HandleSIGINT);
+#endif
#ifndef MPW
my_signal (SIGFPE, HandleMatherr);
-#if !defined(LIGHT) && !defined(_WIN32)
- my_signal (SIGQUIT, ReceiveSignal);
-#endif
-#endif
-#if !defined(LIGHT) && !defined(_WIN32)
- my_signal (SIGKILL, ReceiveSignal);
#endif
#if HAVE_SIGSEGV
my_signal_info (SIGSEGV, HandleSIGSEGV);
#endif
-#if !defined(LIGHT) && !defined(_WIN32)
- my_signal(SIGALRM, HandleALRM);
-#endif
-#endif
#ifdef ACOW
signal(SIGCHLD, SIG_IGN); /* avoid ghosts */
#endif
}
-
#endif /* HAVE_SIGNAL */
Index: tracer.c
===================================================================
RCS file: /cvsroot/yap/C/tracer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- tracer.c 2001/06/13 17:52:33 1.5
+++ tracer.c 2001/06/22 17:53:36 1.6
@@ -210,7 +210,6 @@
send_tracer_message("RETRY: ", s, arity, mname, args);
break;
}
-
}
void
Index: ypsocks.c
===================================================================
RCS file: /cvsroot/yap/C/ypsocks.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ypsocks.c 2001/05/28 19:54:53 1.2
+++ ypsocks.c 2001/06/22 17:53:36 1.3
@@ -78,7 +78,7 @@
#include <sys/param.h>
#endif
#endif /* HAVE_WINSOCK_H */
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
#include <io.h>
#include <winsock2.h>
#endif
@@ -177,7 +177,7 @@
#define MAXHOSTNAMELEN 256
#endif
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
#define socket_errno WSAGetLastError()
#define invalid_socket_fd(fd) (fd) == INVALID_SOCKET
#else
@@ -468,7 +468,7 @@
return(FALSE);
}
}
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
if (closesocket(fd) != 0) {
#else
if (close(fd) < 0) {
@@ -905,7 +905,7 @@
fd_set readfds, writefds, exceptfds;
struct timeval timeout, *ptime;
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
u_int fdmax=0;
#else
int fdmax=0;
@@ -943,7 +943,7 @@
/* fetch the input streams */
ti = t1;
while (ti != TermNil) {
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
u_int fd;
#else
int fd;
@@ -1038,8 +1038,8 @@
int faq = (strrchr(sin,'.') != NULL);
if (faq)
-#if _MSC_VER
- return(stricmp(name,sin) == 0);
+#if _MSC_VER || defined(__MINGW32__)
+ return(_stricmp(name,sin) == 0);
#else
return(strcasecmp(name,sin) == 0);
#endif
@@ -1052,8 +1052,8 @@
}
if (name[isize] != '.') return(FALSE);
name[isize] = '\0';
-#if _MSC_VER
- return(stricmp(name,sin) == 0);
+#if _MSC_VER || defined(__MINGW32__)
+ return(_stricmp(name,sin) == 0);
#else
return(strcasecmp(name,sin) == 0);
#endif
@@ -1129,7 +1129,7 @@
InitCPred("$socket_select", 4, p_socket_select, SafePredFlag|SyncPredFlag);
InitCPred("current_hostname", 1, p_current_hostname, SafePredFlag);
InitCPred("hostname_address", 2, p_hostname_address, SafePredFlag);
-#if _MSC_VER
+#if _MSC_VER || defined(__MINGW32__)
{
WSADATA info;
if (WSAStartup(MAKEWORD(2,1), &info) != 0)
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 17:53:39
|
Update of /cvsroot/yap/m4 In directory usw-pr-cvs1:/tmp/cvs-serv1211/m4 Modified Files: Yap.h.m4 Log Message: fixes tohandle interrupts ^C in Windows. Improvements to configure scripts for WIN32 configurations. --with-readline= option for configure Index: Yap.h.m4 =================================================================== RCS file: /cvsroot/yap/m4/Yap.h.m4,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Yap.h.m4 2001/05/03 17:13:18 1.4 +++ Yap.h.m4 2001/06/22 17:53:36 1.5 @@ -639,8 +639,8 @@ #ifdef TAGS_FAST_OPS #define IntInBnd(X) (Unsigned( ( (Int)(X) >> (32-7) ) + 1) <= 1) #else -#define IntInBnd(X) ( (X) < (Int)MAX_ABS_INT && \ - (X) > -(Int)MAX_ABS_INT-1 ) +#define IntInBnd(X) ( (X) < (MAX_ABS_INT) && \ + (X) > (-MAX_ABS_INT)-1 ) #endif #endif #ifdef C_PROLOG |
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 17:53:39
|
Update of /cvsroot/yap/LGPL In directory usw-pr-cvs1:/tmp/cvs-serv1211/LGPL Modified Files: README Log Message: fixes tohandle interrupts ^C in Windows. Improvements to configure scripts for WIN32 configurations. --with-readline= option for configure Index: README =================================================================== RCS file: /cvsroot/yap/LGPL/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README 2001/04/09 19:53:48 1.1.1.1 +++ README 2001/06/22 17:53:36 1.2 @@ -1,4 +1,6 @@ This directory includes programs that are distributed under the GNU -LGPL. Please check pillow/Copyright for further information. +LGPL. Please check pillow/Copyright for further information on +pillow's copyright and SWI-Prolog's win32console library directory for +more detailed info. |
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 17:53:39
|
Update of /cvsroot/yap/H
In directory usw-pr-cvs1:/tmp/cvs-serv1211/H
Modified Files:
Heap.h Yapproto.h yapio.h
Log Message:
fixes tohandle interrupts ^C in Windows.
Improvements to configure scripts for WIN32 configurations.
--with-readline= option for configure
Index: Heap.h
===================================================================
RCS file: /cvsroot/yap/H/Heap.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Heap.h 2001/06/11 17:40:16 1.6
+++ Heap.h 2001/06/22 17:53:36 1.7
@@ -47,6 +47,12 @@
yamop tableanswerresolutioncode;
#endif /* TABLING */
OPCODE failcode;
+ OPCODE failcode_1;
+ OPCODE failcode_2;
+ OPCODE failcode_3;
+ OPCODE failcode_4;
+ OPCODE failcode_5;
+ OPCODE failcode_6;
OPCODE trustfailcode;
struct {
OPCODE op;
@@ -244,6 +250,8 @@
functor_change_module,
functor_current_module,
functor_mod_switch,
+ functor_u_minus,
+ functor_u_plus,
functor_v_bar,
functor_var;
Term
@@ -426,6 +434,8 @@
#define FunctorChangeModule heap_regs->functor_change_module
#define FunctorCurrentModule heap_regs->functor_current_module
#define FunctorModSwitch heap_regs->functor_mod_switch
+#define FunctorUMinus heap_regs->functor_u_minus
+#define FunctorUPlus heap_regs->functor_u_plus
#define FunctorVBar heap_regs->functor_v_bar
#define FunctorVar heap_regs->functor_var
#define TermDollarU heap_regs->term_dollar_u
Index: Yapproto.h
===================================================================
RCS file: /cvsroot/yap/H/Yapproto.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Yapproto.h 2001/04/09 19:53:39 1.1.1.1
+++ Yapproto.h 2001/06/22 17:53:36 1.2
@@ -244,7 +244,7 @@
void STD_PROTO(InitSysbits,(void));
void STD_PROTO(InitSysPreds,(void));
int STD_PROTO(TrueFileName, (char *, char *, int));
-void STD_PROTO(ProcessSIGINT,(void));
+int STD_PROTO(ProcessSIGINT,(void));
double STD_PROTO(yap_random, (void));
/* tracer.c */
Index: yapio.h
===================================================================
RCS file: /cvsroot/yap/H/yapio.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- yapio.h 2001/06/12 17:25:28 1.5
+++ yapio.h 2001/06/22 17:53:36 1.6
@@ -33,7 +33,11 @@
#define YP_clearerr clearerr
#define YP_feof feof
#define YP_ferror ferror
+#if _MSC_VER || defined(__MINGW32__)
+#define YP_fileno _fileno
+#else
#define YP_fileno fileno
+#endif
#define YP_fopen fopen
#define YP_fclose fclose
#define YP_ftell ftell
@@ -44,6 +48,19 @@
#define YP_fdopen fdopen
#define init_yp_stdio()
+#if _MSC_VER || defined(__MINGW32__)
+#define open _open
+#define close _close
+#define popen _popen
+#define pclose _pclose
+#define read _read
+#define write _write
+#define isatty _isatty
+#define putenv(S) _putenv(S)
+#define chdir(P) _chdir(P)
+#define getcwd(B,S) _getcwd(B,S)
+#endif
+
#define YP_FILE FILE
extern int YP_stdin;
extern int YP_stdout;
@@ -298,3 +315,10 @@
#define HashFunction(CHP,OUT) { (OUT)=0; while(*(CHP) != '\0') (OUT) += *(CHP)++; (OUT) %= MaxHash; }
extern jmp_buf IOBotch;
+
+#if HAVE_LIBREADLINE
+extern jmp_buf readline_jmpbuf;
+#endif
+
+extern int in_getc, sigint_pending;
+
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-22 17:53:39
|
Update of /cvsroot/yap
In directory usw-pr-cvs1:/tmp/cvs-serv1211
Modified Files:
Makefile.in TO_DO changes4.3.html config.h.in configure
configure.in
Log Message:
fixes tohandle interrupts ^C in Windows.
Improvements to configure scripts for WIN32 configurations.
--with-readline= option for configure
Index: TO_DO
===================================================================
RCS file: /cvsroot/yap/TO_DO,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TO_DO 2001/06/11 20:20:36 1.8
+++ TO_DO 2001/06/22 17:53:36 1.9
@@ -13,7 +13,6 @@
- document system(library)
- document new interface functions.
- ^C can break code.
-- check library(random)
- add more precision when outputting floats.
- make statistics/0 better looking.
- mask when installing.
@@ -78,3 +77,4 @@
- remove pl/nfr.yap and misc/yap.spec from CVS.
- deterministic trail entries for multi-assignment variables.
- weird going ons with prompt and readline
+- check library(random)
Index: changes4.3.html
===================================================================
RCS file: /cvsroot/yap/changes4.3.html,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- changes4.3.html 2001/06/11 17:40:16 1.28
+++ changes4.3.html 2001/06/22 17:53:36 1.29
@@ -16,6 +16,13 @@
<h2>Yap-4.3.19:</h2>
<ul>
+ <li>FIXED: ^c works with Yap/MINGW32 (not in cygwin).</li>
+ <li>FIXED: ^c a should never core dump.</li>
+ <li>FIXED: comparison of variables in sub-terms.</li>
+ <li>FIXED: parse +inf, -inf, +nan, -nan as floats and write
+ them accordingly.</li>
+ <li>FIXED: comparison was breaking ISO.</li>
+ <li>FIXED: use $(CC) never gcc directly.</li>
<li>FIXED: support newer versions of readline by moving text
to prompt.</li>
<li>FIXED: upgrade to autoconf 2.5.</li>
Index: config.h.in
===================================================================
RCS file: /cvsroot/yap/config.h.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config.h.in 2001/05/28 19:54:52 1.4
+++ config.h.in 2001/06/22 17:53:36 1.5
@@ -38,6 +38,7 @@
#undef HAVE_MEMORY_H
#undef HAVE_NETDB_H
#undef HAVE_NETINET_IN_H
+#undef HAVE_READLINE_READLINE_H
#undef HAVE_REGEX_H
#undef HAVE_SIGINFO_H
#undef HAVE_SIGNAL_H
@@ -96,22 +97,22 @@
/* Define return type for signal */
#undef RETSIGTYPE
+#undef HAVE_ACOSH
#undef HAVE_ALARM
#undef HAVE_ASINH
-#undef HAVE_ACOSH
#undef HAVE_ATANH
#undef HAVE_CHDIR
#undef HAVE_DUP2
#undef HAVE_FETESTEXCEPT
#undef HAVE_FINITE
+#undef HAVE_GETCWD
+#undef HAVE_GETENV
#undef HAVE_GETHOSTBYNAME
#undef HAVE_GETHOSTID
#undef HAVE_GETHOSTNAME
-#undef HAVE_GETRUSAGE
-#undef HAVE_GETCWD
-#undef HAVE_GETENV
#undef HAVE_GETHRTIME
#undef HAVE_GETPWNAM
+#undef HAVE_GETRUSAGE
#undef HAVE_GETTIMEOFDAY
#undef HAVE_GETWD
#undef HAVE_ISATTY
@@ -121,11 +122,11 @@
#undef HAVE_LINK
#undef HAVE_LOCALTIME
#undef HAVE_LSTAT
-#undef HAVE_MMAP
#undef HAVE_MEMCPY
#undef HAVE_MEMMOVE
#undef HAVE_MKSTEMP
#undef HAVE_MKTEMP
+#undef HAVE_MMAP
#undef HAVE_OPENDIR
#undef HAVE_POPEN
#undef HAVE_PUTENV
@@ -134,24 +135,24 @@
#undef HAVE_RENAME
#undef HAVE_RINT
#undef HAVE_SBRK
-#undef HAVE_STAT
#undef HAVE_SELECT
#undef HAVE_SETBUF
#undef HAVE_SETLINEBUF
#undef HAVE_SHMAT
#undef HAVE_SIGACTION
#undef HAVE_SIGGETMASK
+#undef HAVE_SIGINTERRUPT
#undef HAVE_SIGNAL
#undef HAVE_SIGPROCMASK
-#undef HAVE_SIGSEGV
#undef HAVE_SIGSETJMP
#undef HAVE_SLEEP
#undef HAVE_SNPRINTF
#undef HAVE_SOCKET
+#undef HAVE_STAT
+#undef HAVE_STRCHR
#undef HAVE_STRERROR
#undef HAVE_STRNCAT
#undef HAVE_STRNCPY
-#undef HAVE_STRCHR
#undef HAVE_STRTOD
#undef HAVE_SYSTEM
#undef HAVE_TIME
@@ -160,8 +161,9 @@
#undef HAVE_USLEEP
#undef HAVE_VSNPRINTF
#undef HAVE_WAITPID
-#undef HAVE_ENVIRON
#undef HAVE_MPZ_XOR
+
+#undef HAVE_SIGSEGV
#define SELECT_TYPE_ARG1
#define SELECT_TYPE_ARG234
Index: configure
===================================================================
RCS file: /cvsroot/yap/configure,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configure 2001/06/11 20:20:36 1.7
+++ configure 2001/06/22 17:53:36 1.8
@@ -31,6 +31,8 @@
--enable-debug-yap enable C-debugging for YAP "
ac_help="$ac_help
--with-gmp[=DIR] use GNU Multiple Precision in DIR"
+ac_help="$ac_help
+ --with-readline[=DIR] use GNU Readline Library in DIR"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -548,7 +550,7 @@
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
[...2173 lines suppressed...]
s%@LN_S@%$LN_S%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
@@ -3987,6 +4180,7 @@
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@INSTALL_COMMAND@%$INSTALL_COMMAND%g
+s%@CPP@%$CPP%g
s%@INSTALL_DLLS@%$INSTALL_DLLS%g
s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
@@ -4038,7 +4232,7 @@
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile LGPL/win32cons/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
Index: configure.in
===================================================================
RCS file: /cvsroot/yap/configure.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configure.in 2001/06/11 20:20:36 1.7
+++ configure.in 2001/06/22 17:53:36 1.8
@@ -11,15 +11,7 @@
AC_SUBST(GCC)
AC_SUBST(C_INTERF_FLAGS)
-AC_CYGWIN
-if test "$ac_cv_cygwin" = "yes" -a "$CC" = "gcc"
-then
- CC="gcc -mno-cygwin"
-fi
-AC_MINGW32
-
dnl Checks for programs.
-AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
@@ -67,17 +59,23 @@
fi
[yap_cv_gmp=yes])
+AC_ARG_WITH(readline,
+ [ --with-readline[=DIR] use GNU Readline Library in DIR],
+ if test $withval = yes; then
+ yap_cv_readline=yes
+ elif test $withval = no; then
+ yap_cv_readline=no
+ else
+ yap_cv_readline=$with_readline
+ LDFLAGS="$LDFLAGS -L${yap_cv_readline}/lib"
+ CPPFLAGS="$CPPFLAGS -I${yap_cv_readline}/include"
+ fi
+ [yap_cv_readline=yes])
+
AC_CANONICAL_SYSTEM
AC_DEFINE_UNQUOTED(HOST_ALIAS,"${host_alias}")
-if test "$cross_compiling" = "yes"
-then
- YAP_EXTRAS=
-else
- AC_SYS_RESTARTABLE_SYSCALLS
-fi
-
dnl Compilation Flags
if test "$GCC" = "yes"
then
@@ -167,22 +165,22 @@
dnl mingw does not get along well with libm
dnl cygnus and mingw32 also need wsock32 to use sockets.
dnl
-if test "$MINGW32" = "yes"
+if test "$target_os" = "cygwin"
then
- AC_CHECK_LIB(wsock32,main)
- INSTALL_COMMAND=install_mingw32
-else
- if test "$CYGWIN" = "yes" -a "$MINGW32" = "no"
+ if test "$CC" = "gcc"
then
+ CC="gcc -mno-cygwin"
+ AC_CHECK_LIB(wsock32,main)
+ INSTALL_COMMAND=install_mingw32
+ yap_cv_readline=no
+ else
AC_CHECK_LIB(wsock32,main)
AC_CHECK_LIB(cygwin,main)
fi
+else
INSTALL_COMMAND="install_unix"
AC_CHECK_LIB(m,sin)
AC_CHECK_LIB(socket,socket)
- AC_CHECK_LIB(termcap,tgetent)
- AC_CHECK_LIB(readline,readline)
- AC_CHECK_LIB(gmp,main)
AC_CHECK_LIB(nsl,main,
have_nsl=yes
,
@@ -193,6 +191,24 @@
,
have_dl=no)
fi
+if test "$yap_cv_readline" != "no"
+then
+ AC_CHECK_LIB(termcap,tgetent)
+ AC_CHECK_LIB(readline,readline)
+fi
+if test "$yap_cv_gmp" != "no"
+then
+ AC_CHECK_LIB(gmp,main)
+fi
+
+AC_PROG_CPP
+
+if test "$cross_compiling" = "yes"
+then
+ YAP_EXTRAS=
+else
+ AC_SYS_RESTARTABLE_SYSCALLS
+fi
dnl System stuff for dynamic linking.
dnl
@@ -389,17 +405,23 @@
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h sys/file.h sys/socket.h sys/types.h sys/time.h)
-AC_CHECK_HEADERS(sys/ucontext.h sys/un.h unistd.h sys/times.h ieeefp.h)
-AC_CHECK_HEADERS(sys/param.h errno.h netdb.h netinet/in.h arpa/inet.h)
-AC_CHECK_HEADERS(string.h memory.h sys/mman.h sys/stat.h stdarg.h ctype.h)
-AC_CHECK_HEADERS(sys/resource.h limits.h siginfo.h time.h fenv.h)
-AC_CHECK_HEADERS(fpu_control.h sys/shm.h regex.h winsock.h winsock2.h)
-AC_CHECK_HEADERS(sys/select.h direct.h dirent.h signal.h io.h)
+AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h errno.h fcntl.h)
+AC_CHECK_HEADERS(fenv.h fpu_control.h ieeefp.h io.h limits.h memory.h)
+AC_CHECK_HEADERS(netdb.h netinet/in.h regex.h)
+AC_CHECK_HEADERS(siginfo.h signal.h stdarg.h string.h sys/file.h)
+AC_CHECK_HEADERS(sys/mman.h sys/param.h sys/resource.h sys/select.h)
+AC_CHECK_HEADERS(sys/shm.h sys/socket.h sys/stat.h)
+AC_CHECK_HEADERS(sys/time.h sys/times.h sys/types.h)
+AC_CHECK_HEADERS(sys/ucontext.h sys/un.h)
+AC_CHECK_HEADERS(time.h unistd.h winsock.h winsock2.h)
if test "$yap_cv_gmp" != "no"
then
AC_CHECK_HEADERS(gmp.h)
fi
+if test "$yap_cv_readline" != "no"
+then
+ AC_CHECK_HEADERS( readline/readline.h)
+fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@@ -561,15 +583,17 @@
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd getwd strtod getrusage chdir signal times siggetmask)
-AC_CHECK_FUNCS(strchr memcpy isatty sbrk shmat mmap random rand sigaction)
-AC_CHECK_FUNCS(snprintf vsnprintf setbuf system link getpwnam dup2 sigprocmask)
-AC_CHECK_FUNCS(labs strncat tmpnam getenv gettimeofday gethrtime putenv)
-AC_CHECK_FUNCS(strerror socket memmove alarm asinh acosh atanh rint)
-AC_CHECK_FUNCS(stat select fetestexcept finite strncpy mkstemp isnan)
-AC_CHECK_FUNCS(setlinebuf lstat opendir localtime time gethostname)
-AC_CHECK_FUNCS(gethostid gethostbyname kill mktemp popen rename waitpid)
-AC_CHECK_FUNCS(sleep usleep)
+AC_CHECK_FUNCS(acosh alarm asinh atanh chdir dup2)
+AC_CHECK_FUNCS(fetestexcept finite getcwd getenv)
+AC_CHECK_FUNCS(gethostbyname gethostid gethostname)
+AC_CHECK_FUNCS(gethrtime getpwnam getrusage gettimeofday getwd)
+AC_CHECK_FUNCS(isatty isnan kill labs link localtime lstat)
+AC_CHECK_FUNCS(memcpy memmove mkstemp mktemp mmap opendir)
+AC_CHECK_FUNCS(popen putenv rand random rename rint sbrk select)
+AC_CHECK_FUNCS(setbuf setlinebuf shmat sigaction siggetmask siginterrupt)
+AC_CHECK_FUNCS(signal sigprocmask sleep snprintf socket stat)
+AC_CHECK_FUNCS(strchr strerror strncat strncpy strtod system)
+AC_CHECK_FUNCS(time times tmpnam usleep vsnprintf waitpid)
dnl check for mpz_xor
AC_MSG_CHECKING(for mpz_xor)
@@ -595,7 +619,7 @@
mkdir -p CHR
mkdir -p CLPQR
-AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile)
+AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile LGPL/win32cons/Makefile)
make depend
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-19 17:51:10
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv15556/C
Modified Files:
cmppreds.c
Log Message:
Yap would get order of variables in terms wrong.
Index: cmppreds.c
===================================================================
RCS file: /cvsroot/yap/C/cmppreds.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cmppreds.c 2001/06/19 17:34:27 1.2
+++ cmppreds.c 2001/06/19 17:51:07 1.3
@@ -69,11 +69,11 @@
if (out) goto done;
}
else {
- out = 1;
+ out = -1;
goto done;
}
} else if (IsVarTerm(d1)) {
- out = -1;
+ out = 1;
goto done;
} else {
if (d0 == d1) continue;
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-19 17:47:48
|
Update of /cvsroot/yap/docs In directory usw-pr-cvs1:/tmp/cvs-serv14773/docs Modified Files: yap.tex Log Message: fix duplicated title (Paulo Moura) fix info on term ordering to respect ISO standard. Index: yap.tex =================================================================== RCS file: /cvsroot/yap/docs/yap.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- yap.tex 2001/06/12 14:07:59 1.19 +++ yap.tex 2001/06/19 17:47:45 1.20 @@ -678,7 +678,7 @@ @end table @node Compiling Under Visual C++, Tuning for SGI cc, Tuning for GCC, Machine Options -@subsection Compiling Under SGI's cc +@subsection Compiling Under Visual C++ Yap compiles cleanly under Microsoft's Visual C++ release 6.0. We next give a step-by-step tutorial on how to compile Yap manually using this @@ -2787,9 +2787,10 @@ @item variables are roughly ordered by "age" (the "oldest" variable is put first); +@item +floating point numbers are sorted in increasing order; @item -numbers are sorted in increasing order. Integers precede their floating -point equivalents; +Integers are sorted in increasing order; @item atoms are sorted in lexicographic order; @item |
|
From: Vitor S. C. <vs...@us...> - 2001-06-19 17:34:41
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv11988/C
Modified Files:
cmppreds.c
Log Message:
In ISO term order, floats are always less than integers.
Index: cmppreds.c
===================================================================
RCS file: /cvsroot/yap/C/cmppreds.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cmppreds.c 2001/04/09 19:53:32 1.1.1.1
+++ cmppreds.c 2001/06/19 17:34:27 1.2
@@ -93,9 +93,7 @@
if (IsIntTerm(d1))
out = IntOfTerm(d0) - IntOfTerm(d1);
else if (IsFloatTerm(d1)) {
- out = rfloat(IntOfTerm(d0) - FloatOfTerm(d1));
- if (out == 0)
- out = 1;
+ out = 1;
} else if (IsLongIntTerm(d1)) {
out = IntOfTerm(d0) - LongIntOfTerm(d1);
#ifdef USE_GMP
@@ -107,48 +105,32 @@
else out = -1;
if (out != 0)
goto done;
- }
- else if (IsFloatTerm(d0)) {
- if (IsFloatTerm(d1))
+ } else if (IsFloatTerm(d0)) {
+ if (IsFloatTerm(d1)){
out = rfloat(FloatOfTerm(d0) - FloatOfTerm(d1));
- else if (IsIntTerm(d1)) {
- out = rfloat(FloatOfTerm(d0) - IntOfTerm(d1));
- if (out == 0)
- out = -1;
- } else if (IsLongIntTerm(d1)) {
- out = rfloat(FloatOfTerm(d0) - LongIntOfTerm(d1));
- if (out == 0)
- out = -1;
-#ifdef USE_GMP
- } else if (IsBigIntTerm(d1)) {
- Float outf = FloatOfTerm(d0) - mpz_get_d(BigIntOfTerm(d1));
- if (outf <= 0.0)
- out = -1;
- else
- out = 1;
-#endif
- } else if (IsRefTerm(d1))
+ } else if (IsRefTerm(d1)) {
out = 1;
- else out = -1;
+ } else {
+ out = -1;
+ }
if (out != 0)
goto done;
- }
- else if (IsLongIntTerm(d0)) {
+ } else if (IsLongIntTerm(d0)) {
if (IsIntTerm(d1))
out = LongIntOfTerm(d0) - IntOfTerm(d1);
else if (IsFloatTerm(d1)) {
- out = rfloat(LongIntOfTerm(d0) - FloatOfTerm(d1));
- if (out == 0)
- out = 1;
- } else if (IsLongIntTerm(d1))
+ out = 1;
+ } else if (IsLongIntTerm(d1)) {
out = LongIntOfTerm(d0) - LongIntOfTerm(d1);
#ifdef USE_GMP
- else if (IsBigIntTerm(d1))
+ } else if (IsBigIntTerm(d1)) {
out = -mpz_cmp_si(BigIntOfTerm(d1), LongIntOfTerm(d0));
#endif
- else if (IsRefTerm(d1))
+ } else if (IsRefTerm(d1)) {
out = 1 ;
- else out = -1;
+ } else {
+ out = -1;
+ }
if (out != 0)
goto done;
}
@@ -157,11 +139,7 @@
if (IsIntTerm(d1))
out = mpz_cmp_si(BigIntOfTerm(d0), IntOfTerm(d1));
else if (IsFloatTerm(d1)) {
- Float fout = mpz_get_d(BigIntOfTerm(d0)) - FloatOfTerm(d1);
- if (fout >= 0.0)
- out = 1;
- else
- out = -1;
+ out = 1;
} else if (IsLongIntTerm(d1))
out = mpz_cmp_si(BigIntOfTerm(d0), LongIntOfTerm(d1));
else if (IsBigIntTerm(d1))
@@ -324,11 +302,7 @@
if (IsIntTerm(t2))
return (IntOfTerm(t1) - IntOfTerm(t2));
if (IsFloatTerm(t2)) {
- int out = rfloat(IntOfTerm(t1) - FloatOfTerm(t2));
- if (out == 0)
- return(1);
- else
- return(out);
+ return(1);
}
if (IsLongIntTerm(t2))
return(IntOfTerm(t1) - LongIntOfTerm(t2));
@@ -343,26 +317,7 @@
if (IsFloatTerm(t1)) {
if (IsFloatTerm(t2))
return(rfloat(FloatOfTerm(t1) - FloatOfTerm(t2)));
- else if (IsIntTerm(t2)) {
- int out = rfloat(FloatOfTerm(t1) - IntOfTerm(t2));
- if (out == 0)
- return(-1);
- else
- return(out);
- } else if (IsLongIntTerm(t2)) {
- int out = rfloat(FloatOfTerm(t1) - LongIntOfTerm(t2));
- if (out == 0)
- return(-1);
- else
- return(out);
-#ifdef USE_GMP
- } else if (IsBigIntTerm(t2)) {
- Float out = FloatOfTerm(t2) - mpz_get_d(BigIntOfTerm(t1));
- if (out <= 0.0)
- return (-1);
- return(1);
-#endif
- } else if (IsRefTerm(t2))
+ if (IsRefTerm(t2))
return (1);
return (-1);
}
@@ -370,11 +325,7 @@
if (IsIntTerm(t2))
return (LongIntOfTerm(t1) - IntOfTerm(t2));
if (IsFloatTerm(t2)) {
- int out = rfloat(LongIntOfTerm(t1) - FloatOfTerm(t2));
- if (out == 0)
- return(1);
- else
- return(out);
+ return(1);
}
if (IsLongIntTerm(t2))
return (LongIntOfTerm(t1) - LongIntOfTerm(t2));
@@ -391,11 +342,7 @@
if (IsIntTerm(t2))
return(mpz_cmp_si(BigIntOfTerm(t1), IntOfTerm(t2)));
if (IsFloatTerm(t2)) {
- Float out = mpz_get_d(BigIntOfTerm(t1)) - FloatOfTerm(t2);
- if (out >= 0.0)
- return(1);
- else
- return(-1);
+ return(1);
}
if (IsLongIntTerm(t2))
return(mpz_cmp_si(BigIntOfTerm(t1), LongIntOfTerm(t2)));
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-19 16:32:02
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv29907/C
Modified Files:
parser.c write.c
Log Message:
parser should parse +inf,-inf,+nan,-nan as floating point numbers
write should write inf as +inf and nan as +nan
Index: parser.c
===================================================================
RCS file: /cvsroot/yap/C/parser.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- parser.c 2001/04/09 19:53:37 1.1.1.1
+++ parser.c 2001/06/19 16:31:59 1.2
@@ -343,6 +343,14 @@
return (t);
}
+#ifndef INFINITY
+#define INFINITY (1.0/0.0)
+#endif
+
+#ifndef NAN
+#define NAN (0.0/0.0)
+#endif
+
static Term
ParseTerm(int prio)
{
@@ -386,6 +394,29 @@
t = tokptr->TokInfo;
NextToken;
break;
+ }
+ } else if (tokptr->Tok == Name_tok) {
+ Atom at = (Atom)tokptr->TokInfo;
+ if ((Atom)t == AtomPlus) {
+ if (at == AtomInf) {
+ t = MkFloatTerm(INFINITY);
+ NextToken;
+ break;
+ } else if (at == AtomNan) {
+ t = MkFloatTerm(NAN);
+ NextToken;
+ break;
+ }
+ } else if ((Atom)t == AtomMinus) {
+ if (at == AtomInf) {
+ t = MkFloatTerm(-INFINITY);
+ NextToken;
+ break;
+ } else if (at == AtomNan) {
+ t = MkFloatTerm(NAN);
+ NextToken;
+ break;
+ }
}
}
if (opprio <= prio) {
Index: write.c
===================================================================
RCS file: /cvsroot/yap/C/write.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- write.c 2001/04/09 19:53:39 1.1.1.1
+++ write.c 2001/06/19 16:31:59 1.2
@@ -126,6 +126,8 @@
sprintf(s, "%.6g", f);
while (*pt == ' ')
pt++;
+ if (*pt == 'i' || *pt == 'n') /* inf or nan */
+ wrputc('+');
wrputs(pt);
if (*pt == '-') pt++;
while ((ch = *pt) != '\0') {
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-18 18:33:23
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv13875/C
Modified Files:
unify.c
Log Message:
fix == at top-level
Index: unify.c
===================================================================
RCS file: /cvsroot/yap/C/unify.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- unify.c 2001/04/09 19:53:38 1.1.1.1
+++ unify.c 2001/06/18 18:33:20 1.2
@@ -1238,6 +1238,22 @@
if (f0 != f1) {
return(FALSE);
}
+ if (IsExtensionFunctor(f0)) {
+ switch ((CELL)f0) {
+ case (CELL)FunctorDBRef:
+ return (d0 == d1);
+ case (CELL)FunctorLongInt:
+ return(LongIntOfTerm(d0) == LongIntOfTerm(d1));
+#ifdef USE_GMP
+ case (CELL)FunctorBigInt:
+ return (mpz_cmp(BigIntOfTerm(d0), BigIntOfTerm(d1)) == 0);
+#endif
+ case (CELL)FunctorDouble:
+ return(FloatOfTerm(d0) == FloatOfTerm(d1));
+ default:
+ return(FALSE);
+ }
+ }
return(iequ_complex(RepAppl(d0), RepAppl(d0)+ArityOfFunctor(f0), RepAppl(d1)));
}
return(FALSE);
|