Lines Matching refs:datlen
150 size_t datlen);
330 evbuffer_chain_insert_new(struct evbuffer *buf, size_t datlen) in evbuffer_chain_insert_new() argument
333 if ((chain = evbuffer_chain_new(datlen)) == NULL) in evbuffer_chain_insert_new()
1170 evbuffer_remove(struct evbuffer *buf, void *data_out, size_t datlen) in evbuffer_remove() argument
1174 n = evbuffer_copyout_from(buf, NULL, data_out, datlen); in evbuffer_remove()
1184 evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen) in evbuffer_copyout() argument
1186 return evbuffer_copyout_from(buf, NULL, data_out, datlen); in evbuffer_copyout()
1191 void *data_out, size_t datlen) in evbuffer_copyout_from() argument
1203 if (datlen > (size_t)(EV_SSIZE_MAX - pos->pos)) { in evbuffer_copyout_from()
1209 if (datlen + pos->pos > buf->total_len) in evbuffer_copyout_from()
1210 datlen = buf->total_len - pos->pos; in evbuffer_copyout_from()
1214 if (datlen > buf->total_len) in evbuffer_copyout_from()
1215 datlen = buf->total_len; in evbuffer_copyout_from()
1219 if (datlen == 0) in evbuffer_copyout_from()
1227 nread = datlen; in evbuffer_copyout_from()
1229 while (datlen && datlen >= chain->off - pos_in_chain) { in evbuffer_copyout_from()
1235 datlen -= copylen; in evbuffer_copyout_from()
1239 EVUTIL_ASSERT(chain || datlen==0); in evbuffer_copyout_from()
1242 if (datlen) { in evbuffer_copyout_from()
1244 EVUTIL_ASSERT(datlen+pos_in_chain <= chain->off); in evbuffer_copyout_from()
1247 datlen); in evbuffer_copyout_from()
1261 size_t datlen) in evbuffer_remove_buffer() argument
1274 if (datlen == 0 || dst == src) { in evbuffer_remove_buffer()
1285 if (datlen >= src->total_len) { in evbuffer_remove_buffer()
1286 datlen = src->total_len; in evbuffer_remove_buffer()
1288 result = (int)datlen; /*XXXX should return ev_ssize_t*/ in evbuffer_remove_buffer()
1293 while (chain->off <= datlen) { in evbuffer_remove_buffer()
1299 datlen -= chain->off; in evbuffer_remove_buffer()
1327 evbuffer_add(dst, chain->buffer + chain->misalign, datlen); in evbuffer_remove_buffer()
1328 chain->misalign += datlen; in evbuffer_remove_buffer()
1329 chain->off -= datlen; in evbuffer_remove_buffer()
1330 nread += datlen; in evbuffer_remove_buffer()
1730 evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) in evbuffer_add() argument
1743 if (datlen > EV_SIZE_MAX - buf->total_len) { in evbuffer_add()
1756 chain = evbuffer_chain_new(datlen); in evbuffer_add()
1767 if (remain >= datlen) { in evbuffer_add()
1771 data, datlen); in evbuffer_add()
1772 chain->off += datlen; in evbuffer_add()
1773 buf->total_len += datlen; in evbuffer_add()
1774 buf->n_add_for_cb += datlen; in evbuffer_add()
1777 evbuffer_chain_should_realign(chain, datlen)) { in evbuffer_add()
1781 memcpy(chain->buffer + chain->off, data, datlen); in evbuffer_add()
1782 chain->off += datlen; in evbuffer_add()
1783 buf->total_len += datlen; in evbuffer_add()
1784 buf->n_add_for_cb += datlen; in evbuffer_add()
1796 if (datlen > to_alloc) in evbuffer_add()
1797 to_alloc = datlen; in evbuffer_add()
1811 datlen -= remain; in evbuffer_add()
1813 memcpy(tmp->buffer, data, datlen); in evbuffer_add()
1814 tmp->off = datlen; in evbuffer_add()
1816 buf->n_add_for_cb += datlen; in evbuffer_add()
1827 evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) in evbuffer_prepend() argument
1834 if (datlen == 0) { in evbuffer_prepend()
1841 if (datlen > EV_SIZE_MAX - buf->total_len) { in evbuffer_prepend()
1848 chain = evbuffer_chain_new(datlen); in evbuffer_prepend()
1865 if ((size_t)chain->misalign >= datlen) { in evbuffer_prepend()
1867 memcpy(chain->buffer + chain->misalign - datlen, in evbuffer_prepend()
1868 data, datlen); in evbuffer_prepend()
1869 chain->off += datlen; in evbuffer_prepend()
1870 chain->misalign -= datlen; in evbuffer_prepend()
1871 buf->total_len += datlen; in evbuffer_prepend()
1872 buf->n_add_for_cb += datlen; in evbuffer_prepend()
1877 (char*)data + datlen - chain->misalign, in evbuffer_prepend()
1882 datlen -= (size_t)chain->misalign; in evbuffer_prepend()
1888 if ((tmp = evbuffer_chain_new(datlen)) == NULL) in evbuffer_prepend()
1896 tmp->off = datlen; in evbuffer_prepend()
1897 EVUTIL_ASSERT(datlen <= tmp->buffer_len); in evbuffer_prepend()
1898 tmp->misalign = tmp->buffer_len - datlen; in evbuffer_prepend()
1900 memcpy(tmp->buffer + tmp->misalign, data, datlen); in evbuffer_prepend()
1901 buf->total_len += datlen; in evbuffer_prepend()
1902 buf->n_add_for_cb += datlen; in evbuffer_prepend()
1929 size_t datlen) in evbuffer_chain_should_realign() argument
1931 return chain->buffer_len - chain->off >= datlen && in evbuffer_chain_should_realign()
1939 evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen) in evbuffer_expand_singlechain() argument
1965 if (CHAIN_SPACE_LEN(chain) >= datlen) { in evbuffer_expand_singlechain()
1982 if (evbuffer_chain_should_realign(chain, datlen)) { in evbuffer_expand_singlechain()
1997 datlen >= (EVBUFFER_CHAIN_MAX - chain->off)) { in evbuffer_expand_singlechain()
2000 if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) { in evbuffer_expand_singlechain()
2016 size_t length = chain->off + datlen; in evbuffer_expand_singlechain()
2038 result = evbuffer_chain_insert_new(buf, datlen); in evbuffer_expand_singlechain()
2043 EVUTIL_ASSERT(CHAIN_SPACE_LEN(result) >= datlen); in evbuffer_expand_singlechain()
2051 evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) in evbuffer_expand_fast_() argument
2063 chain = evbuffer_chain_new(datlen); in evbuffer_expand_fast_()
2090 if (avail >= datlen) { in evbuffer_expand_fast_()
2106 tmp = evbuffer_chain_new(datlen - avail); in evbuffer_expand_fast_()
2137 EVUTIL_ASSERT(datlen >= avail); in evbuffer_expand_fast_()
2138 tmp = evbuffer_chain_new(datlen - avail); in evbuffer_expand_fast_()
2161 evbuffer_expand(struct evbuffer *buf, size_t datlen) in evbuffer_expand() argument
2166 chain = evbuffer_expand_singlechain(buf, datlen); in evbuffer_expand()
2922 const void *data, size_t datlen, in evbuffer_add_reference() argument
2934 chain->buffer_len = datlen; in evbuffer_add_reference()
2935 chain->off = datlen; in evbuffer_add_reference()
2949 outbuf->n_add_for_cb += datlen; in evbuffer_add_reference()