225 The function `cxBufferSeek()` is a `fseek()`-like function that sets the current position in the buffer |
225 The function `cxBufferSeek()` is a `fseek()`-like function that sets the current position in the buffer |
226 relative to the start (when `whence` is `SEEK_SET`), the current position (when `whence` is `SEEK_CUR`), |
226 relative to the start (when `whence` is `SEEK_SET`), the current position (when `whence` is `SEEK_CUR`), |
227 or end (when `whence` is `SEEK_END`) of the buffer. |
227 or end (when `whence` is `SEEK_END`) of the buffer. |
228 |
228 |
229 If the resulting position is negative, or larger than the size (i.e. the first unused byte), |
229 If the resulting position is negative, or larger than the size (i.e. the first unused byte), |
230 this function returns non-zero and sets `errno` to `EOVERFLOW`. |
230 this function returns non-zero and sets `errno` to `EINVAL`. |
231 |
231 |
232 > Note that the error behavior of `cxBufferSeek()` is not exactly the same as for POSIX `fseek()`. |
232 > Note that the behavior of `cxBufferSeek()` when seeking beyond the end of the buffer is not exactly the same as for POSIX `fseek()`. |
233 |
233 |
234 ## Shift Contents |
234 ## Shift Contents |
235 |
235 |
236 ```C |
236 ```C |
237 #include <cx/buffer.h> |
237 #include <cx/buffer.h> |