libubox
C utility functions for OpenWrt.
|
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stdarg.h>
#include "ustream.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_SET(_f, _default) |
#define | MAX_STACK_BUFLEN 256 |
Functions | |
static void | ustream_init_buf (struct ustream_buf *buf, int len) |
static void | ustream_add_buf (struct ustream_buf_list *l, struct ustream_buf *buf) |
static bool | ustream_can_alloc (struct ustream_buf_list *l) |
static int | ustream_alloc_default (struct ustream *s, struct ustream_buf_list *l) |
static void | ustream_free_buffers (struct ustream_buf_list *l) |
void | ustream_free (struct ustream *s) |
static void | ustream_state_change_cb (struct uloop_timeout *t) |
void | ustream_init_defaults (struct ustream *s) |
static bool | ustream_should_move (struct ustream_buf_list *l, struct ustream_buf *buf, int len) |
static void | ustream_free_buf (struct ustream_buf_list *l, struct ustream_buf *buf) |
static void | __ustream_set_read_blocked (struct ustream *s, unsigned char val) |
void | ustream_set_read_blocked (struct ustream *s, bool set) |
void | ustream_consume (struct ustream *s, int len) |
static void | ustream_fixup_string (struct ustream *s, struct ustream_buf *buf) |
static bool | ustream_prepare_buf (struct ustream *s, struct ustream_buf_list *l, int len) |
char * | ustream_reserve (struct ustream *s, int len, int *maxlen) |
void | ustream_fill_read (struct ustream *s, int len) |
char * | ustream_get_read_buf (struct ustream *s, int *buflen) |
int | ustream_read (struct ustream *s, char *buf, int buflen) |
static void | ustream_write_error (struct ustream *s) |
bool | ustream_write_pending (struct ustream *s) |
static int | ustream_write_buffered (struct ustream *s, const char *data, int len, int wr) |
int | ustream_write (struct ustream *s, const char *data, int len, bool more) |
int | ustream_vprintf (struct ustream *s, const char *format, va_list arg) |
int | ustream_printf (struct ustream *s, const char *format,...) |
#define DEFAULT_SET | ( | _f, | |
_default | |||
) |
|
static |
|
static |
|
static |
Definition at line 60 of file ustream.c.
|
static |
void ustream_consume | ( | struct ustream * | s, |
int | len | ||
) |
Definition at line 214 of file ustream.c.
void ustream_fill_read | ( | struct ustream * | s, |
int | len | ||
) |
Definition at line 301 of file ustream.c.
|
static |
void ustream_free | ( | struct ustream * | s | ) |
Definition at line 92 of file ustream.c.
|
static |
|
static |
char* ustream_get_read_buf | ( | struct ustream * | s, |
int * | buflen | ||
) |
|
static |
void ustream_init_defaults | ( | struct ustream * | s | ) |
Definition at line 112 of file ustream.c.
|
static |
Definition at line 250 of file ustream.c.
int ustream_printf | ( | struct ustream * | s, |
const char * | format, | ||
... | |||
) |
Definition at line 534 of file ustream.c.
int ustream_read | ( | struct ustream * | s, |
char * | buf, | ||
int | buflen | ||
) |
Definition at line 345 of file ustream.c.
char* ustream_reserve | ( | struct ustream * | s, |
int | len, | ||
int * | maxlen | ||
) |
Definition at line 286 of file ustream.c.
void ustream_set_read_blocked | ( | struct ustream * | s, |
bool | set | ||
) |
|
static |
|
static |
Definition at line 102 of file ustream.c.
int ustream_vprintf | ( | struct ustream * | s, |
const char * | format, | ||
va_list | arg | ||
) |
Definition at line 467 of file ustream.c.
int ustream_write | ( | struct ustream * | s, |
const char * | data, | ||
int | len, | ||
bool | more | ||
) |
|
static |
|
static |