GME  13
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 
00077 APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
00078                                            apr_pool_t *p);
00079 
00088 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
00089                                       const char *username, apr_pool_t *p);
00090 
00098 APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, 
00099                                                const char *username, 
00100                                                apr_pool_t *p);
00101 
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 
00123 APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, 
00124                                              apr_gid_t groupid, apr_pool_t *p);
00125 
00133 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, 
00134                                       const char *groupname, apr_pool_t *p);
00135 
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  /* ! APR_HAS_USER */
00151 
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157 
00158 #endif  /* ! APR_USER_H */