You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

136 lines
6.4 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>fuse: fuse_opt Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">fuse
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<div class="title">fuse_opt Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;fuse_opt.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a215255be3ed5c0f6c3e0d5dcc96d7b12"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfuse__opt.html#a215255be3ed5c0f6c3e0d5dcc96d7b12">templ</a></td></tr>
<tr class="separator:a215255be3ed5c0f6c3e0d5dcc96d7b12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a333dcd849a3bd54df06084a69b5a8d39"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfuse__opt.html#a333dcd849a3bd54df06084a69b5a8d39">offset</a></td></tr>
<tr class="separator:a333dcd849a3bd54df06084a69b5a8d39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb76339e1ce6948ad94bd2d4d5d01e20"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfuse__opt.html#aeb76339e1ce6948ad94bd2d4d5d01e20">value</a></td></tr>
<tr class="separator:aeb76339e1ce6948ad94bd2d4d5d01e20"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Option description</p>
<p>This structure describes a single option, and action associated with it, in case it matches.</p>
<p>More than one such match may occur, in which case the action for each match is executed.</p>
<p>There are three possible actions in case of a match:</p>
<p>i) An integer (int or unsigned) variable determined by 'offset' is set to 'value'</p>
<p>ii) The processing function is called, with 'value' as the key</p>
<p>iii) An integer (any) or string (char *) variable determined by 'offset' is set to the value of an option parameter</p>
<p>'offset' should normally be either set to</p>
<ul>
<li>'offsetof(struct foo, member)' actions i) and iii)</li>
<li>-1 action ii)</li>
</ul>
<p>The 'offsetof()' macro is defined in the &lt;stddef.h&gt; header.</p>
<p>The template determines which options match, and also have an effect on the action. Normally the action is either i) or ii), but if a format is present in the template, then action iii) is performed.</p>
<p>The types of templates are:</p>
<p>1) "-x", "-foo", "--foo", "--foo-bar", etc. These match only themselves. Invalid values are "--" and anything beginning with "-o"</p>
<p>2) "foo", "foo-bar", etc. These match "-ofoo", "-ofoo-bar" or the relevant option in a comma separated option list</p>
<p>3) "bar=", "--foo=", etc. These are variations of 1) and 2) which have a parameter</p>
<p>4) "bar=%s", "--foo=%lu", etc. Same matching as above but perform action iii).</p>
<p>5) "-x ", etc. Matches either "-xparam" or "-x param" as two separate arguments</p>
<p>6) "-x %s", etc. Combination of 4) and 5)</p>
<p>If the format is "%s", memory is allocated for the string unlike with scanf(). </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a333dcd849a3bd54df06084a69b5a8d39"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long fuse_opt::offset</td>
</tr>
</table>
</div><div class="memdoc">
<p>Offset of variable within 'data' parameter of <a class="el" href="fuse__opt_8h.html#a539ef1f571c34f516c60c4cbe2901c0e">fuse_opt_parse()</a> or -1 </p>
</div>
</div>
<a class="anchor" id="a215255be3ed5c0f6c3e0d5dcc96d7b12"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* fuse_opt::templ</td>
</tr>
</table>
</div><div class="memdoc">
<p>Matching template and optional parameter formatting </p>
</div>
</div>
<a class="anchor" id="aeb76339e1ce6948ad94bd2d4d5d01e20"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int fuse_opt::value</td>
</tr>
</table>
</div><div class="memdoc">
<p>Value to set the variable to, or to be passed as 'key' to the processing function. Ignored if template has a format </p>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/<a class="el" href="fuse__opt_8h.html">fuse_opt.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Apr 23 2016 09:43:20 for fuse by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>