<!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.9.1 --> <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> <div class="nav"> <a class="el" href="dir_000000.html">home</a> / <a class="el" href="dir_000001.html">oden</a> / <a class="el" href="dir_000002.html">RPM</a> / <a class="el" href="dir_000003.html">BUILD</a> / <a class="el" href="dir_000004.html">apr-1.1.1</a> / <a class="el" href="dir_000005.html">include</a></div> <h1>apr_user.h</h1><a href="apr__user_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* Copyright 2000-2004 The Apache Software Foundation</span> 00002 <span class="comment"> *</span> 00003 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span> 00004 <span class="comment"> * you may not use this file except in compliance with the License.</span> 00005 <span class="comment"> * You may obtain a copy of the License at</span> 00006 <span class="comment"> *</span> 00007 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> 00008 <span class="comment"> *</span> 00009 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> 00010 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> 00011 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> 00012 <span class="comment"> * See the License for the specific language governing permissions and</span> 00013 <span class="comment"> * limitations under the License.</span> 00014 <span class="comment"> */</span> 00015 00016 <span class="preprocessor">#ifndef APR_USER_H</span> 00017 <span class="preprocessor"></span><span class="preprocessor">#define APR_USER_H</span> 00018 <span class="preprocessor"></span><span class="comment"></span> 00019 <span class="comment">/**</span> 00020 <span class="comment"> * @file apr_user.h</span> 00021 <span class="comment"> * @brief APR User ID Services </span> 00022 <span class="comment"> */</span> 00023 00024 <span class="preprocessor">#include "<a class="code" href="apr_8h.html">apr.h</a>"</span> 00025 <span class="preprocessor">#include "<a class="code" href="apr__errno_8h.html">apr_errno.h</a>"</span> 00026 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html">apr_pools.h</a>"</span> 00027 00028 <span class="preprocessor">#ifdef __cplusplus</span> 00029 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { 00030 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> 00031 <span class="comment"></span> 00032 <span class="comment">/**</span> 00033 <span class="comment"> * @defgroup apr_user User and Group ID Services</span> 00034 <span class="comment"> * @ingroup APR </span> 00035 <span class="comment"> * @{</span> 00036 <span class="comment"> */</span> 00037 <span class="comment"></span> 00038 <span class="comment">/**</span> 00039 <span class="comment"> * Structure for determining user ownership.</span> 00040 <span class="comment"> */</span> 00041 <span class="preprocessor">#ifdef WIN32</span> 00042 <span class="preprocessor"></span><span class="keyword">typedef</span> PSID apr_uid_t; 00043 <span class="preprocessor">#else</span> <a name="l00044"></a><a class="code" href="group__apr__user.html#ga0">00044</a> <span class="preprocessor"></span><span class="keyword">typedef</span> uid_t apr_uid_t; 00045 <span class="preprocessor">#endif</span> 00046 <span class="preprocessor"></span><span class="comment"></span> 00047 <span class="comment">/**</span> 00048 <span class="comment"> * Structure for determining group ownership.</span> 00049 <span class="comment"> */</span> 00050 <span class="preprocessor">#ifdef WIN32</span> 00051 <span class="preprocessor"></span><span class="keyword">typedef</span> PSID apr_gid_t; 00052 <span class="preprocessor">#else</span> <a name="l00053"></a><a class="code" href="group__apr__user.html#ga1">00053</a> <span class="preprocessor"></span><span class="keyword">typedef</span> gid_t apr_gid_t; 00054 <span class="preprocessor">#endif</span> 00055 <span class="preprocessor"></span> 00056 <span class="preprocessor">#if APR_HAS_USER </span> 00057 <span class="preprocessor"></span><span class="comment"></span> 00058 <span class="comment">/**</span> 00059 <span class="comment"> * Get the userid (and groupid) of the calling process</span> 00060 <span class="comment"> * @param userid Returns the user id</span> 00061 <span class="comment"> * @param groupid Returns the user's group id</span> 00062 <span class="comment"> * @param p The pool from which to allocate working space</span> 00063 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00064 <span class="comment"> */</span> 00065 <a class="code" href="group__apr__platform.html#ga123">APR_DECLARE</a>(apr_status_t) apr_uid_current(apr_uid_t *userid, 00066 apr_gid_t *groupid, 00067 apr_pool_t *p); 00068 <span class="comment"></span> 00069 <span class="comment">/**</span> 00070 <span class="comment"> * Get the user name for a specified userid</span> 00071 <span class="comment"> * @param username Pointer to new string containing user name (on output)</span> 00072 <span class="comment"> * @param userid The userid</span> 00073 <span class="comment"> * @param p The pool from which to allocate the string</span> 00074 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00075 <span class="comment"> */</span> 00076 APR_DECLARE(apr_status_t) apr_uid_name_get(<span class="keywordtype">char</span> **username, apr_uid_t userid, 00077 apr_pool_t *p); 00078 <span class="comment"></span> 00079 <span class="comment">/**</span> 00080 <span class="comment"> * Get the userid (and groupid) for the specified username</span> 00081 <span class="comment"> * @param userid Returns the user id</span> 00082 <span class="comment"> * @param groupid Returns the user's group id</span> 00083 <span class="comment"> * @param username The username to lookup</span> 00084 <span class="comment"> * @param p The pool from which to allocate working space</span> 00085 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00086 <span class="comment"> */</span> 00087 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, 00088 const <span class="keywordtype">char</span> *username, apr_pool_t *p); 00089 <span class="comment"></span> 00090 <span class="comment">/**</span> 00091 <span class="comment"> * Get the home directory for the named user</span> 00092 <span class="comment"> * @param dirname Pointer to new string containing directory name (on output)</span> 00093 <span class="comment"> * @param username The named user</span> 00094 <span class="comment"> * @param p The pool from which to allocate the string</span> 00095 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00096 <span class="comment"> */</span> 00097 APR_DECLARE(apr_status_t) apr_uid_homepath_get(<span class="keywordtype">char</span> **dirname, 00098 const <span class="keywordtype">char</span> *username, 00099 apr_pool_t *p); 00100 <span class="comment"></span> 00101 <span class="comment">/**</span> 00102 <span class="comment"> * Compare two user identifiers for equality.</span> 00103 <span class="comment"> * @param left One uid to test</span> 00104 <span class="comment"> * @param right Another uid to test</span> 00105 <span class="comment"> * @return APR_SUCCESS if the apr_uid_t strutures identify the same user,</span> 00106 <span class="comment"> * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.</span> 00107 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00108 <span class="comment"> */</span> 00109 #if defined(WIN32) 00110 APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); 00111 #else <a name="l00112"></a><a class="code" href="group__apr__user.html#ga8">00112</a> #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) 00113 #endif 00114 <span class="comment"></span> 00115 <span class="comment">/**</span> 00116 <span class="comment"> * Get the group name for a specified groupid</span> 00117 <span class="comment"> * @param groupname Pointer to new string containing group name (on output)</span> 00118 <span class="comment"> * @param groupid The groupid</span> 00119 <span class="comment"> * @param p The pool from which to allocate the string</span> 00120 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00121 <span class="comment"> */</span> 00122 APR_DECLARE(apr_status_t) apr_gid_name_get(<span class="keywordtype">char</span> **groupname, 00123 apr_gid_t groupid, apr_pool_t *p); 00124 <span class="comment"></span> 00125 <span class="comment">/**</span> 00126 <span class="comment"> * Get the groupid for a specified group name</span> 00127 <span class="comment"> * @param groupid Pointer to the group id (on output)</span> 00128 <span class="comment"> * @param groupname The group name to look up</span> 00129 <span class="comment"> * @param p The pool from which to allocate the string</span> 00130 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00131 <span class="comment"> */</span> 00132 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, 00133 const <span class="keywordtype">char</span> *groupname, apr_pool_t *p); 00134 <span class="comment"></span> 00135 <span class="comment">/**</span> 00136 <span class="comment"> * Compare two group identifiers for equality.</span> 00137 <span class="comment"> * @param left One gid to test</span> 00138 <span class="comment"> * @param right Another gid to test</span> 00139 <span class="comment"> * @return APR_SUCCESS if the apr_gid_t strutures identify the same group,</span> 00140 <span class="comment"> * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.</span> 00141 <span class="comment"> * @remark This function is available only if APR_HAS_USER is defined.</span> 00142 <span class="comment"> */</span> 00143 #if defined(WIN32) 00144 APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right); 00145 #else <a name="l00146"></a><a class="code" href="group__apr__user.html#ga9">00146</a> #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) 00147 #endif 00148 00149 #endif <span class="comment">/* ! APR_HAS_USER */</span> 00150 <span class="comment"></span> 00151 <span class="comment">/** @} */</span> 00152 00153 #ifdef __cplusplus 00154 } 00155 #endif 00156 00157 #endif <span class="comment">/* ! APR_USER_H */</span> </pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Mar 20 19:52:26 2005 for Apache Portable Runtime by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> </body> </html>