diff options
Diffstat (limited to '')
-rw-r--r-- | lib/buffer.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/buffer.h b/lib/buffer.h index 5d98c31..a0b82d2 100644 --- a/lib/buffer.h +++ b/lib/buffer.h @@ -14,21 +14,21 @@ extern "C" { /* Create a new buffer. Memory will be allocated in chunks of the given size. If the argument is 0, the library will supply a reasonable default size suitable for buffering socket I/O. */ -extern struct buffer *buffer_new(size_t); +extern struct buffer *buffer_new(size_t size); /* Free all data in the buffer. */ -extern void buffer_reset(struct buffer *); +extern void buffer_reset(struct buffer *b); /* This function first calls buffer_reset to release all buffered data. Then it frees the struct buffer itself. */ -extern void buffer_free(struct buffer *); +extern void buffer_free(struct buffer *b); /* Add the given data to the end of the buffer. */ -extern void buffer_put(struct buffer *, const void *, size_t); +extern void buffer_put(struct buffer *b, const void *p, size_t size); /* Add a single character to the end of the buffer. */ -extern void buffer_putc(struct buffer *, uint8_t); +extern void buffer_putc(struct buffer *b, uint8_t c); /* Add a NUL-terminated string to the end of the buffer. */ -extern void buffer_putstr(struct buffer *, const char *); +extern void buffer_putstr(struct buffer *b, const char *str); /* Add given data, inline-expanding \n to \r\n */ extern void buffer_put_crlf(struct buffer *b, const void *p, size_t size); @@ -36,10 +36,10 @@ extern void buffer_put_crlf(struct buffer *b, const void *p, size_t size); single NUL-terminated string allocated using XMALLOC(MTYPE_TMP). Note that this function does not alter the state of the buffer, so the data is still inside waiting to be flushed. */ -char *buffer_getstr(struct buffer *); +char *buffer_getstr(struct buffer *b); /* Returns 1 if there is no pending data in the buffer. Otherwise returns 0. */ -int buffer_empty(struct buffer *); +int buffer_empty(struct buffer *b); typedef enum { /* An I/O error occurred. The buffer should be destroyed and the @@ -59,12 +59,12 @@ typedef enum { /* Try to write this data to the file descriptor. Any data that cannot be written immediately is added to the buffer queue. */ -extern buffer_status_t buffer_write(struct buffer *, int fd, const void *, - size_t); +extern buffer_status_t buffer_write(struct buffer *b, int fd, const void *p, + size_t size); /* This function attempts to flush some (but perhaps not all) of the queued data to the given file descriptor. */ -extern buffer_status_t buffer_flush_available(struct buffer *, int fd); +extern buffer_status_t buffer_flush_available(struct buffer *b, int fd); /* The following 2 functions (buffer_flush_all and buffer_flush_window) are for use in lib/vty.c only. They should not be used elsewhere. */ @@ -72,7 +72,7 @@ extern buffer_status_t buffer_flush_available(struct buffer *, int fd); /* Call buffer_flush_available repeatedly until either all data has been flushed, or an I/O error has been encountered, or the operation would block. */ -extern buffer_status_t buffer_flush_all(struct buffer *, int fd); +extern buffer_status_t buffer_flush_all(struct buffer *b, int fd); /* Attempt to write enough data to the given fd to fill a window of the given width and height (and remove the data written from the buffer). @@ -85,7 +85,7 @@ extern buffer_status_t buffer_flush_all(struct buffer *, int fd); to return -1 (because the logic for handling the erase and more features is too complicated to retry the write later). */ -extern buffer_status_t buffer_flush_window(struct buffer *, int fd, int width, +extern buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width, int height, int erase, int no_more); #ifdef __cplusplus |