YAP 7.1.0
Character-Based Input/Output

YAP implements most of the ISO-Prolog built-ins. More...

Detailed Description

YAP implements most of the ISO-Prolog built-ins.

character I/O


Class Documentation

◆ at_end_of_stream/1

class at_end_of_stream/1

at_end_of_stream(+ S)

defined in the ISO standard

Succeed if the stream S has stream position end-of-stream or past-end-of-stream Note that S must be a readable stream

◆ at_end_of_stream/0

class at_end_of_stream/0

at_end_of_stream

defined in the ISO standard

Succeed if the current stream has stream position end-of-stream or past-end-of-stream

◆ get/2

class get/2

get(S, - C)

The next non-blank character from the stream S is unified with C Blank characters are the ones whose ASCII codes are not greater than 32 If there are no more non-blank characters in the stream, C is unified with -1 If end_of_stream has already been reached in the previous reading, this call will give an error message

◆ get_char/2

class get_char/2

get_char(+ S,- C)

defined in the ISO standard

If C is unbound, or is an atom representation of a character, and the stream S is a text stream, read the next character from that stream and unify its representation as an atom with C

◆ get_code/2

class get_code/2

get_code(+ S,- C)

defined in the ISO standard

If C is unbound, or is a character code, and the stream S is a text stream, read the next character from that stream and unify its code with C

◆ get/1

class get/1

get(- C)

The next non-blank character from the current input stream is unified with C Blank characters are the ones whose ASCII codes are not greater than 32 If there are no more non-blank characters in the stream, C is unified with -1 If end_of_stream has already been reached in the previous reading, this call will give an error message

◆ get_code/1

class get_code/1

get_code(- C)

defined in the ISO standard

If C is unbound, or is the code for a character, and the current stream is a text stream, read the next character from the current stream and unify its code with C

◆ get_char/1

class get_char/1

get_char(- C)

defined in the ISO standard

If C is unbound, or is an atom representation of a character, and the current stream is a text stream, read the next character from the current stream and unify its atom representation with C

◆ get_byte/2

class get_byte/2

get_byte(+ S,- C)

defined in the ISO standard

If C is unbound, or is a byte, and the stream S is a binary stream, read the next byte from that stream and unify its code with C A byte is represented as either a number between 1 and 255, or as -1 for EOF

◆ get_byte/1

class get_byte/1

get_byte(- C)

defined in the ISO standard

If C is unbound, or is a character code, and the current stream is a binary stream, read the next byte from the current stream and unify its code with C

◆ put_code/1

class put_code/1

put_code(+ N)

defined in the ISO standard

Outputs to the current output stream the character whose ASCII code is N The current output stream must be a text stream The character N must be a legal ASCII character code, an expression yielding such a code, or a list in which case only the first element is used

◆ put_code/2

class put_code/2

put_code(+ S,+ N)

defined in the ISO standard

As put_code(N), but to text stream S

◆ put_char/1

class put_char/1

put_char(+ N)

defined in the ISO standard

Outputs to the current output stream the character who is used to build the representation of atom A The current output stream must be a text stream

◆ put_char/2

class put_char/2

put_char(+ S,+ A)

defined in the ISO standard

As put_char(A), but to text stream S

◆ tab/1

class tab/1

tab(+ N)

Outputs N spaces to the current output stream

◆ tab/2

class tab/2

tab(+ S,+ N)

The same as tab/1 , but using stream S

◆ nl/1

class nl/1

nl(+ S)

defined in the ISO standard

Outputs a new line to stream S

◆ nl/0

class nl/0

nl

defined in the ISO standard

Outputs a new line to the current output stream

◆ put_byte/2

class put_byte/2

put_byte(+ S,+ N)

defined in the ISO standard

As put_byte(N), but to binary stream S

◆ put_byte/1

class put_byte/1

put_byte(+ N)

defined in the ISO standard

Outputs to the current output stream the character whose code is N The current output stream must be a binary stream

◆ skip/1

class skip/1

skip(+ N)

Skips input characters until the next occurrence of the character with ASCII code N The argument to this predicate can take the same forms as those for put (see 6.11)

◆ skip/2

class skip/2

skip(+ S,- C)

Like skip/1 , but using stream S instead of the current input stream

◆ flush_output/1

class flush_output/1

flush_output(+Stream)

Flush the stream Stream, that is, make sure all pending output is committed before any further execution

Parameters
+_Stream_

◆ flush_output/0

class flush_output/0

flush_output

Flush the current output stream, that is, make sure all pending output is committed before any further execution By default this is user_output, but it may be changed by current_output/1

◆ peek_code/2

class peek_code/2

peek_code(+ S, - C)

defined in the ISO standard

If C is unbound, or is the code for a character, and the stream S is a text stream, read the next character from the current stream and unify its code with C, while leaving the current stream position unaltered

◆ peek_code/1

class peek_code/1

peek_code( - C)

defined in the ISO standard

If C is unbound, or is the code for a character, and the current input stream is a text stream, read the next character from the current stream and unify its code with C, while leaving the current stream position unaltered

◆ peek_byte/2

class peek_byte/2

peek_byte(+Stream, - C)

defined in the ISO standard

If C is unbound, or is a character code, and Stream is a binary stream, read the next byte from the current stream and unify its code with C, while leaving the current stream position unaltered

◆ peek_byte/1

class peek_byte/1

peek_byte( - C)

defined in the ISO standard

If C is unbound, or is a character code, and Stream is a binary stream, read the next byte from the current stream and unify its code with C, while leaving the current stream position unaltered

◆ peek_char/2

class peek_char/2

peek_char(+_S_, - C)

defined in the ISO standard

If C is unbound, or is a character code, and the stream S is a binary stream, read the next byte from the current stream and unify the atom with C, while leaving the stream position unaltered

◆ peek_char/1

class peek_char/1

peek_char( - C)

defined in the ISO standard

If C is unbound, or is a character code, and the current input stream is a binary stream, read the next byte from the current stream and unify the atom with C, while leaving the stream position unaltered

◆ peek/2

class peek/2

peek(+ S, - C)

deprecated

If C is unbound, or is the code for a character, and the stream S is a text stream, read the next character from the current stream and unify its code with C, while leaving the current stream position unaltered

Please use the ISO built-in peek_code/2

◆ peek/1

class peek/1

peek( - C)

defined in the ISO standard

If C is unbound, or is the code for a character, and the currrent input stream is a text stream, read the next character from the current stream and unify its code with C, while leaving the current stream position unaltered

◆ ttyget/1

class ttyget/1

ttyget(- C)

The same as get(C), but from stream user_input

◆ ttyget0/1

class ttyget0/1

ttyget0(- C)

The same as get0(C), but from stream user_input

◆ ttyskip/1

class ttyskip/1

ttyskip(- C)

Like skip/1 , but always using stream user_input stream

◆ ttyput/1

class ttyput/1

ttyput(+ N)

As put(N) but always to user_output

Function Documentation

◆ CharOfAtom()

Int CharOfAtom ( Atom  at)

CharOfAtom: convert an atom into a single character.

Parameters
atthe atom
Returns
the char

Definition at line 90 of file charsio.c.

◆ store_code()

bool store_code ( int  ch,
Term t  USES_REGS 
)

Definition at line 209 of file charsio.c.

◆ Yap_flush_all()

void Yap_flush_all ( void  )

Definition at line 1163 of file charsio.c.

◆ Yap_FlushStreams()

void Yap_FlushStreams ( void  )

Definition at line 1165 of file charsio.c.

◆ Yap_InitCharsio()

void Yap_InitCharsio ( void  )

Definition at line 1167 of file charsio.c.

◆ Yap_peek()

int Yap_peek ( int  sno)

Definition at line 205 of file charsio.c.

◆ Yap_peekChar()

int Yap_peekChar ( int  sno)

Definition at line 170 of file charsio.c.

◆ Yap_peekWide()

int Yap_peekWide ( int  sno)

Definition at line 115 of file charsio.c.

◆ Yap_popChar()

int Yap_popChar ( int  sno)

Definition at line 161 of file charsio.c.

◆ Yap_popWide()

int Yap_popWide ( int  sno)

Definition at line 106 of file charsio.c.

Functions

Int CharOfAtom (Atom at)
 CharOfAtom: convert an atom into a single character. More...
 
int Yap_popWide (int sno)
 
int Yap_peekWide (int sno)
 
int Yap_popChar (int sno)
 
int Yap_peekChar (int sno)
 
int Yap_peek (int sno)
 
bool store_code (int ch, Term t USES_REGS)
 
void Yap_flush_all (void)
 
void Yap_FlushStreams (void)
 
void Yap_InitCharsio (void)