![]() |
DDraceNetwork Documentation
|
Typedefs | |
| typedef struct ASYNCIO | ASYNCIO |
| typedef void * | IOHANDLE |
Enumerations | |
| enum | { IOFLAG_READ = 1 , IOFLAG_WRITE = 2 , IOFLAG_APPEND = 4 } |
| enum | ESeekOrigin { IOSEEK_START = 0 , IOSEEK_CUR = 1 , IOSEEK_END = 2 } |
I/O related operations.
Checks whether errors have occurred during the asynchronous writing.
Call this function regularly to see if there are errors. Call this function after aio_wait to see if the process of writing to the file succeeded.
| aio | Handle to the file. |
0 on success, or non-0 on error. Frees the resources associated with the asynchronous file handle.
| aio | Handle to the file. |
Locks the ASYNCIO structure so it can't be written into by other threads.
| aio | Handle to the file. |
Wraps a IOHANDLE for asynchronous writing.
| io | Handle to the file. |
Unlocks the ASYNCIO structure after finishing the contiguous write.
| aio | Handle to the file. |
Wait for the asynchronous operations to complete.
| aio | Handle to the file. |
Queues a chunk of data for writing.
| aio | Handle to the file. |
| buffer | Pointer to the data that should be written. |
| size | Number of bytes to write. |
Queues a newline for writing.
| aio | Handle to the file. |
| IOHANDLE io_current_exe | ( | ) |
Returns a handle for the current executable.
Checks whether an error occurred during I/O with the file.
| io | Handle to the file. |
0 on success, or non-0 on error. Empties all buffers and writes all pending data.
| io | Handle to the file. |
0 on success. Gets the total length of the file. Resets cursor to the beginning.
| io | Handle to the file. |
-1 on failure. Opens a file.
| filename | File to open. |
| flags | A set of IOFLAG flags. |
nullptr on failure. Reads data into a buffer from a file.
| io | Handle to the file to read data from. |
| buffer | Pointer to the buffer that will receive the data. |
| size | Number of bytes to read from the file. |
Reads the rest of the file into a buffer.
| io | Handle to the file to read data from. |
| result | Receives the file's remaining contents. |
| result_len | Receives the file's remaining length. |
true on success, false on failure.Reads the rest of the file into a null-terminated buffer with no internal null bytes.
| io | Handle to the file to read data from. |
nullptr on failure.| int io_seek | ( | IOHANDLE | io, |
| int64_t | offset, | ||
| ESeekOrigin | origin | ||
| ) |
Seeks to a specified offset in the file.
| io | Handle to the file. |
| offset | Offset from position to search. |
| origin | Position to start searching from. |
0 on success. Skips data in a file.
| io | Handle to the file. |
| size | Number of bytes to skip. |
0 on success. | IOHANDLE io_stderr | ( | ) |
Returns a handle for the standard error.
| IOHANDLE io_stdin | ( | ) |
Returns a handle for the standard input.
| IOHANDLE io_stdout | ( | ) |
Returns a handle for the standard output.
Synchronize file changes to disk.
| io | Handle to the file. |
0 on success. Gets the current position in the file.
| io | Handle to the file. |
-1 on failure. Writes data from a buffer to a file.
| io | Handle to the file. |
| buffer | Pointer to the data that should be written. |
| size | Number of bytes to write. |