1 |
frodo |
58 |
/* |
2 |
|
|
magick-aux.c - Part of psiconv, a PSION 5 file formats converter |
3 |
frodo |
270 |
Copyright (c) 2000-2005 Frodo Looijaard <frodo@frodo.looijaard.name> |
4 |
frodo |
58 |
|
5 |
|
|
This program is free software; you can redistribute it and/or modify |
6 |
|
|
it under the terms of the GNU General Public License as published by |
7 |
|
|
the Free Software Foundation; either version 2 of the License, or |
8 |
|
|
(at your option) any later version. |
9 |
|
|
|
10 |
|
|
This program is distributed in the hope that it will be useful, |
11 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
|
GNU General Public License for more details. |
14 |
|
|
|
15 |
|
|
You should have received a copy of the GNU General Public License |
16 |
|
|
along with this program; if not, write to the Free Software |
17 |
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
#include "config.h" |
21 |
|
|
|
22 |
frodo |
152 |
#if IMAGEMAGICK |
23 |
frodo |
58 |
|
24 |
|
|
#include "magick-aux.h" |
25 |
|
|
|
26 |
frodo |
142 |
#endif |
27 |
|
|
|
28 |
|
|
#ifdef DMALLOC |
29 |
|
|
#include "dmalloc.h" |
30 |
|
|
#endif |
31 |
|
|
|
32 |
|
|
#if IMAGEMAGICK |
33 |
|
|
|
34 |
frodo |
118 |
/* This used to be very ugly, but nowadays it is much better */ |
35 |
frodo |
58 |
|
36 |
frodo |
255 |
#if IMAGEMAGICK_API == 1 || IMAGEMAGICK_API == 2 |
37 |
frodo |
138 |
const MagickInfo * GetMagickFileList(void) |
38 |
frodo |
58 |
{ |
39 |
frodo |
118 |
ExceptionInfo exc; |
40 |
|
|
GetExceptionInfo(&exc); |
41 |
|
|
OpenModules(&exc); |
42 |
|
|
return GetMagickInfo(NULL,&exc); |
43 |
frodo |
58 |
} |
44 |
|
|
|
45 |
frodo |
255 |
#elif IMAGEMAGICK_API == 3 |
46 |
|
|
|
47 |
|
|
const MagickInfo * GetMagickFileList(void) |
48 |
|
|
{ |
49 |
|
|
MagickInfo **mi; |
50 |
|
|
unsigned long nr; |
51 |
|
|
int i; |
52 |
|
|
ExceptionInfo exc; |
53 |
|
|
GetExceptionInfo(&exc); |
54 |
|
|
OpenModules(&exc); |
55 |
|
|
mi = GetMagickInfoList("*",&nr); |
56 |
|
|
for (i = 0; i < nr-1; i++) { |
57 |
|
|
mi[i]->next = mi[i+1]; |
58 |
|
|
} |
59 |
|
|
return *mi; |
60 |
|
|
} |
61 |
|
|
|
62 |
|
|
#elif IMAGEMAGICK_API == 4 |
63 |
|
|
|
64 |
|
|
const MagickInfo * GetMagickFileList(void) |
65 |
|
|
{ |
66 |
|
|
MagickInfo **mi; |
67 |
|
|
unsigned long nr; |
68 |
|
|
int i; |
69 |
|
|
ExceptionInfo exc; |
70 |
|
|
GetExceptionInfo(&exc); |
71 |
|
|
OpenModules(&exc); |
72 |
|
|
mi = GetMagickInfoList("*",&nr,&exc); |
73 |
|
|
for (i = 0; i < nr-1; i++) { |
74 |
|
|
mi[i]->next = mi[i+1]; |
75 |
|
|
} |
76 |
|
|
return *mi; |
77 |
|
|
} |
78 |
|
|
#endif |
79 |
|
|
|
80 |
frodo |
58 |
#endif /* IMAGEMAGICK */ |