📄 apr__getopt_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: apr_getopt.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>apr_getopt.h</h1><a href="apr__getopt_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as</span>
00002 <span class="comment"> * applicable.</span>
00003 <span class="comment"> *</span>
00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
00006 <span class="comment"> * You may obtain a copy of the License at</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment"> *</span>
00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
00014 <span class="comment"> * limitations under the License.</span>
00015 <span class="comment"> */</span>
00016
00017 <span class="preprocessor">#ifndef APR_GETOPT_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_GETOPT_H</span>
00019 <span class="preprocessor"></span><span class="comment"></span>
00020 <span class="comment">/**</span>
00021 <span class="comment"> * @file apr_getopt.h</span>
00022 <span class="comment"> * @brief APR Command Arguments (getopt)</span>
00023 <span class="comment"> */</span>
00024
00025 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html">apr_pools.h</a>"</span>
00026
00027 <span class="preprocessor">#ifdef __cplusplus</span>
00028 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00029 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00030 <span class="comment"></span>
00031 <span class="comment">/**</span>
00032 <span class="comment"> * @defgroup apr_getopt Command Argument Parsing</span>
00033 <span class="comment"> * @ingroup APR </span>
00034 <span class="comment"> * @{</span>
00035 <span class="comment"> */</span>
00036 <span class="comment"></span>
00037 <span class="comment">/** </span>
00038 <span class="comment"> * defintion of a error function </span>
00039 <span class="comment"> */</span>
<a name="l00040"></a><a class="code" href="group__apr__getopt.html#ga0">00040</a> <span class="keyword">typedef</span> void (<a class="code" href="group__apr__getopt.html#ga0">apr_getopt_err_fn_t</a>)(<span class="keywordtype">void</span> *arg, <span class="keyword">const</span> <span class="keywordtype">char</span> *err, ...);
00041 <span class="comment"></span>
00042 <span class="comment">/** @see apr_getopt_t */</span>
<a name="l00043"></a><a class="code" href="group__apr__getopt.html#ga1">00043</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__getopt__t.html">apr_getopt_t</a> <a class="code" href="group__apr__getopt.html#ga1">apr_getopt_t</a>;
00044 <span class="comment"></span>
00045 <span class="comment">/**</span>
00046 <span class="comment"> * Structure to store command line argument information.</span>
00047 <span class="comment"> */</span>
<a name="l00048"></a><a class="code" href="structapr__getopt__t.html">00048</a> <span class="keyword">struct </span><a class="code" href="group__apr__getopt.html#ga1">apr_getopt_t</a> {<span class="comment"></span>
00049 <span class="comment"> /** context for processing */</span>
<a name="l00050"></a><a class="code" href="structapr__getopt__t.html#o0">00050</a> <a class="code" href="group__apr__pools.html#ga0">apr_pool_t</a> *<a class="code" href="structapr__getopt__t.html#o0">cont</a>;<span class="comment"></span>
00051 <span class="comment"> /** function to print error message (NULL == no messages) */</span>
<a name="l00052"></a><a class="code" href="structapr__getopt__t.html#o1">00052</a> <a class="code" href="group__apr__getopt.html#ga0">apr_getopt_err_fn_t</a> *<a class="code" href="structapr__getopt__t.html#o1">errfn</a>;<span class="comment"></span>
00053 <span class="comment"> /** user defined first arg to pass to error message */</span>
<a name="l00054"></a><a class="code" href="structapr__getopt__t.html#o2">00054</a> <span class="keywordtype">void</span> *<a class="code" href="structapr__getopt__t.html#o2">errarg</a>;<span class="comment"></span>
00055 <span class="comment"> /** index into parent argv vector */</span>
<a name="l00056"></a><a class="code" href="structapr__getopt__t.html#o3">00056</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o3">ind</a>;<span class="comment"></span>
00057 <span class="comment"> /** character checked for validity */</span>
<a name="l00058"></a><a class="code" href="structapr__getopt__t.html#o4">00058</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o4">opt</a>;<span class="comment"></span>
00059 <span class="comment"> /** reset getopt */</span>
<a name="l00060"></a><a class="code" href="structapr__getopt__t.html#o5">00060</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o5">reset</a>;<span class="comment"></span>
00061 <span class="comment"> /** count of arguments */</span>
<a name="l00062"></a><a class="code" href="structapr__getopt__t.html#o6">00062</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o6">argc</a>;<span class="comment"></span>
00063 <span class="comment"> /** array of pointers to arguments */</span>
<a name="l00064"></a><a class="code" href="structapr__getopt__t.html#o7">00064</a> <span class="keyword">const</span> <span class="keywordtype">char</span> **<a class="code" href="structapr__getopt__t.html#o7">argv</a>;<span class="comment"></span>
00065 <span class="comment"> /** argument associated with option */</span>
<a name="l00066"></a><a class="code" href="structapr__getopt__t.html#o8">00066</a> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="structapr__getopt__t.html#o8">place</a>;<span class="comment"></span>
00067 <span class="comment"> /** set to nonzero to support interleaving options with regular args */</span>
<a name="l00068"></a><a class="code" href="structapr__getopt__t.html#o9">00068</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o9">interleave</a>;<span class="comment"></span>
00069 <span class="comment"> /** start of non-option arguments skipped for interleaving */</span>
<a name="l00070"></a><a class="code" href="structapr__getopt__t.html#o10">00070</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o10">skip_start</a>;<span class="comment"></span>
00071 <span class="comment"> /** end of non-option arguments skipped for interleaving */</span>
<a name="l00072"></a><a class="code" href="structapr__getopt__t.html#o11">00072</a> <span class="keywordtype">int</span> <a class="code" href="structapr__getopt__t.html#o11">skip_end</a>;
00073 };
00074 <span class="comment"></span>
00075 <span class="comment">/** @see apr_getopt_option_t */</span>
<a name="l00076"></a><a class="code" href="group__apr__getopt.html#ga2">00076</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> <a class="code" href="group__apr__getopt.html#ga2">apr_getopt_option_t</a>;
00077 <span class="comment"></span>
00078 <span class="comment">/**</span>
00079 <span class="comment"> * Structure used to describe options that getopt should search for.</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -