Lines Matching refs:len
39 ibuf_open(size_t len)
45 if ((buf->buf = malloc(len)) == NULL) {
49 buf->size = buf->max = len;
56 ibuf_dynamic(size_t len, size_t max)
60 if (max < len)
63 if ((buf = ibuf_open(len)) == NULL)
73 ibuf_realloc(struct ibuf *buf, size_t len)
78 if (buf->wpos + len > buf->max) {
83 b = realloc(buf->buf, buf->wpos + len);
87 buf->size = buf->wpos + len;
93 ibuf_add(struct ibuf *buf, const void *data, size_t len)
95 if (buf->wpos + len > buf->size)
96 if (ibuf_realloc(buf, len) == -1)
99 memcpy(buf->buf + buf->wpos, data, len);
100 buf->wpos += len;
105 ibuf_reserve(struct ibuf *buf, size_t len)
109 if (buf->wpos + len > buf->size)
110 if (ibuf_realloc(buf, len) == -1)
114 buf->wpos += len;
119 ibuf_seek(struct ibuf *buf, size_t pos, size_t len)
122 if (pos + len > buf->wpos)