packet: Hide internals of pa_packet, introduce pa_packet_data()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2014-10-23 11:43:04 +02:00 committed by Peter Meerwald
parent 9f97f08f40
commit 5a2c41e5bf
5 changed files with 50 additions and 24 deletions

View file

@ -23,18 +23,13 @@
#include <sys/types.h>
#include <inttypes.h>
#include <pulsecore/refcnt.h>
typedef struct pa_packet {
PA_REFCNT_DECLARE;
enum { PA_PACKET_APPENDED, PA_PACKET_DYNAMIC } type;
size_t length;
uint8_t *data;
} pa_packet;
typedef struct pa_packet pa_packet;
pa_packet* pa_packet_new(size_t length);
pa_packet* pa_packet_new_dynamic(void* data, size_t length);
const void* pa_packet_data(pa_packet *p, size_t *l);
pa_packet* pa_packet_ref(pa_packet *p);
void pa_packet_unref(pa_packet *p);