apr_user.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef APR_USER_H
00018 #define APR_USER_H
00019 
00025 #include "apr.h"
00026 #include "apr_errno.h"
00027 #include "apr_pools.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif /* __cplusplus */
00032 
00042 #ifdef WIN32
00043 typedef PSID                      apr_uid_t;
00044 #else
00045 typedef uid_t                     apr_uid_t;
00046 #endif
00047 
00051 #ifdef WIN32
00052 typedef PSID                      apr_gid_t;
00053 #else
00054 typedef gid_t                     apr_gid_t;
00055 #endif
00056 
00057 #if APR_HAS_USER 
00058 
00066 APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
00067                                           apr_gid_t *groupid,
00068                                           apr_pool_t *p);
00069 
00071 APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid,
00072                                              apr_gid_t *groupid,
00073                                              apr_pool_t *p);
00081 APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
00082                                            apr_pool_t *p);
00083 
00085 APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid,
00086                                            apr_pool_t *p);
00095 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
00096                                       const char *username, apr_pool_t *p);
00097 
00099 APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid,
00100                                          const char *username, apr_pool_t *p);
00101 
00109 APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, 
00110                                                const char *username, 
00111                                                apr_pool_t *p);
00112 
00114 APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, 
00115                                                  const char *username, 
00116                                                  apr_pool_t *p);
00117 
00126 #if defined(WIN32)
00127 APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
00128 
00130 APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right);
00131 #else
00132 #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00133 
00134 #define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00135 #endif
00136 
00144 APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, 
00145                                              apr_gid_t groupid, apr_pool_t *p);
00146 
00148 APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, 
00149                                              apr_gid_t groupid, apr_pool_t *p);
00150 
00152 APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, 
00153                                             apr_gid_t groupid, apr_pool_t *p);
00154 
00162 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, 
00163                                       const char *groupname, apr_pool_t *p);
00164 
00166 APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, 
00167                                           const char *groupname, apr_pool_t *p);
00168 
00177 #if defined(WIN32)
00178 APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
00180 APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right);
00181 #else
00182 #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00183 
00184 #define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00185 #endif
00186 
00187 #endif  /* ! APR_HAS_USER */
00188 
00191 #ifdef __cplusplus
00192 }
00193 #endif
00194 
00195 #endif  /* ! APR_USER_H */

Generated on Mon Nov 26 11:47:26 2007 for Apache Portable Runtime by  doxygen 1.5.2