Functions | |
enum io_type_e | io_type (io_t *io) |
Returns the type of the given io. | |
ssize_t | io_pipe (io_t *out, io_t *in) |
Write the input stream to the output stream. | |
int | io_dup (io_t *io, io_t **pio) |
Duplicate an IO handle. | |
ssize_t | io_copy (io_t *out, io_t *in, size_t size) |
Copy a block of data between two io_t objects. | |
ssize_t | io_seek (io_t *io, size_t off) |
Seek to the given position. | |
ssize_t | io_tell (io_t *io) |
Return the current file position. | |
int | io_close (io_t *io) |
Close the given io object. | |
int | io_free (io_t *io) |
Free an io_t object. | |
ssize_t | io_read (io_t *io, char *buf, size_t size) |
Read a block of data from an io_t object. | |
ssize_t | io_printf (io_t *io, const char *fmt,...) |
Write a string to io using printf-style format strings. | |
ssize_t | io_flush (io_t *io) |
Flush the write buffer. | |
ssize_t | io_write (io_t *io, const char *buf, size_t size) |
Write a block of data to an io_t object. | |
ssize_t | io_putc (io_t *io, char c) |
Write a char to an io_t object. | |
ssize_t | io_getc (io_t *io, char *pc) |
Read a char from an io_t object. | |
ssize_t | io_get_until (io_t *io, char stop_at, char *buf, size_t size) |
Read a chunk of data until the given character is found. | |
ssize_t | io_gets (io_t *io, char *buf, size_t size) |
Read a line from an io_t object. | |
int | io_codec_add_head (io_t *io, codec_t *c) |
Insert a codec at the head the codec chain. | |
int | io_codec_add_tail (io_t *io, codec_t *c) |
Append a codec to the codec chain. | |
int | io_codecs_remove (io_t *io) |
Flush, remove and free all codecs in the codec chain. | |
int | io_name_set (io_t *io, const char *name) |
Set the name of an io_t object. | |
int | io_name_get (io_t *io, char *name, size_t sz) |
Return the name of the given io_t object. |
|
Return the type of the given io (see enum io_type_e).
Definition at line 43 of file io.c. References io_s::type. |
|
Read all data from
Definition at line 61 of file io.c. References io_read(), and io_write(). |
|
Create a copy of
Definition at line 106 of file io.c. References io_s::refcnt. |
|
Read from
Definition at line 132 of file io.c. References io_read(), and io_write(). |
|
Moves the read/write file offset so that the next read or the next write will start at the given position. Note that not all
Definition at line 175 of file io.c. References io_flush(), and io_s::seek. |
|
Return the current file position. There exists a unique read and write position offset.
Definition at line 197 of file io.c. References io_flush(), and io_s::tell. |
|
Close the underlying source/sink of the given
Definition at line 442 of file io.c. References io_s::close. Referenced by io_free(). |
|
Free the given
Definition at line 469 of file io.c. References io_s::free, io_close(), io_codecs_remove(), io_flush(), io_s::name, io_s::rbuf, io_s::refcnt, io_s::ubuf, and io_s::wbuf. Referenced by u_tmpfile_open(). |
|
Read
Definition at line 572 of file io.c. References io_s::eof, io_s::rbuf, io_s::rcount, and io_s::roff. Referenced by io_copy(), io_getc(), io_pipe(), and u_md5io(). |
|
Printf-like function used to easily write strings to
Definition at line 620 of file io.c. References io_write(). |
|
Force a write of all buffered data to the output device.
Definition at line 671 of file io.c. References io_s::wbuf, io_s::wcount, and io_s::write. Referenced by io_free(), io_seek(), io_tell(), and io_write(). |
|
Write
Definition at line 706 of file io.c. References io_flush(), io_s::wbuf, and io_s::wcount. Referenced by io_copy(), io_pipe(), io_printf(), and io_putc(). |
|
Write the character
Definition at line 748 of file io.c. References io_write(). |
|
Read a char from the
Definition at line 764 of file io.c. References io_read(). |
|
Read from
Definition at line 802 of file io.c. References io_s::rbuf, io_s::rcount, and io_s::roff. Referenced by io_gets(). |
|
Read a line from
Definition at line 875 of file io.c. References io_get_until(). Referenced by u_getline(). |
|
Definition at line 889 of file io.c. References io_s::codec_chain. |
|
Definition at line 909 of file io.c. References io_s::codec_chain. |
|
Definition at line 928 of file io.c. References io_s::codec_chain, codec_free(), and io_s::wbuf. Referenced by io_free(). |
|
Set the name of the given
Definition at line 963 of file io.c. References io_s::name. Referenced by u_file_open(), and u_tmpfile_open(). |
|
Save in
Definition at line 994 of file io.c. References io_s::name. |