ArchivePlugin: rename struct archive_plugin to ArchivePlugin
This commit is contained in:
@@ -23,14 +23,15 @@
|
||||
class Mutex;
|
||||
class Cond;
|
||||
class Error;
|
||||
struct ArchivePlugin;
|
||||
class ArchiveVisitor;
|
||||
struct InputStream;
|
||||
|
||||
class ArchiveFile {
|
||||
public:
|
||||
const struct archive_plugin &plugin;
|
||||
const ArchivePlugin &plugin;
|
||||
|
||||
ArchiveFile(const struct archive_plugin &_plugin)
|
||||
ArchiveFile(const ArchivePlugin &_plugin)
|
||||
:plugin(_plugin) {}
|
||||
|
||||
protected:
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
const struct archive_plugin *const archive_plugins[] = {
|
||||
const ArchivePlugin *const archive_plugins[] = {
|
||||
#ifdef HAVE_BZ2
|
||||
&bz2_archive_plugin,
|
||||
#endif
|
||||
@@ -48,7 +48,7 @@ static bool archive_plugins_enabled[ARRAY_SIZE(archive_plugins) - 1];
|
||||
archive_plugins_for_each(plugin) \
|
||||
if (archive_plugins_enabled[archive_plugin_iterator - archive_plugins])
|
||||
|
||||
const struct archive_plugin *
|
||||
const ArchivePlugin *
|
||||
archive_plugin_from_suffix(const char *suffix)
|
||||
{
|
||||
if (suffix == nullptr)
|
||||
@@ -62,7 +62,7 @@ archive_plugin_from_suffix(const char *suffix)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const struct archive_plugin *
|
||||
const ArchivePlugin *
|
||||
archive_plugin_from_name(const char *name)
|
||||
{
|
||||
archive_plugins_for_each_enabled(plugin)
|
||||
@@ -75,7 +75,7 @@ archive_plugin_from_name(const char *name)
|
||||
void archive_plugin_init_all(void)
|
||||
{
|
||||
for (unsigned i = 0; archive_plugins[i] != nullptr; ++i) {
|
||||
const struct archive_plugin *plugin = archive_plugins[i];
|
||||
const ArchivePlugin *plugin = archive_plugins[i];
|
||||
if (plugin->init == nullptr || archive_plugins[i]->init())
|
||||
archive_plugins_enabled[i] = true;
|
||||
}
|
||||
|
@@ -20,22 +20,22 @@
|
||||
#ifndef MPD_ARCHIVE_LIST_HXX
|
||||
#define MPD_ARCHIVE_LIST_HXX
|
||||
|
||||
struct archive_plugin;
|
||||
struct ArchivePlugin;
|
||||
|
||||
extern const struct archive_plugin *const archive_plugins[];
|
||||
extern const ArchivePlugin *const archive_plugins[];
|
||||
|
||||
#define archive_plugins_for_each(plugin) \
|
||||
for (const struct archive_plugin *plugin, \
|
||||
for (const ArchivePlugin *plugin, \
|
||||
*const*archive_plugin_iterator = &archive_plugins[0]; \
|
||||
(plugin = *archive_plugin_iterator) != nullptr; \
|
||||
++archive_plugin_iterator)
|
||||
|
||||
/* interface for using plugins */
|
||||
|
||||
const struct archive_plugin *
|
||||
const ArchivePlugin *
|
||||
archive_plugin_from_suffix(const char *suffix);
|
||||
|
||||
const struct archive_plugin *
|
||||
const ArchivePlugin *
|
||||
archive_plugin_from_name(const char *name);
|
||||
|
||||
/* this is where we "load" all the "plugins" ;-) */
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
ArchiveFile *
|
||||
archive_file_open(const struct archive_plugin *plugin, const char *path,
|
||||
archive_file_open(const ArchivePlugin *plugin, const char *path,
|
||||
Error &error)
|
||||
{
|
||||
assert(plugin != nullptr);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
class ArchiveFile;
|
||||
class Error;
|
||||
|
||||
struct archive_plugin {
|
||||
struct ArchivePlugin {
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,7 @@ struct archive_plugin {
|
||||
};
|
||||
|
||||
ArchiveFile *
|
||||
archive_file_open(const struct archive_plugin *plugin, const char *path,
|
||||
archive_file_open(const ArchivePlugin *plugin, const char *path,
|
||||
Error &error);
|
||||
|
||||
#endif
|
||||
|
@@ -282,7 +282,7 @@ const InputPlugin bz2_inputplugin = {
|
||||
nullptr,
|
||||
};
|
||||
|
||||
const struct archive_plugin bz2_archive_plugin = {
|
||||
const ArchivePlugin bz2_archive_plugin = {
|
||||
"bz2",
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#ifndef MPD_ARCHIVE_BZ2_HXX
|
||||
#define MPD_ARCHIVE_BZ2_HXX
|
||||
|
||||
extern const struct archive_plugin bz2_archive_plugin;
|
||||
struct ArchivePlugin;
|
||||
|
||||
extern const ArchivePlugin bz2_archive_plugin;
|
||||
|
||||
#endif
|
||||
|
@@ -266,7 +266,7 @@ const InputPlugin iso9660_input_plugin = {
|
||||
nullptr,
|
||||
};
|
||||
|
||||
const struct archive_plugin iso9660_archive_plugin = {
|
||||
const ArchivePlugin iso9660_archive_plugin = {
|
||||
"iso",
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#ifndef MPD_ARCHIVE_ISO9660_HXX
|
||||
#define MPD_ARCHIVE_ISO9660_HXX
|
||||
|
||||
extern const struct archive_plugin iso9660_archive_plugin;
|
||||
struct ArchivePlugin;
|
||||
|
||||
extern const ArchivePlugin iso9660_archive_plugin;
|
||||
|
||||
#endif
|
||||
|
@@ -214,7 +214,7 @@ const InputPlugin zzip_input_plugin = {
|
||||
zzip_input_seek,
|
||||
};
|
||||
|
||||
const struct archive_plugin zzip_archive_plugin = {
|
||||
const ArchivePlugin zzip_archive_plugin = {
|
||||
"zzip",
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#ifndef MPD_ARCHIVE_ZZIP_HXX
|
||||
#define MPD_ARCHIVE_ZZIP_HXX
|
||||
|
||||
extern const struct archive_plugin zzip_archive_plugin;
|
||||
struct ArchivePlugin;
|
||||
|
||||
extern const ArchivePlugin zzip_archive_plugin;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user