]> granicus.if.org Git - imagemagick/blobdiff - utilities/import.c
(no commit message)
[imagemagick] / utilities / import.c
index f1c99097255a8105d662a94956a722a62d8a2758..f66b990036b3de334b3774347d6c5d76cdedb5fd 100644 (file)
 %               Import image to a machine independent format.                 %
 %                                                                             %
 %                           Software Design                                   %
-%                             John Cristy                                     %
+%                                Cristy                                       %
 %                              July 1992                                      %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -47,8 +47,8 @@
 /*
   Include declarations.
 */
-#include "wand/studio.h"
-#include "wand/MagickWand.h"
+#include "MagickWand/studio.h"
+#include "MagickWand/MagickWand.h"
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 */
 
-#if defined(MAGICKCORE_WINDOWS_SUPPORT)
-int WINAPI WinMain(HINSTANCE instance,HINSTANCE last,LPSTR command,int state)
-{
-  char
-    **argv;
-
-  int
-    argc,
-    main(int,char **);
-
-  (void) instance;
-  (void) last;
-  (void) state;
-  argv=StringToArgv(command,&argc);
-  return(main(argc,argv));
-}
-#endif
-
-int main(int argc,char **argv)
+static int ImportMain(int argc,char **argv)
 {
   ExceptionInfo
     *exception;
@@ -101,5 +83,31 @@ int main(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status != MagickFalse ? 0 : 1);
+}
+
+#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
+int main(int argc,char **argv)
+{
+  return(ImportMain(argc,argv));
 }
+#else
+int wmain(int argc,wchar_t *argv[])
+{
+  char
+    **utf8;
+
+  int
+    status;
+
+  register int
+    i;
+
+  utf8=NTArgvToUTF8(argc,argv);
+  status=ImportMain(argc,utf8);
+  for (i=0; i < argc; i++)
+    utf8[i]=DestroyString(utf8[i]);
+  utf8=(char **) RelinquishMagickMemory(utf8);
+  return(status != MagickFalse ? 0 : 1);
+}
+#endif