Changeset 3626
- Timestamp:
- 2005年03月06日 00時28分57秒 (4 years ago)
- Files:
-
- branches/2.1/nt/ChangeLog.Meadow (modified) (1 diff)
- branches/2.1/nt/INSTALL.Meadow (modified) (2 diffs)
- branches/2.1/nt/INSTALL.Meadow.ja (modified) (2 diffs)
- branches/2.1/nt/configure.meadow.bat (modified) (7 diffs)
- branches/2.1/src/ChangeLog.Meadow (modified) (1 diff)
- branches/2.1/src/makefile.nt (modified) (3 diffs)
- branches/2.1/src/mw32fns.c (modified) (29 diffs)
- branches/2.1/src/mw32magick.h (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.1/nt/ChangeLog.Meadow
r3561 r3626 1 2005-03-06 Shuichi KITAGUCHI <kit@meadowy.org> 2 3 * configure.meadow.bat: add --magick option. 4 5 * INSTALL.Meadow.ja: Ditto. 6 7 * INSTALL.Meadow: Ditto. 8 1 9 2004-11-28 Shuichi KITAGUCHI <kit@meadowy.org> 2 10 branches/2.1/nt/INSTALL.Meadow
r3558 r3626 133 133 ----------------- 134 134 cd Meadow-<VERSION>\nt [RETURN] 135 configure.meadow --with-msvc --prefix <YOUR INSTALL DIRECTORY> [RETURN]135 configure.meadow --with-msvc --prefix <YOUR INSTALL DIRECTORY> --magick "<IMAGEMAGICK DIRECTORY>" [RETURN] 136 136 nmake bootstrap [RETURN] 137 137 nmake all [RETURN] … … 163 163 ----------------- 164 164 cd Meadow-<VERSION>/nt [RETURN] 165 ./configure.meadow.bat --with-gcc --no-cygwin --no-debug --prefix=<YOUR INSTALL DIRECTORY> [RETURN]165 ./configure.meadow.bat --with-gcc --no-cygwin --no-debug --prefix=<YOUR INSTALL DIRECTORY> --magick "<IMAGEMAGICK DIRECTORY>" [RETURN] 166 166 make bootstrap [RETURN] 167 167 make all [RETURN] branches/2.1/nt/INSTALL.Meadow.ja
r3298 r3626 157 157 ----------------- 158 158 cd Meadow-<VERSION>\nt [RETURN] 159 configure.meadow --with-msvc --prefix <YOUR INSTALL DIRECTORY> [RETURN]159 configure.meadow --with-msvc --prefix <YOUR INSTALL DIRECTORY> --magick "<IMAGEMAGICK DIRECTORY>" [RETURN] 160 160 nmake bootstrap [RETURN] 161 161 nmake all [RETURN] … … 185 185 ----------------- 186 186 cd Meadow-<VERSION>/nt [RETURN] 187 ./configure.meadow.bat --with-gcc --no-cygwin --prefix <YOUR INSTALL DIRECTORY> [RETURN]187 ./configure.meadow.bat --with-gcc --no-cygwin --prefix <YOUR INSTALL DIRECTORY> --magick "<IMAGEMAGICK DIRECTORY>" [RETURN] 188 188 make bootstrap [RETURN] 189 189 make all [RETURN] branches/2.1/nt/configure.meadow.bat
r3558 r3626 64 64 rem Default settings. 65 65 set prefix= 66 set magick= 66 67 set nodebug=N 67 68 set noopt=N … … 79 80 if "%1" == "--help" goto usage 80 81 if "%1" == "--prefix" goto setprefix 82 if "%1" == "--magick" goto setmagick 81 83 if "%1" == "--with-gcc" goto withgcc 82 84 if "%1" == "--with-msvc" goto withmsvc … … 91 93 echo Options: 92 94 echo. --prefix PREFIX install Emacs in directory PREFIX 95 echo. --magick DIRECTORY ImageMagick directory 93 96 echo. --with-gcc use GCC to compile Emacs 94 97 echo. --with-msvc use MSVC to compile Emacs … … 105 108 shift 106 109 goto again 107 rem ---------------------------------------------------------------------- 110 em ---------------------------------------------------------------------- 111 :setmagick 112 shift 113 set magick=%1 114 shift 115 goto again 116 +rem ---------------------------------------------------------------------- 108 117 :withgcc 109 118 set COMPILER=gcc … … 245 254 rem ---------------------------------------------------------------------- 246 255 :genmakefiles 256 if not "("%magick%")" == "()" goto genmakefiles2 257 echo Error: --magick is not specified. 258 goto end 259 260 :genmakefiles2 247 261 echo Generating makefiles 248 262 … … 257 271 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings 258 272 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings 273 echo MAGICKDIR=%magick%>>config.settings 259 274 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings 260 275 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings … … 318 333 :end 319 334 set prefix= 335 set magick= 320 336 set nodebug= 321 337 set noopt= branches/2.1/src/ChangeLog.Meadow
r3583 r3626 1 2005-03-06 Shuichi KITAGUCHI <kit@meadowy.org> 2 3 * mw32magick: removed. (cleanup ImageMagick support) 4 5 * mw32fns.c: update to ImageMagick 6.2.0. 6 cleanup ImageMagick support. 7 8 * makefile.nt (LOCAL_FLAGS): cleanup ImageMagick support. 9 1 10 2005-01-08 MIYOSHI Masanori <miyoshi@meadowy.org> 2 11 branches/2.1/src/makefile.nt
r3560 r3626 42 42 # the emacs source tree. 43 43 # 44 LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc 44 LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc \ 45 -I$(MAGICKDIR)\include 45 46 !ifdef NTGUI 46 47 LOCAL_FLAGS = $(LOCAL_FLAGS) -DHAVE_NTGUI=1 … … 353 354 cd $(BLD) 354 355 .\temacs.exe -nd -batch -l loadup bootstrap 356 if exist Meadow.dmp del Meadow.dmp 357 ren emacs.dmp Meadow.dmp 355 358 if exist Meadow.exe del Meadow.exe 356 359 ren emacs.exe Meadow.exe 357 if exist Meadow.dmp del Meadow.dmp358 ren emacs.dmp Meadow.dmp359 360 cd ..\.. 360 361 - mkdir ..\bin … … 1610 1611 $(SRC)\fontset.h \ 1611 1612 $(SRC)\termhooks.h \ 1612 $(SRC)\mw32magick.h \1613 1613 $(SRC)\mw32rgb.h 1614 1614 branches/2.1/src/mw32fns.c
r3490 r3626 49 49 #include "termhooks.h" 50 50 #include "atimer.h" 51 #include "mw32magick.h"52 51 53 52 /* external interfaces */ … … 5981 5980 ImageMagick Interface. 5982 5981 ***********************************************************************/ 5982 #define WIN32 5983 #include <magick/api.h> 5984 #include <magick/blob-private.h> 5983 5985 5984 5986 #define IMAGE_MAGICK_DLL "CORE_RL_magick_.dll" 5985 /* #define IMAGE_MAGICK_DLL "CORE_DB_magick_.dll" /* debug dll */ 5986 #define IMAGE_MAGICK_REQUIRE_VERSION 0x0601 5987 #define IMAGE_MAGICK_REQUIRE_VERSION 0x0620 5987 5988 5988 5989 Lisp_Object Qxbm, Qpbm, Qxpm, Qjpeg, Qtiff, Qgif, Qpng; … … 5996 5997 /* ImageMagick function pointers. */ 5997 5998 5999 typedef const char* (*pget_magick_version_t) (unsigned long *); 5998 6000 typedef void (*pinitialize_magick_t) (const char *); 5999 6001 typedef Image *(*pread_image_t) (const ImageInfo *, ExceptionInfo *); 6000 6002 typedef Image *(*pblob_to_image_t) (const ImageInfo *, const void *, 6001 6003 const size_t, ExceptionInfo *); 6002 typedef ImageInfo *(*pclone_image_info_t) (const ImageInfo *); 6004 typedef ImageInfo *(*pclone_image_info_t) (const ImageInfo *); 6003 6005 typedef void (*pdestroy_image_t) (Image *); 6004 6006 typedef void (*pdestroy_image_info_t) (ImageInfo *); … … 6006 6008 const unsigned long, 6007 6009 const unsigned long); 6008 typedef void (*pget_exception_info_t) (ExceptionInfo *); 6009 typedef const char* (*pget_magick_version_t) (unsigned int *); 6010 typedef void (*pget_exception_info_t) (ExceptionInfo *); 6010 6011 typedef Image *(*pping_blob_t) (const ImageInfo *, const void *, 6011 const size_t, ExceptionInfo *); 6012 typedef Image *(*pping_image_t) (const ImageInfo *, ExceptionInfo *); 6013 typedef void(*pdestroy_image_list_t) (Image *);6014 typedef const MagickInfo *(*pget_magick_info_t) (const char *,6015 ExceptionInfo *); 6016 typedef char **(*pget_magick_list_t) (const char * pattern,6017 unsigned long *number_formats);6012 const size_t, ExceptionInfo *); 6013 typedef Image *(*pping_image_t) (const ImageInfo *, ExceptionInfo *); 6014 typedef Image *(*pdestroy_image_list_t) (Image *); 6015 typedef const MagickInfo *(*pget_magick_info_t) (const char *, 6016 ExceptionInfo *); 6017 typedef char **(*pget_magick_list_t) (const char *, unsigned long *, 6018 ExceptionInfo *); 6018 6019 typedef IndexPacket *(*pget_indexes_t) (const Image *); 6019 typedef unsigned int (*ptransform_rgb_image_t) (Image *, const ColorspaceType); 6020 typedef MagickBooleanType (*ptransform_rgb_image_t) (Image *, 6021 const ColorspaceType); 6020 6022 typedef const PixelPacket *(*pacquire_image_pixels_t) (const Image *, 6021 6023 const long, const long, … … 6023 6025 const unsigned long, 6024 6026 ExceptionInfo *); 6025 typedef unsigned int(*pis_monochrome_image_t) (const Image *,6026 ExceptionInfo *);6027 typedef void(*pset_image_type_t) (Image *, const ImageType);6027 typedef MagickBooleanType (*pis_monochrome_image_t) (const Image *, 6028 ExceptionInfo *); 6029 typedef MagickBooleanType (*pset_image_type_t) (Image *, const ImageType); 6028 6030 typedef Image *(*pconstitute_image_t) (const unsigned long, 6029 6031 const unsigned long, … … 6033 6035 typedef PixelPacket* (*pset_image_pixels_t) (Image *, const long, const long, 6034 6036 const unsigned long, 6035 const unsigned long); 6036 typedef unsigned int (*psync_image_pixels_t) (Image *);6037 typedef unsigned int(*popen_blob_t) (const ImageInfo *, Image *,6038 const BlobMode, ExceptionInfo *);6037 const unsigned long); 6038 typedef MagickBooleanType (*psync_image_pixels_t) (Image *); 6039 typedef MagickBooleanType (*popen_blob_t) (const ImageInfo *, Image *, 6040 const BlobMode, ExceptionInfo *); 6039 6041 typedef char *(*pread_blob_string_t) (Image *, char *); 6040 6042 typedef void (*pclose_blob_t) (Image *); 6041 typedef unsigned int (*pallocate_image_colormap_t) (Image *, 6042 const unsigned long); 6043 typedef unsigned int (*pquery_color_database_t) (const char *, PixelPacket *, 6044 ExceptionInfo *); 6045 typedef MagickInfo *(*pregister_magick_info_t) (MagickInfo *); 6043 typedef MagickBooleanType (*pallocate_image_colormap_t) (Image *, 6044 const unsigned long); 6045 typedef MagickBooleanType (*pquery_color_database_t) (const char *, 6046 PixelPacket *, 6047 ExceptionInfo *); 6048 typedef MagickInfo *(*pregister_magick_info_t) (MagickInfo *); 6046 6049 typedef MagickInfo *(*pset_magick_info_t) (const char *); 6047 typedef void *(*prelinquish_magick_memory_t) (void * *memory);6050 typedef void *(*prelinquish_magick_memory_t) (void *); 6048 6051 typedef void *(*pacquire_string_t) (const char *); 6049 6052 typedef const char *(*pget_image_magick_t) (const unsigned char *, … … 6052 6055 static HINSTANCE hmagick = NULL; 6053 6056 static ExceptionInfo magick_exception; 6057 6058 static pget_magick_version_t pget_magick_version; 6054 6059 static pinitialize_magick_t pinitialize_magick; 6055 6060 static pread_image_t pread_image; … … 6060 6065 static pget_image_pixels_t pget_image_pixels; 6061 6066 static pget_exception_info_t pget_exception_info; 6062 static pget_magick_version_t pget_magick_version;6063 6067 static pping_blob_t pping_blob; 6064 6068 static pping_image_t pping_image; … … 6088 6092 /* ImageMagick function wrappers. */ 6089 6093 6094 static const char * 6095 magick_get_magick_version (unsigned long *version) 6096 { 6097 if (hmagick == NULL || pget_magick_version == NULL) 6098 return NULL; 6099 return (*pget_magick_version) (version); 6100 } 6101 6090 6102 static void 6091 magick_initialize_magick (const char * path)6092 { 6093 if ( pinitialize_magick == NULL)6103 magick_initialize_magick (const char *path) 6104 { 6105 if (hmagick == NULL || pinitialize_magick == NULL) 6094 6106 return; 6095 6107 (*pinitialize_magick) (path); 6096 6108 } 6097 6109 6098 static void 6099 magick_get_exception_info (ExceptionInfo *exception) 6100 { 6101 if (pget_exception_info == NULL) 6102 return; 6103 (*pget_exception_info) (exception); 6104 } 6105 6106 static ImageInfo* 6107 magick_clone_image_info (const ImageInfo *image_info) 6108 { 6109 if (pclone_image_info == NULL) 6110 return NULL; 6111 return (*pclone_image_info) (image_info); 6112 } 6113 6114 static Image* 6115 magick_read_image (const ImageInfo *image_info, ExceptionInfo *exception) 6116 { 6117 if (pread_image == NULL) 6110 static Image * 6111 magick_read_image (const ImageInfo *image_info, ExceptionInfo *exception) 6112 { 6113 if (hmagick == NULL || pread_image == NULL) 6118 6114 return NULL; 6119 6115 return (*pread_image) (image_info, exception); 6120 6116 } 6121 6117 6122 static Image *6118 static Image * 6123 6119 magick_blob_to_image (const ImageInfo *image_info, 6124 6120 const void *blob, 6125 6121 const size_t length, 6126 ExceptionInfo *exception) 6127 { 6128 if ( pblob_to_image == NULL)6122 ExceptionInfo *exception) 6123 { 6124 if (hmagick == NULL || pblob_to_image == NULL) 6129 6125 return NULL; 6130 6126 return (*pblob_to_image) (image_info, blob, length, exception); 6131 6127 } 6132 6128 6129 static ImageInfo * 6130 magick_clone_image_info (const ImageInfo *image_info) 6131 { 6132 if (hmagick == NULL || pclone_image_info == NULL) 6133 return NULL; 6134 return (*pclone_image_info) (image_info); 6135 } 6136 6133 6137 static void 6134 magick_destroy_image (Image *image) 6135 { 6136 if ( pdestroy_image == NULL)6138 magick_destroy_image (Image *image) 6139 { 6140 if (hmagick == NULL || pdestroy_image == NULL) 6137 6141 return; 6138 6142 (*pdestroy_image) (image); … … 6142 6146 magick_destroy_image_info (ImageInfo *image_info) 6143 6147 { 6144 if ( pdestroy_image_info == NULL)6148 if (hmagick == NULL || pdestroy_image_info == NULL) 6145 6149 return; 6146 6150 (*pdestroy_image_info) (image_info); 6147 6151 } 6148 6152 6149 static PixelPacket *6153 static PixelPacket * 6150 6154 magick_get_image_pixels (Image *image, 6151 6155 const long x, … … 6154 6158 const unsigned long rows) 6155 6159 { 6156 if ( pget_image_pixels == NULL)6160 if (hmagick == NULL || pget_image_pixels == NULL) 6157 6161 return NULL; 6158 6162 return (*pget_image_pixels) (image, x, y, columns, rows); 6159 6163 } 6160 6164 6161 static const char*6162 magick_get_ magick_version (unsigned int *version)6163 { 6164 if ( pget_magick_version== NULL)6165 return NULL;6166 return (*pget_magick_version) (version);6167 } 6168 6169 static Image *6165 static void 6166 magick_get_exception_info (ExceptionInfo *exception) 6167 { 6168 if (hmagick == NULL || pget_exception_info == NULL) 6169 return; 6170 (*pget_exception_info) (exception); 6171 } 6172 6173 static Image * 6170 6174 magick_ping_blob (const ImageInfo *image_info, 6171 6175 const void *blob, … … 6173 6177 ExceptionInfo *exception) 6174 6178 { 6175 if ( pping_blob == NULL)6179 if (hmagick == NULL || pping_blob == NULL) 6176 6180 return NULL; 6177 6181 return (*pping_blob) (image_info, blob, length, exception); 6178 6182 } 6179 6183 6180 static Image *6184 static Image * 6181 6185 magick_ping_image (const ImageInfo *image_info, 6182 6186 ExceptionInfo *exception) 6183 6187 { 6184 if ( pping_image == NULL)6188 if (hmagick == NULL || pping_image == NULL) 6185 6189 return NULL; 6186 6190 return (*pping_image) (image_info, exception); 6187 6191 } 6188 6192 6189 static void magick_destroy_image_list (Image *images) 6190 { 6191 if (pdestroy_image_list == NULL) 6192 return; 6193 (*pdestroy_image_list) (images); 6194 } 6195 6196 static const MagickInfo* 6193 static Image * 6194 magick_destroy_image_list (Image *images) 6195 { 6196 if (hmagick == NULL || pdestroy_image_list == NULL) 6197 return NULL; 6198 return (*pdestroy_image_list) (images); 6199 } 6200 6201 static const MagickInfo * 6197 6202 magick_get_magick_info (const char *name, 6198 6203 ExceptionInfo *exception) 6199 6204 { 6200 if ( pget_magick_info == NULL)6205 if (hmagick == NULL || pget_magick_info == NULL) 6201 6206 return NULL; 6202 6207 return (*pget_magick_info) (name, exception); … … 6204 6209 6205 6210 static char ** 6206 magick_get_magick_list (const char *pattern, unsigned long *number_formats) 6207 { 6208 if (pget_magick_list == NULL) 6211 magick_get_magick_list (const char *pattern, 6212 unsigned long *number_formats, 6213 ExceptionInfo *exception) 6214 { 6215 if (hmagick == NULL || pget_magick_list == NULL) 6209 6216 return NULL; 6210 return (*pget_magick_list) (pattern, number_formats );6217 return (*pget_magick_list) (pattern, number_formats, exception); 6211 6218 } 6212 6219 … … 6214 6221 magick_get_indexes (const Image *image) 6215 6222 { 6216 if ( pget_indexes == NULL)6223 if (hmagick == NULL || pget_indexes == NULL) 6217 6224 return NULL; 6218 6225 return (*pget_indexes) (image); 6219 6226 } 6220 6227 6221 static unsigned int6228 static MagickBooleanType 6222 6229 magick_transform_rgb_image (Image *image, const ColorspaceType colorspace) 6223 6230 { 6224 if ( ptransform_rgb_image == NULL)6225 return 0;6231 if (hmagick == NULL || ptransform_rgb_image == NULL) 6232 return MagickFalse; 6226 6233 return (*ptransform_rgb_image) (image, colorspace); 6227 6234 } … … 6234 6241 ExceptionInfo *exception) 6235 6242 { 6236 if ( pacquire_image_pixels == NULL)6243 if (hmagick == NULL || pacquire_image_pixels == NULL) 6237 6244 return NULL; 6238 6245 return (*pacquire_image_pixels) (image, x, y, columns, rows, exception); 6239 6246 } 6240 6247 6241 static unsigned int6248 static MagickBooleanType 6242 6249 magick_is_monochrome_image (const Image *image, ExceptionInfo *exception) 6243 6250 { 6244 if ( pis_monochrome_image == NULL)6245 return 0;6251 if (hmagick == NULL || pis_monochrome_image == NULL) 6252 return MagickFalse; 6246 6253 return (*pis_monochrome_image) (image, exception); 6247 6254 } 6248 6255 6249 void 6256 static MagickBooleanType 6250 6257 magick_set_image_type (Image *image, const ImageType image_type) 6251 6258 { 6252 if ( pset_image_type == NULL)6253 return ;6254 (*pset_image_type) (image, image_type);6255 } 6256 6257 static Image *6259 if (hmagick == NULL || pset_image_type == NULL) 6260 return MagickFalse; 6261 return (*pset_image_type) (image, image_type); 6262 } 6263 6264 static Image * 6258 6265 magick_constitute_image (const unsigned long width, const unsigned long height, 6259 6266 const char *map, const StorageType type, 6260 6267 const void *pixels, ExceptionInfo *exception) 6261 6268 { 6262 if ( pconstitute_image == NULL)6269 if (hmagick == NULL || pconstitute_image == NULL) 6263 6270 return NULL; 6264 6271 return (*pconstitute_image) (width, height, map, type, pixels, exception); 6265 6272 } 6266 6273 6267 static Image *6274 static Image * 6268 6275 magick_allocate_image (const ImageInfo *image_info) 6269 6276 { 6270 if ( pallocate_image == NULL)6277 if (hmagick == NULL || pallocate_image == NULL) 6271 6278 return NULL; 6272 6279 return (*pallocate_image) (image_info); … … 6279 6286 const unsigned long rows) 6280 6287 { 6281 if ( pset_image_pixels == NULL)6288 if (hmagick == NULL || pset_image_pixels == NULL) 6282 6289 return NULL; 6283 6290 return (*pset_image_pixels) (image, x, y, columns, rows); 6284 6291 } 6285 6292 6286 static unsigned int6293 static MagickBooleanType 6287 6294 magick_sync_image_pixels (Image *image) 6288 6295 { 6289 if ( psync_image_pixels == NULL)6290 return 0;6296 if (hmagick == NULL || psync_image_pixels == NULL) 6297 return MagickFalse; 6291 6298 return (*psync_image_pixels) (image); 6292 6299 } 6293 6300 6294 static unsigned int6301 static MagickBooleanType 6295 6302 magick_open_blob (const ImageInfo *image_info, Image *image, 6296 6303 const BlobMode mode, ExceptionInfo *exception) 6297 6304 { 6298 if ( popen_blob == NULL)6299 return 0;6305 if (hmagick == NULL || popen_blob == NULL) 6306 return MagickFalse; 6300 6307 return (*popen_blob) (image_info, image, mode, exception); 6301 6308 } … … 6304 6311 magick_read_blob_string (Image *image, char *string) 6305 6312 { 6306 if ( pread_blob_string == NULL)6313 if (hmagick == NULL || pread_blob_string == NULL) 6307 6314 return NULL; 6308 6315 return (*pread_blob_string) (image, string); … … 6312 6319 magick_close_blob (Image *image) 6313 6320 { 6314 if ( pclose_blob == NULL)6321 if (hmagick == NULL || pclose_blob == NULL) 6315 6322 return; 6316 6323 (*pclose_blob) (image); 6317 6324 } 6318 6325 6319 static unsigned int6326 static MagickBooleanType 6320 6327 magick_allocate_image_colormap (Image *image, const unsigned long colors) 6321 6328 { 6322 if ( pallocate_image_colormap == NULL)6323 return 0;6329 if (hmagick == NULL || pallocate_image_colormap == NULL) 6330 return MagickFalse; 6324 6331 return (*pallocate_image_colormap) (image, colors); 6325 6332 } 6326 6333 6327 static unsigned int6334 static MagickBooleanType 6328 6335 magick_query_color_database (const char *name, PixelPacket *color, 6329 6336 ExceptionInfo *exception) 6330 6337 { 6331 if ( pquery_color_database == NULL)6332 return 0;6338 if (hmagick == NULL || pquery_color_database == NULL) 6339 return MagickFalse; 6333 6340 return (*pquery_color_database) (name, color, exception); 6334 6341 } … … 6337 6344 magick_register_magick_info (MagickInfo *magick_info) 6338 6345 { 6339 if ( pregister_magick_info == NULL)6346 if (hmagick == NULL || pregister_magick_info == NULL) 6340 6347 return NULL; 6341 6348 return (*pregister_magick_info) (magick_info); … … 6345 6352 magick_set_magick_info (const char *name) 6346 6353 { 6347 if ( pset_magick_info == NULL)6354 if (hmagick == NULL || pset_magick_info == NULL) 6348 6355 return NULL; 6349 6356 return (*pset_magick_info) (name); … … 6351 6358 6352 6359 static void * 6353 magick_relinquish_magick_memory (void * *memory)6354 { 6355 if ( prelinquish_magick_memory == NULL)6360 magick_relinquish_magick_memory (void *memory) 6361 { 6362 if (hmagick == NULL || prelinquish_magick_memory == NULL) 6356 6363 return NULL; 6357 6364 return (*prelinquish_magick_memory) (memory); … … 6361 6368 magick_acquire_string (const char *source) 6362 6369 { 6363 if ( pacquire_string == NULL)6370 if (hmagick == NULL || pacquire_string == NULL) 6364 6371 return NULL; 6365 6372 return (*pacquire_string) (source); … … 6369 6376 magick_get_image_magick (const unsigned char *magick, const size_t length) 6370 6377 { 6371 if ( pget_image_magick == NULL)6378 if (hmagick == NULL || pget_image_magick == NULL) 6372 6379 return NULL; 6373 6380 return (*pget_image_magick) (magick, length); … … 6377 6384 resolve_imagemagick_api (void) 6378 6385 { 6386 unsigned long version; 6387 6379 6388 hmagick = LoadLibrary (IMAGE_MAGICK_DLL); 6380 6381 6389 if (hmagick == NULL) 6382 6390 return 0; 6383 6391 6384 #define MAGICK_RESOLVE_FUNC(var, type, name) \6392 #define MAGICK_RESOLVE_FUNC(var, type, name) \ 6385 6393 do { \ 6386 6394 (var) = (type) GetProcAddress (hmagick, (name)); \ 6387 6395 if (!(var)) goto error; \ 6388 6396 } while (0) 6389 6397 6398 /* first, check version number of ImageMagick. */ 6399 MAGICK_RESOLVE_FUNC (pget_magick_version, pget_magick_version_t, 6400 "GetMagickVersion"); 6401 6402 magick_get_magick_version (&version); 6403 if (version != IMAGE_MAGICK_REQUIRE_VERSION) /* XXX: strict check. */ 6404 goto error; 6405 6406 /* second, load other function addresses. */ 6390 6407 MAGICK_RESOLVE_FUNC (pinitialize_magick, pinitialize_magick_t, 6391 6408 "InitializeMagick"); 6392 6409 MAGICK_RESOLVE_FUNC (pread_image, pread_image_t, "ReadImage"); 6410 MAGICK_RESOLVE_FUNC (pblob_to_image, pblob_to_image_t, "BlobToImage"); 6393 6411 MAGICK_RESOLVE_FUNC (pclone_image_info, pclone_image_info_t, 6394 6412 "CloneImageInfo"); … … 6400 6418 MAGICK_RESOLVE_FUNC (pget_exception_info, pget_exception_info_t, 6401 6419 "GetExceptionInfo"); 6402 MAGICK_RESOLVE_FUNC (pblob_to_image, pblob_to_image_t, "BlobToImage");6403 MAGICK_RESOLVE_FUNC (pget_magick_version, pget_magick_version_t,6404 "GetMagickVersion");6405 6420 MAGICK_RESOLVE_FUNC (pping_blob, pping_blob_t, "PingBlob"); 6406 6421 MAGICK_RESOLVE_FUNC (pping_image, pping_image_t, "PingImage"); … … 6446 6461 6447 6462 return 1; 6448 6463 6449 6464 error: 6450 6465 FreeLibrary (hmagick); … … 7269 7284 } 7270 7285 7271 static int7272 imagemagick_version_p (void)7273 {7274 int version;7275 7276 magick_get_magick_version (&version);7277 7278 if (version < IMAGE_MAGICK_REQUIRE_VERSION)7279 return 0;7280 7281 return 1;7282 }7283 7284 7286 static Lisp_Object* 7285 7287 imagemagick_image_type_lisp_symbol (const char *name) … … 7335 7337 unsigned long nformats; 7336 7338 struct image_type img_type; 7337 char **formats = magick_get_magick_list ("*", &nformats );7339 char **formats = magick_get_magick_list ("*", &nformats, &magick_exception); 7338 7340 7339 7341 img_type.valid_p = imagemagick_image_p; … … 7803 7805 if (!resolve_imagemagick_api ()) 7804 7806 return 0; 7805 7806 if (!imagemagick_version_p ())7807 {7808 FreeLibrary (hmagick);7809 hmagick = NULL;7810 return 0;7811 }7812 7807 7813 7808 magick_initialize_magick (NULL);
