Refactor image-type loading.
authorChong Yidong <cyd@gnu.org>
Sat, 22 Sep 2012 14:10:24 +0000 (22:10 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 22 Sep 2012 14:10:24 +0000 (22:10 +0800)
commitbb4d86b40c61443608280df3d0668d44845177a5
tree421c8ddc18fd1f329b1906cea10f6cb60d389b37
parent287d74553b1116a8e3e97e399e231c0423429aca
Refactor image-type loading.

* src/dispextern.h (struct image_type): Add new slot, storing a type
initialization function.

* src/image.c (define_image_type): Call the image initializer function
if it is defined.  Arguments and return value changed.
(valid_image_p, make_image): Callers changed.
(xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
(gif_type, imagemagick_type, svg_type, gs_type): Add
initialization functions.
(Finit_image_library): Call lookup_image_type.
(CHECK_LIB_AVAILABLE): Macro deleted.
(lookup_image_type): Call define_image_type here, rather than via
Finit_image_library, and without using CHECK_LIB_AVAILABLE.
(syms_of_image): Move define_image_type calls for xbm_type and
pbm_type to lookup_image_type.
src/ChangeLog
src/dispextern.h
src/image.c