📄 apr__user_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_user.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_user.h</h1><a href="apr__user_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_USER_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_USER_H</span>
00019 <span class="preprocessor"></span><span class="comment"></span>
00020 <span class="comment">/**</span>
00021 <span class="comment"> * @file apr_user.h</span>
00022 <span class="comment"> * @brief APR User ID Services </span>
00023 <span class="comment"> */</span>
00024
00025 <span class="preprocessor">#include "apr.h"</span>
00026 <span class="preprocessor">#include "<a class="code" href="apr__errno_8h.html">apr_errno.h</a>"</span>
00027 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html">apr_pools.h</a>"</span>
00028
00029 <span class="preprocessor">#ifdef __cplusplus</span>
00030 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00031 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00032 <span class="comment"></span>
00033 <span class="comment">/**</span>
00034 <span class="comment"> * @defgroup apr_user User and Group ID Services</span>
00035 <span class="comment"> * @ingroup APR </span>
00036 <span class="comment"> * @{</span>
00037 <span class="comment"> */</span>
00038 <span class="comment"></span>
00039 <span class="comment">/**</span>
00040 <span class="comment"> * Structure for determining user ownership.</span>
00041 <span class="comment"> */</span>
00042 <span class="preprocessor">#ifdef WIN32</span>
00043 <span class="preprocessor"></span><span class="keyword">typedef</span> PSID <a class="code" href="group__apr__user.html#ga0">apr_uid_t</a>;
00044 <span class="preprocessor">#else</span>
<a name="l00045"></a><a class="code" href="group__apr__user.html#ga0">00045</a> <span class="preprocessor"></span><span class="keyword">typedef</span> uid_t <a class="code" href="group__apr__user.html#ga0">apr_uid_t</a>;
00046 <span class="preprocessor">#endif</span>
00047 <span class="preprocessor"></span><span class="comment"></span>
00048 <span class="comment">/**</span>
00049 <span class="comment"> * Structure for determining group ownership.</span>
00050 <span class="comment"> */</span>
00051 <span class="preprocessor">#ifdef WIN32</span>
00052 <span class="preprocessor"></span><span class="keyword">typedef</span> PSID <a class="code" href="group__apr__user.html#ga1">apr_gid_t</a>;
00053 <span class="preprocessor">#else</span>
<a name="l00054"></a><a class="code" href="group__apr__user.html#ga1">00054</a> <span class="preprocessor"></span><span class="keyword">typedef</span> gid_t <a class="code" href="group__apr__user.html#ga1">apr_gid_t</a>;
00055 <span class="preprocessor">#endif</span>
00056 <span class="preprocessor"></span>
00057 <span class="preprocessor">#if APR_HAS_USER </span>
00058 <span class="preprocessor"></span><span class="comment"></span>
00059 <span class="comment">/**</span>
00060 <span class="comment"> * Get the userid (and groupid) of the calling process</span>
00061 <span class="comment"> * @param userid Returns the user id</span>
00062 <span class="comment"> * @param groupid Returns the user's group id</span>
00063 <span class="comment"> * @param p The pool from which to allocate working space</span>
00064 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00065 <span class="comment"> */</span>
00066 APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
00067 apr_gid_t *groupid,
00068 apr_pool_t *p);
00069 <span class="comment"></span>
00070 <span class="comment">/**</span>
00071 <span class="comment"> * Get the user name for a specified userid</span>
00072 <span class="comment"> * @param username Pointer to new string containing user name (on output)</span>
00073 <span class="comment"> * @param userid The userid</span>
00074 <span class="comment"> * @param p The pool from which to allocate the string</span>
00075 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00076 <span class="comment"> */</span>
00077 APR_DECLARE(apr_status_t) apr_uid_name_get(<span class="keywordtype">char</span> **username, apr_uid_t userid,
00078 apr_pool_t *p);
00079 <span class="comment"></span>
00080 <span class="comment">/**</span>
00081 <span class="comment"> * Get the userid (and groupid) for the specified username</span>
00082 <span class="comment"> * @param userid Returns the user id</span>
00083 <span class="comment"> * @param groupid Returns the user's group id</span>
00084 <span class="comment"> * @param username The username to lookup</span>
00085 <span class="comment"> * @param p The pool from which to allocate working space</span>
00086 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00087 <span class="comment"> */</span>
00088 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
00089 const <span class="keywordtype">char</span> *username, apr_pool_t *p);
00090 <span class="comment"></span>
00091 <span class="comment">/**</span>
00092 <span class="comment"> * Get the home directory for the named user</span>
00093 <span class="comment"> * @param dirname Pointer to new string containing directory name (on output)</span>
00094 <span class="comment"> * @param username The named user</span>
00095 <span class="comment"> * @param p The pool from which to allocate the string</span>
00096 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00097 <span class="comment"> */</span>
00098 APR_DECLARE(apr_status_t) apr_uid_homepath_get(<span class="keywordtype">char</span> **dirname,
00099 const <span class="keywordtype">char</span> *username,
00100 apr_pool_t *p);
00101 <span class="comment"></span>
00102 <span class="comment">/**</span>
00103 <span class="comment"> * Compare two user identifiers for equality.</span>
00104 <span class="comment"> * @param left One uid to test</span>
00105 <span class="comment"> * @param right Another uid to test</span>
00106 <span class="comment"> * @return APR_SUCCESS if the apr_uid_t strutures identify the same user,</span>
00107 <span class="comment"> * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.</span>
00108 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00109 <span class="comment"> */</span>
00110 #if defined(WIN32)
00111 APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
00112 #else
00113 #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00114 #endif
00115 <span class="comment"></span>
00116 <span class="comment">/**</span>
00117 <span class="comment"> * Get the group name for a specified groupid</span>
00118 <span class="comment"> * @param groupname Pointer to new string containing group name (on output)</span>
00119 <span class="comment"> * @param groupid The groupid</span>
00120 <span class="comment"> * @param p The pool from which to allocate the string</span>
00121 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00122 <span class="comment"> */</span>
00123 APR_DECLARE(apr_status_t) apr_gid_name_get(<span class="keywordtype">char</span> **groupname,
00124 apr_gid_t groupid, apr_pool_t *p);
00125 <span class="comment"></span>
00126 <span class="comment">/**</span>
00127 <span class="comment"> * Get the groupid for a specified group name</span>
00128 <span class="comment"> * @param groupid Pointer to the group id (on output)</span>
00129 <span class="comment"> * @param groupname The group name to look up</span>
00130 <span class="comment"> * @param p The pool from which to allocate the string</span>
00131 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00132 <span class="comment"> */</span>
00133 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid,
00134 const <span class="keywordtype">char</span> *groupname, apr_pool_t *p);
00135 <span class="comment"></span>
00136 <span class="comment">/**</span>
00137 <span class="comment"> * Compare two group identifiers for equality.</span>
00138 <span class="comment"> * @param left One gid to test</span>
00139 <span class="comment"> * @param right Another gid to test</span>
00140 <span class="comment"> * @return APR_SUCCESS if the apr_gid_t strutures identify the same group,</span>
00141 <span class="comment"> * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.</span>
00142 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span>
00143 <span class="comment"> */</span>
00144 #if defined(WIN32)
00145 APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
00146 #else
00147 #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00148 #endif
00149
00150 #endif <span class="comment">/* ! APR_HAS_USER */</span>
00151 <span class="comment"></span>
00152 <span class="comment">/** @} */</span>
00153
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif <span class="comment">/* ! APR_USER_H */</span>
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Mon Feb 7 13:18:25 2005 for Apache Portable Runtime by
<a href="../../../www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -