5 This file is part of PulseAudio.
7 Copyright 2004-2006 Lennart Poettering
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
23 #include <sys/types.h>
26 typedef struct pa_packet pa_packet;
28 /* create empty packet (either of type appended or dynamic depending
30 pa_packet* pa_packet_new(size_t length);
32 /* create packet (either of type appended or dynamic depending on length)
34 pa_packet* pa_packet_new_data(const void* data, size_t length);
36 /* data must have been malloc()ed; the packet takes ownership of the memory,
37 * i.e. memory is free()d with the packet */
38 pa_packet* pa_packet_new_dynamic(void* data, size_t length);
40 const void* pa_packet_data(pa_packet *p, size_t *l);
42 pa_packet* pa_packet_ref(pa_packet *p);
43 void pa_packet_unref(pa_packet *p);