isbpl/docs/stream.md

71 lines
1.5 KiB
Markdown
Raw Normal View History

2022-05-23 20:12:32 +02:00
# Documentation: stream.isbpl
2022-05-23 20:19:06 +02:00
Library to interact with IO streams and the internet.
2022-05-23 20:12:32 +02:00
## Functions
### `STREAM.stdin ::: -> path`
Returns the path to the os-dependant unix-/dev/stdin equivalent
2022-05-23 20:12:32 +02:00
### `stream.write ::: data id -> `
Writes data to a stream
2022-05-23 20:12:32 +02:00
### `stream ::: [DYN]`
Native for actions related to streams
2022-05-23 20:12:32 +02:00
### `stream.readline ::: id -> string`
Returns the line that was read as a string. -1 means EOF.
2022-05-23 20:12:32 +02:00
## Variables
### STREAM.create.file.out
Constant to indicate create.file.out action: `filename STREAM.create.file.out stream -> id`.
Creates an output stream.
2022-05-23 20:12:32 +02:00
### STREAM.create.file.in
Constant to indicate create.file.in action: `filename STREAM.create.file.in stream -> id`.
Creates an input stream.
2022-05-23 20:12:32 +02:00
### STREAM.close
Constant to indicate close action: `id STREAM.close stream -> `.
Closes a stream.
2022-05-23 20:12:32 +02:00
### STREAM.create.socket
Constant to indicate create.socket action: `ip port STREAM.create.socket stream -> id`.
Creates an IO stream to a TCP server.
2022-05-23 20:12:32 +02:00
### STREAM.create.server
Constant to indicate create.server action: `port STREAM.create.server stream -> id`.
Creates an input stream. Each int read from it is a new IO socket stream id.
2022-05-23 20:12:32 +02:00
### STREAM.read
Constant to indicate read action: `id STREAM.read stream -> int`.
Reads a value from an input stream.
2022-05-23 20:12:32 +02:00
### STREAM.write
Constant to indicate write action: `int id STREAM.write stream -> `.
Writes a value to an output stream.
2022-05-23 20:12:32 +02:00