default: esd is obsolete, hence don't load it anymore by default
[pulseaudio-mirror.git] / src / pulsecore / memchunk.h
blobd7d82400bdca825c69f944569ba5a88d3197c84e
1 #ifndef foomemchunkhfoo
2 #define foomemchunkhfoo
4 /***
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, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
25 #include <pulsecore/memblock.h>
27 /* A memchunk describes a part of a memblock. In contrast to the memblock, a
28 * memchunk is not allocated dynamically or reference counted, instead
29 * it is usually stored on the stack and copied around */
31 typedef struct pa_memchunk {
32 pa_memblock *memblock;
33 size_t index, length;
34 } pa_memchunk;
36 /* Make a memchunk writable, i.e. make sure that the caller may have
37 * exclusive access to the memblock and it is not read_only. If needed
38 * the memblock in the structure is replaced by a copy. If min is not
39 * 0 it is made sure that the returned memblock is at least of the
40 * specified size, i.e. is enlarged if necessary. */
41 pa_memchunk* pa_memchunk_make_writable(pa_memchunk *c, size_t min);
43 /* Invalidate a memchunk. This does not free the cotaining memblock,
44 * but sets all members to zero. */
45 pa_memchunk* pa_memchunk_reset(pa_memchunk *c);
47 /* Map a memory chunk back into memory if it was swapped out */
48 pa_memchunk *pa_memchunk_will_need(const pa_memchunk *c);
50 /* Copy the data in the src memchunk to the dst memchunk */
51 pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src);
53 /* Return TRUE if any field is set != 0 */
54 pa_bool_t pa_memchunk_isset(pa_memchunk *c);
56 #endif