Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

apr_user.h

Go to the documentation of this file.
00001 /* Copyright 2000-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef APR_USER_H
00017 #define APR_USER_H
00018 
00024 #include "apr.h"
00025 #include "apr_errno.h"
00026 #include "apr_pools.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif /* __cplusplus */
00031 
00041 #ifdef WIN32
00042 typedef PSID                      apr_uid_t;
00043 #else
00044 typedef uid_t                     apr_uid_t;
00045 #endif
00046 
00050 #ifdef WIN32
00051 typedef PSID                      apr_gid_t;
00052 #else
00053 typedef gid_t                     apr_gid_t;
00054 #endif
00055 
00056 #if APR_HAS_USER 
00057 
00065 APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
00066                                           apr_gid_t *groupid,
00067                                           apr_pool_t *p);
00068 
00070 APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid,
00071                                              apr_gid_t *groupid,
00072                                              apr_pool_t *p);
00080 APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
00081                                            apr_pool_t *p);
00082 
00084 APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid,
00085                                            apr_pool_t *p);
00094 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
00095                                       const char *username, apr_pool_t *p);
00096 
00098 APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid,
00099                                          const char *username, apr_pool_t *p);
00100 
00108 APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, 
00109                                                const char *username, 
00110                                                apr_pool_t *p);
00111 
00113 APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, 
00114                                                  const char *username, 
00115                                                  apr_pool_t *p);
00116 
00125 #if defined(WIN32)
00126 APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
00127 
00129 APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right);
00130 #else
00131 #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00132 
00133 #define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00134 #endif
00135 
00143 APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, 
00144                                              apr_gid_t groupid, apr_pool_t *p);
00145 
00147 APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, 
00148                                              apr_gid_t groupid, apr_pool_t *p);
00149 
00151 APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, 
00152                                             apr_gid_t groupid, apr_pool_t *p);
00153 
00161 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, 
00162                                       const char *groupname, apr_pool_t *p);
00163 
00165 APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, 
00166                                           const char *groupname, apr_pool_t *p);
00167 
00176 #if defined(WIN32)
00177 APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
00179 APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right);
00180 #else
00181 #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00182 
00183 #define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00184 #endif
00185 
00186 #endif  /* ! APR_HAS_USER */
00187 
00190 #ifdef __cplusplus
00191 }
00192 #endif
00193 
00194 #endif  /* ! APR_USER_H */

Generated on Fri Sep 17 11:18:21 2004 for Apache Portable Runtime by doxygen 1.3.5