Changeset 3377

Show
Ignore:
Timestamp:
08/07/04 08:12:35 (4 years ago)
Author:
miyoshi
Message:

(pget_image_magick_t): New type definition.
(pget_image_magick): New static variable.
(magick_get_image_magick): New function.
(Fmw32_get_image_magick): Ditto.
(syms_of_mw32fns): Define the above function.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/src/ChangeLog.Meadow

    r3375 r3377  
     12004-08-07  MIYOSHI Masanori  <miyoshi@meadowy.org> 
     2 
     3        * mw32fns.c (pget_image_magick_t): New type definition. 
     4        (pget_image_magick): New static variable. 
     5        (magick_get_image_magick): New function. 
     6        (Fmw32_get_image_magick): Ditto. 
     7        (syms_of_mw32fns): Define the above function. 
     8 
    192004-07-25  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    210 
  • branches/2.1/src/mw32fns.c

    r3364 r3377  
    60336033typedef void *(*prelinquish_magick_memory_t) (void **memory); 
    60346034typedef void *(*pacquire_string_t) (const char *); 
     6035typedef const char *(*pget_image_magick_t) (const unsigned char *, 
     6036                                            const size_t); 
    60356037 
    60366038static HINSTANCE hmagick = NULL; 
     
    60686070static prelinquish_magick_memory_t prelinquish_magick_memory; 
    60696071static pacquire_string_t pacquire_string; 
     6072static pget_image_magick_t pget_image_magick; 
    60706073 
    60716074/* ImageMagick function wrappers.  */ 
     
    63476350    return NULL; 
    63486351  return (*pacquire_string) (source); 
     6352} 
     6353 
     6354static const char * 
     6355magick_get_image_magick (const unsigned char *magick, const size_t length) 
     6356{ 
     6357  if (pget_image_magick == NULL) 
     6358    return NULL; 
     6359  return (*pget_image_magick) (magick, length); 
    63496360} 
    63506361 
     
    64156426                       "RelinquishMagickMemory"); 
    64166427  MAGICK_RESOLVE_FUNC (pacquire_string, pacquire_string_t, "AcquireString"); 
     6428  MAGICK_RESOLVE_FUNC (pget_image_magick, pget_image_magick_t, 
     6429                       "GetImageMagick"); 
    64176430 
    64186431#undef MAGICK_RESOLVE_FUNC 
     
    78117824  return ret; 
    78127825} 
     7826 
     7827DEFUN ("mw32-get-image-magick", Fmw32_get_image_magick, 
     7828       Smw32_get_image_magick, 1, 1, 0, 
     7829  "Searches for an image format that matches the specified magick string.") 
     7830     (string) 
     7831     Lisp_Object string; 
     7832{ 
     7833  const char *format = magick_get_image_magick (SDATA (string), 
     7834                                                SBYTES (string)); 
     7835 
     7836  if (format == NULL) 
     7837    return Qnil; 
     7838  else 
     7839    return *imagemagick_image_type_lisp_symbol (format); 
     7840} 
     7841 
    78137842  
    78147843/*********************************************************************** 
     
    95859614 
    95869615  defsubr (&Smw32_file_dialog); 
     9616 
     9617  defsubr (&Smw32_get_image_magick); 
    95879618} 
    95889619