improve SWI compatibility.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <wchar.h>
|
||||
#if HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
@@ -450,10 +451,16 @@ UNICODE file functions.
|
||||
|
||||
#ifdef SIO_MAGIC /* defined from <SWI-Stream.h> */
|
||||
extern X_API int PL_unify_stream(term_t t, IOSTREAM *s);
|
||||
extern X_API int PL_open_stream(term_t t, IOSTREAM *s); /* compat */
|
||||
extern X_API int PL_get_stream_handle(term_t t, IOSTREAM **s);
|
||||
#define PL_open_stream PL_unify_stream
|
||||
extern X_API int PL_get_stream_handle(term_t t, IOSTREAM **s);\
|
||||
extern X_API IOSTREAM *Snew(void *handle,int flags,IOFUNCTIONS *functions);
|
||||
extern X_API int Sgetcode(IOSTREAM *);
|
||||
extern X_API int Sfeof(IOSTREAM *);
|
||||
#endif
|
||||
|
||||
#define succeed return TRUE
|
||||
#define fail return FALSE
|
||||
|
||||
extern X_API const char *PL_cwd(void);
|
||||
|
||||
void swi_install(void);
|
||||
|
@@ -164,6 +164,8 @@ typedef struct io_stream
|
||||
struct io_stream * upstream; /* stream providing our input */
|
||||
struct io_stream * downstream; /* stream providing our output */
|
||||
unsigned newline : 2; /* Newline mode */
|
||||
int io_errno; /* Save errno value */
|
||||
void * exception; /* pending exception (record_t) */
|
||||
intptr_t reserved[3]; /* reserved for extension */
|
||||
} IOSTREAM;
|
||||
|
||||
@@ -224,6 +226,8 @@ typedef struct io_stream
|
||||
#define SIO_GETSIZE (1) /* get size of underlying object */
|
||||
#define SIO_GETFILENO (2) /* get underlying file (if any) */
|
||||
#define SIO_SETENCODING (3) /* modify encoding of stream */
|
||||
#define SIO_FLUSHOUTPUT (4) /* flush output */
|
||||
#define SIO_LASTERROR (5) /* string holding last error */
|
||||
|
||||
/* Sread_pending() */
|
||||
#define SIO_RP_BLOCK 0x1 /* wait for new input */
|
||||
|
Reference in New Issue
Block a user