input_stream: moved struct input_plugin to input_plugin.h

Start to separate private from public input_stream API.
This commit is contained in:
Max Kellermann 2009-03-02 20:13:08 +01:00
parent 8694574f63
commit 2e51365ea4
12 changed files with 50 additions and 20 deletions

View File

@ -67,6 +67,7 @@ mpd_headers = \
src/decoder_list.h \
src/decoder/_flac_common.h \
src/decoder/_ogg_common.h \
src/input_plugin.h \
src/input_stream.h \
src/input_file.h \
src/input_curl.h \

View File

@ -21,7 +21,7 @@
*/
#include "archive_api.h"
#include "input_stream.h"
#include "input_plugin.h"
#include "config.h"
#include <stdint.h>

View File

@ -21,7 +21,7 @@
*/
#include "archive_api.h"
#include "input_stream.h"
#include "input_plugin.h"
#include <cdio/cdio.h>
#include <cdio/iso9660.h>

View File

@ -22,7 +22,7 @@
#include "archive_api.h"
#include "archive_api.h"
#include "input_stream.h"
#include "input_plugin.h"
#include <zzip/zzip.h>
#include <glib.h>

View File

@ -19,7 +19,7 @@
#include "input_archive.h"
#include "archive_api.h"
#include "archive_list.h"
#include "input_stream.h"
#include "input_plugin.h"
#include <glib.h>

View File

@ -17,7 +17,7 @@
*/
#include "input_curl.h"
#include "input_stream.h"
#include "input_plugin.h"
#include "conf.h"
#include "config.h"
#include "tag.h"

View File

@ -17,6 +17,7 @@
*/
#include "input_file.h"
#include "input_plugin.h"
#include <sys/stat.h>
#include <fcntl.h>

View File

@ -19,8 +19,6 @@
#ifndef MPD_INPUT_FILE_H
#define MPD_INPUT_FILE_H
#include "input_stream.h"
extern const struct input_plugin input_plugin_file;
#endif

View File

@ -17,7 +17,7 @@
*/
#include "input_mms.h"
#include "input_stream.h"
#include "input_plugin.h"
#include <glib.h>
#include <libmms/mmsx.h>

41
src/input_plugin.h Normal file
View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2003-2009 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MPD_INPUT_PLUGIN_H
#define MPD_INPUT_PLUGIN_H
#include "input_stream.h"
#include <stddef.h>
#include <stdbool.h>
#include <sys/types.h>
struct input_stream;
struct input_plugin {
bool (*open)(struct input_stream *is, const char *url);
void (*close)(struct input_stream *is);
struct tag *(*tag)(struct input_stream *is);
int (*buffer)(struct input_stream *is);
size_t (*read)(struct input_stream *is, void *ptr, size_t size);
bool (*eof)(struct input_stream *is);
bool (*seek)(struct input_stream *is, off_t offset, int whence);
};
#endif

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "input_stream.h"
#include "input_plugin.h"
#include "config.h"
#include "input_file.h"

View File

@ -25,17 +25,6 @@
struct input_stream;
struct input_plugin {
bool (*open)(struct input_stream *is, const char *url);
void (*close)(struct input_stream *is);
struct tag *(*tag)(struct input_stream *is);
int (*buffer)(struct input_stream *is);
size_t (*read)(struct input_stream *is, void *ptr, size_t size);
bool (*eof)(struct input_stream *is);
bool (*seek)(struct input_stream *is, off_t offset, int whence);
};
struct input_stream {
/**
* the plugin which implements this input stream