#ifndef _GRP_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _GRP_H_

struct group {
  char    *gr_name;        /* group name */
  char    *gr_passwd;      /* group password */
  gid_t   gr_gid;          /* group id */
  char    **gr_mem;        /* group members */
};

struct group *getgrnam(const char *name);
       
struct group *getgrgid(gid_t gid);

int getgrnam_r(
  const char     *name,
  struct group   *grp,
  char           *buffer,
  size_t          bufsize,
  struct group  **result
);

int getgrgid_r(
  gid_t           gid,
  struct group   *grp,
  char           *buffer,
  size_t          bufsize,
  struct group  **result
);

#ifdef __cplusplus
}
#endif
#endif /* _GRP_H_ */
