/* pwd.h: Password file parsing. */

#ifndef _PWD_H
#define _PWD_H

#include <sys/types.h>

struct passwd
{
    char* pw_name;
    char* pw_passwd;
    uid_t pw_uid;
    gid_t pw_gid;
    char* pw_gecos;
    char* pw_dir;
    char* pw_shell;
};

#ifdef __cplusplus
extern "C"
{
#endif

    /* Read the next entry from the password file. */
    struct passwd* getpwent(void);

    /* Find the entry with a matching username in the password file. */
    struct passwd* getpwnam(const char* name);

    /* Find the entry with a matching user ID in the password file. */
    struct passwd* getpwuid(uid_t uid);

    /* Rewind the password file. */
    void setpwent(void);

    /* End password file parsing. */
    void endpwent(void);

#ifdef __cplusplus
}
#endif

#endif