chapter_3_section_8.html   [plain text]


<html>
    <head>
        <META NAME="Generator" CONTENT="Gutenberg">
		<META NAME="GeneratorVersion" CONTENT="v100.1">
        <META http-equiv="content-type" CONTENT="text/html;charset=iso-8859-1">
        <META NAME = "Copyright" CONTENT="Copyright 2004 Apple Computer, Inc. All Rights Reserved.">
        <TITLE>HeaderDoc Unfettered: Tags for All Languages</TITLE>
        <base target="content">

        <LINK REL="stylesheet" TYPE="text/css" HREF="../Resources/CSS/frameset_styles.css">
        <style type="text/css"></style>
        <script language="JavaScript" src="../Resources/JavaScript/page.js"></script>
    </head>
    
    <BODY bgcolor="#ffffff" onload="initialize_page();"><a name="//apple_ref/doc/uid/TP40001215-CH346-CIHCEBGD" title="Tags for All Languages" turn_anchor="no"></a>
        <a name="top"></a>
        <!-- start of header -->
        <!--#include virtual="/includes/framesetheader" -->
        <!-- end of header -->
        
        <!-- start of path -->
<div class="breadcrumb"><a href="http://developer.apple.com/" target="_top">ADC Home</a> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000943"  -->Reference Library<!--/a--> &gt; <!--a logicalPath="Unknown"  -->Technology TBD<!--/a--> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH345" href="../intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001215-CH345">HeaderDoc Unfettered</a> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346" href="chapter_3_section_1.html#//apple_ref/doc/uid/TP40001215-CH346">HeaderDoc Tags</a> &gt; </div><br>
<!-- end of path -->
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
  
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_3_section_7.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_3_section_9.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>
        
        <hr>
        
        <a name="CIHCEBGD" title="Tags for All Languages" turn_anchor="no"></a><br><h2>Tags for All Languages</h2>



    <h4>In this section:</h4>

    
    
    
    <blockquote class="content_text">
        
            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_858" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_858">AvailabilityMacro Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_859" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_859">const Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_860" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_860">#define Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_861" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_861">Enum Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-CIHHJCBD" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-CIHHJCBD">Function Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_863" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_863">FunctionGroup Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_864" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_864">Struct and  Union Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_865" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_865">Typedef Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_866" href="chapter_3_section_8.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_866">Var tags</a>
            
        <br>

    </blockquote>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_858" title="
AvailabilityMacro Tags" turn_anchor="no"></a><br><h3>
<tt>AvailabilityMacro</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@availabilitymacro</b></p></td>
<td class="content_text"><p>The name of the availability macro and a string describing
it. If the macro name appears in the declaration of any later function,
class, method, or data type, the string will be added to its documentation
as an availability attribute. See <span class="content_text"><a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-CIHDAAGB" href="chapter_3_section_4.html#//apple_ref/doc/uid/TP40001215-CH346-CIHDAAGB">&#8220;Automatic Tagging&#8221;</a></span> for more
information.</p></td>
<td class="content_text"><p>	2</p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-2 @enum
Example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @availabilitymacro AVAILABLE_IN_MYAPP_1_0_AND_LATER This function is available in version 1.0 and later of MYAPP.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>This is usually followed by a #define or similar, but that
is not necessary. This HeaderDoc comment is a standalone comment&#8212;that
is, it does not cause the code after it to be processed in any way.
If you want to mark a <tt>#define</tt> as
being an availability macro, you should follow this tag with a second
HeaderDoc comment for the <tt>#define</tt> itself.</p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_859" title="
const Tags" turn_anchor="no"></a><br><h3>
<tt>const</tt> Tags</h3><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@const</b>			</p></td>
<td class="content_text"><p>Name of the constant.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-3 Example
of @const</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code> /*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @const kCFTypeArrayCallBacks</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Predefined CFArrayCallBacks structure containing a set of callbacks appropriate...</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> */</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> const CFArrayCallBacks kCFTypeArrayCallBacks;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p> </p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_860" title="
#define Tags" turn_anchor="no"></a><br><h3>
<tt>#define</tt> Tags</h3><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@defined</b>			</p></td>
<td class="content_text"><p>Name of the macro.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>
<div class="notebox"><span class="content_text"><b>Note: </b> Function-like
defines with curly braces may also use <b>@function</b>.
This option is included for legacy compatibility and has no effect
on the resulting output.</span></div>
<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-4 Example
of @defined</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code> /*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @defined TRUE</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Defines the boolean true value.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> */</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> #define TRUE 1</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> </code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>For more usage examples, see the <b>ExampleHeaders</b> folder
that accompanies the HeaderDoc distribution.</p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_861" title="
Enum Tags" turn_anchor="no"></a><br><h3>
<tt>Enum</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@enum</b></p></td>
<td class="content_text"><p>The name of the enumeration. This is the enum's tag,
if it has one. Otherwise, supply a name you want to have the constants grouped
under in the documentation.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@constant</b></p></td>
<td class="content_text"><p>A constant within the enumeration.</p></td>
<td class="content_text"><p>	2 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-5 @enum
Example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @enum Beverage Categories</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Categorizes beverages into groups of similar types.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kSoda Sweet, carbonated, non-alcoholic beverages.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kBeer Light, grain-based, alcoholic beverages.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kMilk Dairy beverages.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kWater Unflavored, non-sweet, non-caloric, non-alcoholic beverages.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>enum {</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kSoda = (1 &lt;&lt; 6),</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kBeer = (1 &lt;&lt; 7),</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kMilk = (1 &lt;&lt; 8),</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kWater = (1 &lt;&lt; 9)</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>}</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<a name="//apple_ref/doc/uid/TP40001215-CH346-CIHHJCBD" title="Function Tags" turn_anchor="no"></a><a name="CIHHJCBD" title="Function Tags" turn_anchor="no"></a><br><h3><tt>Function</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@function</b>			</p></td>
<td class="content_text"><p>The name of the function or macro.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@param</b>			</p></td>
<td class="content_text"><p>Each of the function's parameters.</p></td>
<td class="content_text"><p>	2 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@result</b>			</p></td>
<td class="content_text"><p>The return value of the function. Don't include if the
return value is void or OSERR</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@throws</b>			</p></td>
<td class="content_text"><p>Include one <b>@throws</b> tag for each exception thrown
by this function (in languages that support exceptions).</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@templatefield</b></p></td>
<td class="content_text"><p>Each of the function&#8217;s template fields (C++).</p></td>
<td class="content_text"><p>	2 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-6 @function
Example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @function ConstructBLT</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Creates a Sandwich structure from the supplied arguments.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param b Top ingredient, typically protein-rich.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param l Middle ingredient.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param t Bottom ingredient, controls tartness.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param mayo A flag controlling addition of condiment. Use YES for condiment,</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> HOLDTHE otherwise.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @throws peanuts</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @templatefield K The type of BLT to be generated (I want a BLT float)</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @result A pointer to a Sandwich structure. Caller is responsible for </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> disposing of this structure.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>Sandwich *ConstructBLT&lt;K&gt;(Ingredient b, Ingredient l, Ingredient t, Boolean mayo);</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_863" title="
FunctionGroup Tags" turn_anchor="no"></a><br><h3>
<tt>FunctionGroup</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@functiongroup</b>			</p></td>
<td class="content_text"><p>The name of the function group.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-7 @functiongroup
example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @functiongroup Core Functions</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>Function groups are not required, but they allow you to organize
a large number of functions into near groupings. The <b>@functiongroup</b> tag
remains in effect until the next <b>@functiongroup</b> tag.</p>
<p>If you need to put functions in different parts of the header
into the same group, simply give them the same name (with the same
capitalization, punctuation, spacing, etc.), and it will merge the
two function groups into one.</p>
<p>Note that functions encountered before the first <b>@functiongroup</b> are
considered part of the &#8220;empty&#8221; group. These functions will be
listed before any grouped functions.</p>
<p> </p>
<p></p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_864" title="
Struct and 
Union Tags" turn_anchor="no"></a><br><h3>
<tt>Struct</tt> and 
<tt>Union</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@struct </b>/<b> @union</b></p></td>
<td class="content_text"><p>The name of the structure or union. (Also known as the
struct or union's tag.)</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@field</b></p></td>
<td class="content_text"><p>A field in the structure.</p></td>
<td class="content_text"><p>	2 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-8 <tt>@struct</tt> Example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @struct TableOrigin</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Locates lower-left corner of table in screen coordinates.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field x Point on horizontal axis.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field y Point on vertical axis</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>struct TableOrigin {</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> int x;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> int y;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>}</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_865" title="
Typedef Tags" turn_anchor="no"></a><br><h3>
<tt>Typedef</tt> Tags</h3><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@typedef</b></p></td>
<td class="content_text"><p>The name of the defined type.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><i>various</i></p></td>
<td class="content_text"><p>The tags that can appear after a &#8220;<b>@typedef</b>&#8221;
tag depend on the definition of the new type.</p><p><b>@field</b> for
typedef&#8217;d structs</p><p><b>@constant</b> for
typedef'd enumerations</p><p><b>@param</b> for
simple typedef'd function pointers</p><p><b>@callback</b>, </p><p><b>@param</b>, </p><p><b>@result</b> for
typedef'd structs containing function pointers</p></td>
<td class="content_text"><p></p></td>
</tr>


</table><br>

<p><b>Example 1 - Typedef for a simple struct:</b></p>
<table><table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @typedef TypedefdSimpleStruct</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @abstract Abstract for this API.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Discussion that applies to the entire typedef'd simple struct.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field firstField Description of first field</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field secondField Description of second field</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>typedef struct _structTag {</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> short firstField;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> unsigned long secondField</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>} TypedefdSimpleStruct;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p> </p>
<p><b>Example 2 - Typedef for an enumeration:</b></p>
<table><table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @typedef TypedefdEnum</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @abstract Abstract for this API.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Discussion that applies to the entire typedef'd enum.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kCFCompareLessThan Description of first constant.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kCFCompareEqualTo Description of second constant.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @constant kCFCompareGreaterThan Description of third constant.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>typedef enum {</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kCFCompareLessThan = -1,</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kCFCompareEqualTo = 0,</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> kCFCompareGreaterThan = 1</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>} TypedefdEnum;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-9 Typedef
for a simple function pointer:</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*!</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @typedef simpleCallback</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @abstract Abstract for this API.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Discussion that applies to the entire callback.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param inFirstParameter Description of the callback's first parameter.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param outSecondParameter Description of the callback's second parameter.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @result Returns what it can when it is possible to do so.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>typedef long (*simpleCallback)(short inFirstParameter, unsigned long long *outSecondParameter);</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-10 Typedef
for a struct containing function pointers:</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! @typedef TypedefdStructWithCallbacks</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @abstract Abstract for this API.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @discussion Defines the basic interface for Command DescriptorBlock (CDB) commands.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field firstField Description of first field.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @callback setPointers Specifies the location of the data buffer. The setPointers function has the following parameters:</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param cmd A pointer to the CDB command interface.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @param sgList A pointer to a scatter/gather list.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @result An IOReturn structure which returns the return value in the structure returned. </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @field lastField Description of the struct's last field.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>typedef struct _someTag {</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> short firstField;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> IOReturn (*setPointers)(void *cmd, IOVirtualRange *sgList);</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> unsigned long lastField</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>} TypedefdStructWithCallbacks;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p> </p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_866" title="
Var tags" turn_anchor="no"></a><br><h3>
<tt>Var</tt> tags</h3>
<p>The <b>@var</b> tag should be used when marking
up global variables, class variables, and instance variables (as
opposed to actual declaration of new data types).</p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>Tag</p></b></div></th>
<th scope="col"><div align="left"><b><p>Identifies</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><b>@var</b></p></td>
<td class="content_text"><p>The name of the data member followed by the description.</p></td>
<td class="content_text"><p>	2 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 3-11 @var
Example</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! @var we_are_root TRUE if this device is the root power domain */</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> boolwe_are_root;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>

        <br><br> 
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
           
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_3_section_7.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_3_section_9.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>

        <br><hr><p class="content_text"> <!--#if expr="0=1" -->&#169; 1999, 2004 Apple Computer, Inc. All Rights Reserved. (<!--#endif -->Last updated: 2004-05-27<!--#if expr="0=1" -->)<!--#endif --></p>

        
        <!-- start of footer -->
        <!--#include virtual="/includes/framesetfooter" -->
        <!-- end of footer -->
    </BODY>
</html>