Next: , Previous: , Up: syslib   [Index]


12.19 Low level port structures

The following bindings are exported by the library (vicare system $io).

Function: port? obj

Return true if obj is the reference to a port structure; return false otherwise.

Unsafe Operation: $make-port attrs idx sz buf tr id read write getp setp cl cookie

Allocate a new port structure, initialise its fields with the arguments, return a reference to it.

Unsafe Operation: $port-index port
Unsafe Operation: $port-size port
Unsafe Operation: $port-buffer port
Unsafe Operation: $port-transcoder port
Unsafe Operation: $port-id port
Unsafe Operation: $port-read! port
Unsafe Operation: $port-write! port
Unsafe Operation: $port-get-position port
Unsafe Operation: $port-set-position! port
Unsafe Operation: $port-close port
Unsafe Operation: $port-cookie port

Accessors for the fields of a port structure.

Unsafe Operation: $port-attrs port

Given a port value: return a fixnum representing the port attributes.

Safe Operation: $port-tag port

Extract from a port reference a fixnum representing the port attributes; if the argument is not a port reference the return value is zero.

Unsafe Operation: $set-port-index! port new-index

Mutator for the buffer index field.

Unsafe Operation: $set-port-size! port new-used-size

Mutator for the buffer used size field.

Unsafe Operation: $set-port-attrs! port new-attrs

Mutator for the port attributes.