Esempio n. 1
0
File: buf.c Progetto: DIGImend/hidrd
void
hidrd_buf_clnp(hidrd_buf *buf)
{
    if (buf == NULL)
        return;

    assert(hidrd_buf_valid(buf));

    free(buf->ptr);
    hidrd_buf_init(buf);
}
Esempio n. 2
0
void
hidrd_buf_detach(hidrd_buf *buf, void **pptr, size_t *plen)
{
    if (pptr != NULL)
        *pptr = buf->ptr;
    else
        free(buf->ptr);

    if (plen != NULL)
        *plen = buf->len;

    hidrd_buf_init(buf);
}
Esempio n. 3
0
File: buf.c Progetto: DIGImend/hidrd
void
hidrd_buf_disown(hidrd_buf *buf, void **pptr, size_t *plen, size_t *psize)
{
    if (pptr != NULL)
        *pptr = buf->ptr;
    else
        free(buf->ptr);

    if (plen != NULL)
        *plen = buf->len;

    if (psize != NULL)
        *psize = buf->size;

    hidrd_buf_init(buf);
}