MPD

- Main Page
- Data Structures
- Files

- File List
- Globals

# src/fifo_buffer.h

Go to the documentation of this file.

    00001 /*
    00002  * Copyright (C) 2003-2010 The Music Player Daemon Project
    00003  * http://www.musicpd.org
    00004  *
    00005  * Redistribution and use in source and binary forms, with or without
    00006  * modification, are permitted provided that the following conditions
    00007  * are met:
    00008  *
    00009  * - Redistributions of source code must retain the above copyright
    00010  * notice, this list of conditions and the following disclaimer.
    00011  *
    00012  * - Redistributions in binary form must reproduce the above copyright
    00013  * notice, this list of conditions and the following disclaimer in the
    00014  * documentation and/or other materials provided with the
    00015  * distribution.
    00016  *
    00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    00018  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    00019  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
    00020  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
    00021  * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    00022  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00023  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    00024  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    00025  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    00026  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    00027  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    00028  * OF THE POSSIBILITY OF SUCH DAMAGE.
    00029  */
    00030
    00041 #ifndef MPD_FIFO_BUFFER_H
    00042 #define MPD_FIFO_BUFFER_H
    00043
    00044 #include <stdbool.h>
    00045 #include <stddef.h>
    00046
    00047 struct fifo_buffer;
    00048
    00056 struct fifo_buffer *
    00057 fifo_buffer_new(size_t size);
    00058
    00062 void
    00063 fifo_buffer_free(struct fifo_buffer *buffer);
    00064
    00070 void
    00071 fifo_buffer_clear(struct fifo_buffer *buffer);
    00072
    00082 const void *
    00083 fifo_buffer_read(const struct fifo_buffer *buffer, size_t *length_r);
    00084
    00091 void
    00092 fifo_buffer_consume(struct fifo_buffer *buffer, size_t length);
    00093
    00104 void *
    00105 fifo_buffer_write(struct fifo_buffer *buffer, size_t *max_length_r);
    00106
    00113 void
    00114 fifo_buffer_append(struct fifo_buffer *buffer, size_t length);
    00115
    00119 bool
    00120 fifo_buffer_is_empty(struct fifo_buffer *buffer);
    00121
    00125 bool
    00126 fifo_buffer_is_full(struct fifo_buffer *buffer);
    00127
    00128 #endif