2010-11-04 00:46:47 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2002-2010 Haiku Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-10-07 03:47:13 +04:00
|
|
|
#ifndef _PWD_H_
|
|
|
|
#define _PWD_H_
|
2010-11-04 00:46:47 +03:00
|
|
|
|
2002-10-07 03:47:13 +04:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct passwd {
|
|
|
|
char *pw_name;
|
|
|
|
char *pw_passwd;
|
|
|
|
uid_t pw_uid;
|
|
|
|
gid_t pw_gid;
|
|
|
|
char *pw_dir;
|
|
|
|
char *pw_shell;
|
|
|
|
char *pw_gecos;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* traverse the user password database */
|
|
|
|
extern struct passwd *getpwent(void);
|
2008-04-02 18:02:52 +04:00
|
|
|
extern int getpwent_r(struct passwd* pwbuf, char* buf, size_t buflen,
|
|
|
|
struct passwd** pwbufp);
|
2002-10-07 03:47:13 +04:00
|
|
|
extern void setpwent(void);
|
|
|
|
extern void endpwent(void);
|
|
|
|
|
2008-04-02 18:02:52 +04:00
|
|
|
/* search the user password database */
|
2002-10-07 03:47:13 +04:00
|
|
|
extern struct passwd *getpwnam(const char *name);
|
|
|
|
extern int getpwnam_r(const char *name, struct passwd *passwd, char *buffer,
|
|
|
|
size_t bufferSize, struct passwd **result);
|
|
|
|
extern struct passwd *getpwuid(uid_t uid);
|
|
|
|
extern int getpwuid_r(uid_t uid, struct passwd *passwd, char *buffer,
|
|
|
|
size_t bufferSize, struct passwd **result);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _PWD_H_ */
|