Next: , Previous: , Up: mpg-bpr   [Contents][Index]


11.3.219 stream_code/2

Synopsis

stream_code(-Stream, +CStream)

stream_code(+Stream, -CStream)

Converts between Prolog representation, Stream, and C representation, CStream, of a stream.

Arguments

Stream

stream_object

A valid Prolog stream.

CStream

integer

Representing an SP_stream * pointer.

Description

At least one argument must be ground. stream_code/2 is used when there are input/output related operations performed on the same stream in both Prolog code and foreign code. The CStream value can be used as the stream argument to any of the SP_* functions taking a stream argument.

Exceptions

instantiation_error

Both Stream and CStream unbound.

type_error

Stream or CStream is not a stream type or CStream is not an integer type.

existence_error

Stream is syntactically valid but does not name an open stream or CStream is of integer type but does not name a pointer to a stream.

See Also

Prolog Streams.


Send feedback on this subject.