fix lack of streams message (Ulrich Neumerkel #60)
This commit is contained in:
parent
c00facdd17
commit
7304fbda13
14
C/errors.c
14
C/errors.c
@ -1337,6 +1337,20 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
|
||||
serious = TRUE;
|
||||
}
|
||||
break;
|
||||
case RESOURCE_ERROR_MAX_STREAMS:
|
||||
{
|
||||
int i;
|
||||
Term ti[1];
|
||||
|
||||
i = strlen(tmpbuf);
|
||||
ti[0] = MkAtomTerm(AtomStreams);
|
||||
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
|
||||
tp = tmpbuf+i;
|
||||
psize -= i;
|
||||
fun = FunctorError;
|
||||
serious = TRUE;
|
||||
}
|
||||
break;
|
||||
case RESOURCE_ERROR_STACK:
|
||||
{
|
||||
int i;
|
||||
|
@ -2291,7 +2291,7 @@ p_open (void)
|
||||
return (PlIOError (SYSTEM_ERROR,file_name,"file name is too long in open/3"));
|
||||
sno = GetFreeStreamD();
|
||||
if (sno < 0)
|
||||
return (PlIOError (SYSTEM_ERROR,TermNil, "new stream not available for open/3"));
|
||||
return (PlIOError (RESOURCE_ERROR_MAX_STREAMS,TermNil, "all streams in use"));
|
||||
st = &Stream[sno];
|
||||
/* can never happen */
|
||||
tenc = Deref(ARG5);
|
||||
|
1
H/Yap.h
1
H/Yap.h
@ -479,6 +479,7 @@ typedef enum
|
||||
REPRESENTATION_ERROR_CHARACTER_CODE,
|
||||
REPRESENTATION_ERROR_MAX_ARITY,
|
||||
RESOURCE_ERROR_HUGE_INT,
|
||||
RESOURCE_ERROR_MAX_STREAMS,
|
||||
RESOURCE_ERROR_MAX_THREADS,
|
||||
RESOURCE_ERROR_MEMORY,
|
||||
RESOURCE_ERROR_STACK,
|
||||
|
@ -243,6 +243,7 @@
|
||||
AtomStaticClause = Yap_FullLookupAtom("$static_clause");
|
||||
AtomStaticProcedure = Yap_LookupAtom("static_procedure");
|
||||
AtomStream = Yap_FullLookupAtom("$stream");
|
||||
AtomStreams = Yap_FullLookupAtom("streams");
|
||||
AtomStreamOrAlias = Yap_LookupAtom("stream_or_alias");
|
||||
AtomStreamPos = Yap_FullLookupAtom("$stream_position");
|
||||
AtomStreamPosition = Yap_LookupAtom("stream_position");
|
||||
|
@ -245,6 +245,7 @@
|
||||
AtomStaticClause = AtomAdjust(AtomStaticClause);
|
||||
AtomStaticProcedure = AtomAdjust(AtomStaticProcedure);
|
||||
AtomStream = AtomAdjust(AtomStream);
|
||||
AtomStreams = AtomAdjust(AtomStreams);
|
||||
AtomStreamOrAlias = AtomAdjust(AtomStreamOrAlias);
|
||||
AtomStreamPos = AtomAdjust(AtomStreamPos);
|
||||
AtomStreamPosition = AtomAdjust(AtomStreamPosition);
|
||||
|
@ -492,6 +492,8 @@
|
||||
#define AtomStaticProcedure Yap_heap_regs->AtomStaticProcedure_
|
||||
Atom AtomStream_;
|
||||
#define AtomStream Yap_heap_regs->AtomStream_
|
||||
Atom AtomStreams_;
|
||||
#define AtomStreams Yap_heap_regs->AtomStreams_
|
||||
Atom AtomStreamOrAlias_;
|
||||
#define AtomStreamOrAlias Yap_heap_regs->AtomStreamOrAlias_
|
||||
Atom AtomStreamPos_;
|
||||
|
@ -254,6 +254,7 @@ A StackFree N "stackfree"
|
||||
A StaticClause F "$static_clause"
|
||||
A StaticProcedure N "static_procedure"
|
||||
A Stream F "$stream"
|
||||
A Streams F "streams"
|
||||
A StreamOrAlias N "stream_or_alias"
|
||||
A StreamPos F "$stream_position"
|
||||
A StreamPosition N "stream_position"
|
||||
|
@ -244,14 +244,16 @@ system_message(error(representation_error(character_code), Where)) -->
|
||||
[ 'REPRESENTATION ERROR- ~w: expected character code' - [Where] ].
|
||||
system_message(error(representation_error(max_arity), Where)) -->
|
||||
[ 'REPRESENTATION ERROR- ~w: number too big' - [Where] ].
|
||||
system_message(error(resource_error(code_space), Where)) -->
|
||||
[ 'RESOURCE ERROR- not enough code space' - [Where] ].
|
||||
system_message(error(resource_error(huge_int), Where)) -->
|
||||
[ 'RESOURCE ERROR- too large an integer in absolute value' - [Where] ].
|
||||
system_message(error(resource_error(memory), Where)) -->
|
||||
[ 'RESOURCE ERROR- not enough virtual memory' - [Where] ].
|
||||
system_message(error(resource_error(stack), Where)) -->
|
||||
[ 'RESOURCE ERROR- not enough stack' - [Where] ].
|
||||
system_message(error(resource_error(code_space), Where)) -->
|
||||
[ 'RESOURCE ERROR- not enough code space' - [Where] ].
|
||||
system_message(error(resource_error(streams), Where)) -->
|
||||
[ 'RESOURCE ERROR- could not find a free stream' - [Where] ].
|
||||
system_message(error(resource_error(threads), Where)) -->
|
||||
[ 'RESOURCE ERROR- too many open threads' - [Where] ].
|
||||
system_message(error(resource_error(trail), Where)) -->
|
||||
|
Reference in New Issue
Block a user