libosmovty 1.10.0.57-8972
Osmocom VTY library
|
Buffering to output and input. More...
#include <sys/types.h>
Go to the source code of this file.
Enumerations | |
enum | buffer_status_t { BUFFER_ERROR = -1 , BUFFER_EMPTY = 0 , BUFFER_PENDING = 1 } |
Functions | |
struct buffer * | buffer_new (void *ctx, size_t) |
void | buffer_reset (struct buffer *) |
void | buffer_free (struct buffer *) |
void | buffer_put (struct buffer *, const void *, size_t) |
void | buffer_putc (struct buffer *, unsigned char) |
void | buffer_putstr (struct buffer *, const char *) |
char * | buffer_getstr (struct buffer *) |
int | buffer_empty (struct buffer *) |
buffer_status_t | buffer_write (struct buffer *, int fd, const void *, size_t) |
buffer_status_t | buffer_flush_available (struct buffer *, int fd) |
buffer_status_t | buffer_flush_all (struct buffer *, int fd) |
buffer_status_t | buffer_flush_window (struct buffer *, int fd, int width, int height, int erase, int no_more) |
Buffering to output and input.
enum buffer_status_t |
int buffer_empty | ( | struct buffer * | b | ) |
References buffer::head.
buffer_status_t buffer_flush_all | ( | struct buffer * | b, |
int | fd | ||
) |
References BUFFER_EMPTY, buffer_flush_available(), BUFFER_PENDING, fd, buffer::head, and buffer_data::sp.
Referenced by client_data(), vty_close(), and vty_flush().
buffer_status_t buffer_flush_available | ( | struct buffer * | b, |
int | fd | ||
) |
References BUFFER_DATA_FREE, BUFFER_EMPTY, BUFFER_ERROR, BUFFER_PENDING, buffer_data::cp, buffer_data::data, ERRNO_IO_RETRY, fd, buffer::head, MAX_CHUNKS, MAX_FLUSH, buffer_data::next, buffer_data::sp, and buffer::tail.
Referenced by buffer_flush_all(), and buffer_write().
buffer_status_t buffer_flush_window | ( | struct buffer * | , |
int | fd, | ||
int | width, | ||
int | height, | ||
int | erase, | ||
int | no_more | ||
) |
void buffer_free | ( | struct buffer * | b | ) |
References buffer_reset().
Referenced by vty_close(), and vty_new().
char * buffer_getstr | ( | struct buffer * | b | ) |
References data, buffer::head, and tall_vty_ctx.
struct buffer * buffer_new | ( | void * | ctx, |
size_t | size | ||
) |
References BUFFER_SIZE_DEFAULT, and buffer::size.
Referenced by vty_new().
void buffer_put | ( | struct buffer * | b, |
const void * | p, | ||
size_t | size | ||
) |
References buffer_add(), data, buffer::size, and buffer::tail.
Referenced by buffer_putc(), buffer_putstr(), buffer_write(), vty_out_newline(), vty_out_va(), and vty_write().
void buffer_putc | ( | struct buffer * | b, |
unsigned char | c | ||
) |
References buffer_put(), and c.
void buffer_putstr | ( | struct buffer * | b, |
const char * | c | ||
) |
References buffer_put(), and c.
void buffer_reset | ( | struct buffer * | b | ) |
References BUFFER_DATA_FREE, data, buffer::head, buffer_data::next, and buffer::tail.
Referenced by buffer_free(), vty_buffer_reset(), vty_read(), and vty_reset().
buffer_status_t buffer_write | ( | struct buffer * | b, |
int | fd, | ||
const void * | p, | ||
size_t | size | ||
) |
References BUFFER_EMPTY, BUFFER_ERROR, buffer_flush_available(), BUFFER_PENDING, buffer_put(), ERRNO_IO_RETRY, fd, and buffer::head.