00001 /* 00002 * Copyright (C) 2003-2009 The Music Player Daemon Project 00003 * http://www.musicpd.org 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef MPD_ARCHIVE_API_H 00021 #define MPD_ARCHIVE_API_H 00022 00023 /* 00024 * This is the public API which is used by archive plugins to 00025 * provide transparent archive decompression layer for mpd 00026 * 00027 */ 00028 00029 #include "archive_internal.h" 00030 #include "input_stream.h" 00031 00032 #include <stdbool.h> 00033 00034 struct archive_file; 00035 00036 struct archive_plugin { 00037 const char *name; 00038 00044 bool (*init)(void); 00045 00050 void (*finish)(void); 00051 00057 struct archive_file *(*open)(char * pathname); 00058 00064 void (*scan_reset)(struct archive_file *); 00065 00071 char *(*scan_next)(struct archive_file *); 00072 00081 bool (*open_stream)(struct archive_file *, struct input_stream *is, 00082 const char *path); 00083 00087 void (*close)(struct archive_file *); 00088 00093 const char *const*suffixes; 00094 }; 00095 00096 bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix); 00097 00098 #endif 00099