1
{ Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
19
* @brief APR User ID Services
23
#include "apr_errno.h"
24
#include "apr_pools.h"}
27
* @defgroup apr_user User and Group ID Services
32
* Structure for determining user ownership.
41
Papr_uid_t = ^apr_uid_t;
44
* Structure for determining group ownership.
52
Papr_gid_t = ^apr_gid_t;
54
{$define APR_HAS_USER}
59
* Get the userid (and groupid) of the calling process
60
* @param userid Returns the user id
61
* @param groupid Returns the user's group id
62
* @param p The pool from which to allocate working space
63
* @remark This function is available only if APR_HAS_USER is defined.
65
function apr_uid_current(userid: Papr_uid_t; groupid: Papr_gid_t;
66
p: Papr_pool_t): apr_status_t;
67
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
68
external LibAPR name LibNamePrefix + 'apr_uid_current' + LibSuff12;
71
* Get the user name for a specified userid
72
* @param username Pointer to new string containing user name (on output)
73
* @param userid The userid
74
* @param p The pool from which to allocate the string
75
* @remark This function is available only if APR_HAS_USER is defined.
77
function apr_uid_name_get(username: PPChar; userid: apr_uid_t;
78
p: Papr_pool_t): apr_status_t;
79
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
80
external LibAPR name LibNamePrefix + 'apr_uid_name_get' + LibSuff12;
83
* Get the userid (and groupid) for the specified username
84
* @param userid Returns the user id
85
* @param groupid Returns the user's group id
86
* @param username The username to lookup
87
* @param p The pool from which to allocate working space
88
* @remark This function is available only if APR_HAS_USER is defined.
90
function apr_uid_get(userid: Papr_uid_t; groupid: Papr_gid_t;
91
const username: PChar; p: Papr_pool_t): apr_status_t;
92
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
93
external LibAPR name LibNamePrefix + 'apr_uid_get' + LibSuff16;
96
* Get the home directory for the named user
97
* @param dirname Pointer to new string containing directory name (on output)
98
* @param username The named user
99
* @param p The pool from which to allocate the string
100
* @remark This function is available only if APR_HAS_USER is defined.
102
function apr_uid_homepath_get(dirname: PPChar; const username: PChar;
103
p: Papr_pool_t): apr_status_t;
104
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
105
external LibAPR name LibNamePrefix + 'apr_uid_homepath_get' + LibSuff12;
108
* Compare two user identifiers for equality.
109
* @param left One uid to test
110
* @param right Another uid to test
111
* @return APR_SUCCESS if the apr_uid_t strutures identify the same user,
112
* APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
113
* @remark This function is available only if APR_HAS_USER is defined.
116
//APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
119
//#define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
123
* Get the group name for a specified groupid
124
* @param groupname Pointer to new string containing group name (on output)
125
* @param groupid The groupid
126
* @param p The pool from which to allocate the string
127
* @remark This function is available only if APR_HAS_USER is defined.
129
function apr_gid_name_get(groupname: PPChar; groupid: apr_gid_t;
130
p: Papr_pool_t): apr_status_t;
131
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
132
external LibAPR name LibNamePrefix + 'apr_gid_name_get' + LibSuff12;
135
* Get the groupid for a specified group name
136
* @param groupid Pointer to the group id (on output)
137
* @param groupname The group name to look up
138
* @param p The pool from which to allocate the string
139
* @remark This function is available only if APR_HAS_USER is defined.
141
function apr_gid_get(groupid: Papr_gid_t; const groupname: PChar;
142
p: Papr_pool_t): apr_status_t;
143
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
144
external LibAPR name LibNamePrefix + 'apr_gid_get' + LibSuff12;
147
* Compare two group identifiers for equality.
148
* @param left One gid to test
149
* @param right Another gid to test
150
* @return APR_SUCCESS if the apr_gid_t strutures identify the same group,
151
* APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
152
* @remark This function is available only if APR_HAS_USER is defined.
155
//APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
157
//#define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
160
{$endif} { ! APR_HAS_USER }