memory streams
This commit is contained in:
parent
8d64753c54
commit
ff3185b551
@ -269,7 +269,6 @@ typedef struct {
|
|||||||
} gap_t;
|
} gap_t;
|
||||||
|
|
||||||
typedef struct format_status {
|
typedef struct format_status {
|
||||||
int format_error;
|
|
||||||
gap_t gap[16];
|
gap_t gap[16];
|
||||||
// number of octets
|
// number of octets
|
||||||
int phys_start;
|
int phys_start;
|
||||||
@ -537,7 +536,6 @@ static Int doformat(volatile Term otail, volatile Term oargs,
|
|||||||
bool alloc_fstr = false;
|
bool alloc_fstr = false;
|
||||||
|
|
||||||
|
|
||||||
finfo.format_error = FALSE;
|
|
||||||
if (GLOBAL_Stream[sno0].status & InMemory_Stream_f) {
|
if (GLOBAL_Stream[sno0].status & InMemory_Stream_f) {
|
||||||
old_handler = GLOBAL_Stream[sno].u.mem_string.error_handler;
|
old_handler = GLOBAL_Stream[sno].u.mem_string.error_handler;
|
||||||
GLOBAL_Stream[sno].u.mem_string.error_handler = (void *)&format_botch;
|
GLOBAL_Stream[sno].u.mem_string.error_handler = (void *)&format_botch;
|
||||||
@ -640,10 +638,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// it starts here
|
// it starts here
|
||||||
finfo.format_error = false;
|
|
||||||
finfo.gapi = 0;
|
|
||||||
sno0 = sno;
|
sno0 = sno;
|
||||||
finfo.format_error = false;
|
|
||||||
finfo.gapi = 0;
|
finfo.gapi = 0;
|
||||||
finfo.phys_start = 0;
|
finfo.phys_start = 0;
|
||||||
finfo.lstart = 0;
|
finfo.lstart = 0;
|
||||||
@ -1133,7 +1128,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
|
|||||||
ta[1] = oargs;
|
ta[1] = oargs;
|
||||||
Yap_Error(LOCAL_Error_TYPE,
|
Yap_Error(LOCAL_Error_TYPE,
|
||||||
Yap_MkApplTerm(Yap_MkFunctor(AtomFormat, 2), 2, ta),
|
Yap_MkApplTerm(Yap_MkFunctor(AtomFormat, 2), 2, ta),
|
||||||
"format/2");
|
"arguments to format");
|
||||||
}
|
}
|
||||||
if (GLOBAL_Stream[sno].status & InMemory_Stream_f) {
|
if (GLOBAL_Stream[sno].status & InMemory_Stream_f) {
|
||||||
GLOBAL_Stream[sno].u.mem_string.error_handler = old_handler;
|
GLOBAL_Stream[sno].u.mem_string.error_handler = old_handler;
|
||||||
|
Reference in New Issue
Block a user