refbuf.h 900 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/* Icecast
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2000-2004, Jack Moffitt <jack@xiph.org, 
 *                      Michael Smith <msmith@xiph.org>,
 *                      oddsock <oddsock@xiph.org>,
 *                      Karl Heyes <karl@xiph.org>
 *                      and others (see AUTHORS for details).
 */

Jack Moffitt's avatar
Jack Moffitt committed
13 14 15 16 17 18 19 20 21 22
/* refbuf.h
**
** reference counting data buffer
**
*/
#ifndef __REFBUF_H__
#define __REFBUF_H__

typedef struct _refbuf_tag
{
23 24
    char *data;
    long len;
Karl Heyes's avatar
Karl Heyes committed
25 26
    struct _refbuf_tag *associated;
    struct _refbuf_tag *next;
Jack Moffitt's avatar
Jack Moffitt committed
27

28
    unsigned long _count;
Jack Moffitt's avatar
Jack Moffitt committed
29 30 31 32 33 34 35 36 37 38 39
} refbuf_t;

void refbuf_initialize(void);
void refbuf_shutdown(void);

refbuf_t *refbuf_new(unsigned long size);
void refbuf_addref(refbuf_t *self);
void refbuf_release(refbuf_t *self);

#endif  /* __REFBUF_H__ */