<HTML>
<HEAD>
<TITLE>mac - Macintosh Utility Methods for ImageMagick</TITLE>
<LINK REV="made" HREF="mailto:magick@wizards.dupont.com">
</HEAD>

<body background="../../images/background.png">

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A>
	<UL>

		<LI><A HREF="#BottleneckTest">BottleneckTest</A>
		<LI><A HREF="#closedir">closedir</A>
		<LI><A HREF="#Exit">Exit</A>
		<LI><A HREF="#FilenameToFSSpec">FilenameToFSSpec</A>
		<LI><A HREF="#ImageFormatConflict">ImageFormatConflict</A>
		<LI><A HREF="#MacGSExecuteCommand">MacGSExecuteCommand</A>
		<LI><A HREF="#MacGSLaunchApplicationCore">MacGSLaunchApplicationCore</A>
		<LI><A HREF="#MacGSLaunchApplication">MacGSLaunchApplication</A>
		<LI><A HREF="#MacGSLaunchApplicationToFront">MacGSLaunchApplicationToFront</A>
		<LI><A HREF="#MacGSQuitApplication">MacGSQuitApplication</A>
		<LI><A HREF="#MacGSSetWorkingFolder">MacGSSetWorkingFolder</A>
		<LI><A HREF="#MACSystemCommand">MACSystemCommand</A>
		<LI><A HREF="#MACWarningHandler">MACWarningHandler</A>
		<LI><A HREF="#opendir">opendir</A>
		<LI><A HREF="#ProcessPendingEvents">ProcessPendingEvents</A>
		<LI><A HREF="#readdir">readdir</A>
		<LI><A HREF="#ReadPICTImage">ReadPICTImage</A>
		<LI><A HREF="#SearchForFile">SearchForFile</A>
		<LI><A HREF="#seekdir">seekdir</A>
		<LI><A HREF="#SetApplicationType">SetApplicationType</A>
		<LI><A HREF="#telldir">telldir</A>
	</UL>

</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
mac - Macintosh Utility Methods for ImageMagick

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
<STRONG>Exit</STRONG>( status );

<P>
<STRONG>FilenameToFSSpec</STRONG>( filename, fsspec );

<P>
status= <STRONG>ImageFormatConflict</STRONG>( magick );

<P>
<STRONG>ProcessPendingEvents</STRONG>( text );

<P>
<STRONG>SetApplicationType</STRONG>( filename, magick, application );

<P>
<STRONG>closedir</STRONG>( entry );

<P>
<STRONG>readdir</STRONG>( entry );

<P>
<STRONG>seekdir</STRONG>( entry, position );

<P>
<STRONG>telldir</STRONG>( entry );

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
<HR>
<H2><A NAME="BottleneckTest">BottleneckTest</A></H2>
<P>
Method BottleneckTest intercepts any compressed images.

<P>
The format of the BottleneckTest method is:

<P>
<PRE>    int ImageFormatConflict(const char *magick)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG><A NAME="item_o">picture:</A></STRONG><DD>
<P>
Specifies a pointer to a PicHandle structure.

<p><dt><STRONG>codec:</STRONG><DD>
<P>
The code type is returned in this CodecType pointer structure.

<p><dt><STRONG>depth:</STRONG><DD>
<P>
The image depth is returned as an integer pointer.

<p><dt><STRONG>colormap_id:</STRONG><DD>
<P>
The colormap 
<FONT SIZE=-1>ID</FONT> is returned in this short pointer.

</DL></DL>
<P>
<HR>
<H2><A NAME="closedir">closedir</A></H2>
<P>
Method closedir closes the named directory stream and frees the 
<FONT SIZE=-1>DIR</FONT> structure.

<P>
The format of the closedir method is:

<blockquote>closedir ( entry ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a 
<FONT SIZE=-1>DIR</FONT> structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="Exit">Exit</A></H2>
<P>
Method Exit exits the process.

<P>
The format of the Exit method is:

<blockquote>Exit ( status ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>status:</STRONG><DD>
<P>
an integer value representing the status of the terminating process.

</DL></DL>
<P>
<HR>
<H2><A NAME="FilenameToFSSpec">FilenameToFSSpec</A></H2>
<P>
Method FilenameToFSSpec sets the file type of an image.

<P>
The format of the FilenameToFSSpec method is:

<blockquote>FilenameToFSSpec ( filename, fsspec ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>filename:</STRONG><DD>
<P>
Specifies the name of the file.

<p><dt><STRONG>fsspec:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> pointer to type FSSpec.

</DL></DL>
<P>
<HR>
<H2><A NAME="ImageFormatConflict">ImageFormatConflict</A></H2>
<P>
Method ImageFormatConflict returns true if the image format conflicts with a logical drive (.e.g. 
<FONT SIZE=-1>X:).</FONT>


<P>
Contributed by Mark Gavin of Digital Applications, Inc.

<P>
The format of the ImageFormatConflict method is:

<blockquote>status=ImageFormatConflict ( magick ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>status:</STRONG><DD>
<P>
Method ImageFormatConflict returns true if the image format conflicts with
a logical drive.

<p><dt><STRONG>magick:</STRONG><DD>
<P>
Specifies the image format.

</DL></DL>
<P>
<HR>
<H2><A NAME="MacGSExecuteCommand">MacGSExecuteCommand</A></H2>
<P>
Method MacGSExecuteCommand executes the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplicationCore">MacGSLaunchApplicationCore</A></H2>
<P>
Method MacGSLaunchApplicationCore launches the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplication">MacGSLaunchApplication</A></H2>
<P>
Method MacGSLaunchApplication launches the Ghostscript command.

<P>
<HR>
<H2><A NAME="MacGSLaunchApplicationToFront">MacGSLaunchApplicationToFront</A></H2>
<P>
Method MacGSLaunchApplicationToFront moves the Ghostscript window to the
front.

<P>
<HR>
<H2><A NAME="MacGSQuitApplication">MacGSQuitApplication</A></H2>
<P>
Method MacGSQuitApplication quits the Ghostscript application.

<P>
<HR>
<H2><A NAME="MacGSSetWorkingFolder">MacGSSetWorkingFolder</A></H2>
<P>
Method MacGSSetWorkingFolder set the Ghostscript working folder.

<P>
<HR>
<H2><A NAME="MACSystemCommand">MACSystemCommand</A></H2>
<P>
<PRE> Method MACSystemCommand executes the specified command and waits until it
 terminates.  The returned value is the exit status of the command.
</PRE>
<P>
The format of the MACSystemCommand method is:

<P>
<PRE>    void MACWarningHandler(const unsigned int warning,const char *message,
      const char *qualifier)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>command:</STRONG><DD>
<P>
This string is the command to execute.

</DL></DL>
<P>
<HR>
<H2><A NAME="MACWarningHandler">MACWarningHandler</A></H2>
<P>
Method MACWarningHandler displays a warning message.

<P>
The format of the MACWarningHandler method is:

<P>
<HR>
<H2><A NAME="opendir">opendir</A></H2>
<P>
Method opendir opens the directory named by filename and associates a
directory stream with it.

<P>
The format of the opendir method is:

<P>
<PRE>    void ProcessPendingEvents(const char *text)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a 
<FONT SIZE=-1>DIR</FONT> structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="ProcessPendingEvents">ProcessPendingEvents</A></H2>
<P>
Method ProcessPendingEvents processes any pending events. This prevents
ImageMagick from monopolizing the processor.

<P>
The format of the ProcessPendingEvents method is:

<blockquote>ProcessPendingEvents ( text ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>text:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> character string representing the current process.

</DL></DL>
<P>
<HR>
<H2><A NAME="readdir">readdir</A></H2>
<P>
Method readdir returns a pointer to a structure representing the directory
entry at the current position in the directory stream to which entry
refers.

<P>
The format of the readdir

<blockquote>readdir ( entry ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a 
<FONT SIZE=-1>DIR</FONT> structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="ReadPICTImage">ReadPICTImage</A></H2>
<P>
Method ReadPICTImage reads an Apple Macintosh QuickDraw/PICT image file
using MacOS QuickDraw methods and returns it. It allocates the memory
necessary for the new Image structure and returns a pointer to the new
image.

<P>
This method was written and contributed by <A
HREF="mailto:spd@daphne.cps.unizar.es">spd@daphne.cps.unizar.es</A> (feel
free to copy and use it as you want. No warranty).

<P>
The format of the ReadPICTImage method is:

<P>
<PRE>    void ProcessPendingEvents(const char *text)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>image:</STRONG><DD>
<P>
Method ReadPICTImage returns a pointer to the image after reading. 
<FONT SIZE=-1>A</FONT> null image is returned if there is a a memory
shortage or if the image cannot be read.

<p><dt><STRONG>image_info:</STRONG><DD>
<P>
Specifies a pointer to an ImageInfo structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="SearchForFile">SearchForFile</A></H2>
<P>
Method SearchForFile searches for a file.

<P>
<HR>
<H2><A NAME="seekdir">seekdir</A></H2>
<P>
Method seekdir sets the position of the next <CODE>readdir()</CODE>
operation on the directory stream.

<P>
The format of the seekdir method is:

<blockquote>seekdir ( entry, position ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a 
<FONT SIZE=-1>DIR</FONT> structure.

<p><dt><STRONG>position:</STRONG><DD>
<P>
specifies the position associated with the directory stream.

</DL></DL>
<P>
<HR>
<H2><A NAME="SetApplicationType">SetApplicationType</A></H2>
<P>
Method SetApplicationType sets the file type of an image.

<P>
The format of the SetApplicationType method is:

<blockquote>SetApplicationType ( filename, magick, application ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>filename:</STRONG><DD>
<P>
Specifies the name of the file.

<p><dt><STRONG>filename:</STRONG><DD>
<P>
Specifies the file type.

<p><dt><STRONG>application:</STRONG><DD>
<P>
Specifies the type of the application.

</DL></DL>
<P>
<HR>
<H2><A NAME="telldir">telldir</A></H2>
<P>
<PRE> Method telldir returns the current location associated  with  the
 named directory stream.
</PRE>
<P>
The format of the telldir method is:

<blockquote>telldir ( entry ); </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<p><dt><STRONG>entry:</STRONG><DD>
<P>
Specifies a pointer to a 
<FONT SIZE=-1>DIR</FONT> structure.

</DL></DL>
</BODY>

</HTML>
