From 1e86ace32ab277a6c784764ac0bb010a0d2f5258 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 15 Jan 2018 22:53:42 +0100 Subject: [PATCH] Use `coderInfoList` and prepare for a `writable` flag --- Magick++/fuzz/encoder_list.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Magick++/fuzz/encoder_list.cc b/Magick++/fuzz/encoder_list.cc index 916aa64ce..b1015e401 100644 --- a/Magick++/fuzz/encoder_list.cc +++ b/Magick++/fuzz/encoder_list.cc @@ -1,19 +1,16 @@ #include +#include -#include #include +#include -extern "C" int main() { - size_t nFormats; - Magick::ExceptionInfo ex; - const Magick::MagickInfo **formats = GetMagickInfoList("*", &nFormats, &ex); +int main() { + std::list coderList; + coderInfoList(&coderList, Magick::CoderInfo::TrueMatch, Magick::CoderInfo::AnyMatch, Magick::CoderInfo::AnyMatch); - for (size_t i = 0; i < nFormats; i++) { - const Magick::MagickInfo *format = formats[i]; - if (format->encoder && format->name) { - std::cout << format->name << std::endl; - } + for (std::list::iterator it = coderList.begin(); it != coderList.end(); it++) + { + //std::cout << ((*it).isWritable() ? "+" : "-") << (*it).name() << std::endl; + std::cout << (*it).name() << std::endl; } - - RelinquishMagickMemory(formats); } -- 2.40.0