/usr/include/Yap/iopreds.h is in yap 6.2.2-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | /*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: iopreds.c *
* Last rev: 5/2/88 *
* mods: *
* comments: Input/Output C implemented predicates *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#endif
/*
* This file defines main data-structure for stream management,
*
*/
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h>
#endif
#include <wchar.h>
#if HAVE_LIBREADLINE
#if defined(_MSC_VER) || defined(__MINGW32__)
FILE *rl_instream, *rl_outstream;
#endif
#endif
#define MEM_BUF_CODE 0
#define MEM_BUF_MALLOC 1
typedef int (*GetsFunc)(int, UInt, char *);
typedef struct stream_desc
{
union {
struct {
struct io_stream *swi_ptr;
} swi_stream;
struct {
Atom name;
Term user_name;
#if defined(__MINGW32__) || defined(_MSC_VER)
#define PLGETC_BUF_SIZE 4096
char *buf, *ptr;
int left;
#endif
YP_File file;
} file;
struct {
char *buf; /* where the file is being read from/written to */
int src; /* where the space comes from, 0 code space, 1 malloc */
Int max_size; /* maximum buffer size (may be changed dynamically) */
UInt pos;
volatile void *error_handler;
} mem_string;
struct {
#if defined(__MINGW32__) || defined(_MSC_VER)
HANDLE hdl;
#else
int fd;
#endif
} pipe;
#if USE_SOCKET
struct {
socket_domain domain;
socket_info flags;
int fd;
} socket;
#endif
} u;
Int charcount, linecount, linepos;
Int status;
int och;
#if defined(YAPOR) || defined(THREADS)
lockvar streamlock; /* protect stream access */
#endif
int (* stream_putc)(int, int); /* function the stream uses for writing */
int (* stream_getc)(int); /* function the stream uses for reading */
GetsFunc stream_gets; /* function the stream uses for reading a sequence of characters */
/* function the stream uses for parser. It may be different if the ISO
character conversion is on */
int (* stream_wgetc_for_read)(int);
int (* stream_wgetc)(int);
int (* stream_wputc)(int,wchar_t);
encoding_t encoding;
mbstate_t mbstate;
}
StreamDesc;
#define YAP_ERROR NIL
#define MaxStreams 64
#define Free_Stream_f 0x000001
#define Output_Stream_f 0x000002
#define Input_Stream_f 0x000004
#define Append_Stream_f 0x000008
#define Eof_Stream_f 0x000010
#define Null_Stream_f 0x000020
#define Tty_Stream_f 0x000040
#define Socket_Stream_f 0x000080
#define Binary_Stream_f 0x000100
#define Eof_Error_Stream_f 0x000200
#define Reset_Eof_Stream_f 0x000400
#define Past_Eof_Stream_f 0x000800
#define Push_Eof_Stream_f 0x001000
#define Seekable_Stream_f 0x002000
#define Promptable_Stream_f 0x004000
#if USE_SOCKET
#define Client_Socket_Stream_f 0x008000
#define Server_Socket_Stream_f 0x010000
#endif
#define InMemory_Stream_f 0x020000
#define Pipe_Stream_f 0x040000
#define Popen_Stream_f 0x080000
#define User_Stream_f 0x100000
#define HAS_BOM_f 0x200000
#define RepError_Prolog_f 0x400000
#define RepError_Xml_f 0x800000
#define SWI_Stream_f 0x1000000
#define EXPAND_FILENAME 0x000080
#define StdInStream 0
#define StdOutStream 1
#define StdErrStream 2
#define ALIASES_BLOCK_SIZE 8
void STD_PROTO (Yap_InitStdStreams, (void));
Term STD_PROTO (Yap_StreamPosition, (int));
EXTERN inline int
GetCurInpPos (int inp_stream)
{
return (Stream[inp_stream].linecount);
}
|