#include <stdlib.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/grpx.h>

/* This API set *grent() is deprecated and the interface is
   for compatibility with legacy code only.
   It was supposed to return entries from the group database
   (etc/group).
   getgrent(): return pointer to group entries
   setgrent(): rewind "pointer", so the next call go getgrent() will 
               return the first entry from database
   endgrent(): close database
   CONFORMING TO SVID 3, BSD 4.3 */

static int database_open=0; /* status of "virtual user database:
                               0=closed, 1=open
                               in fact 0 does only indicate to return the
                               "first" entry in our current implementation */


	extern struct group *	/* return group entries */
getgrent(void)
{
  if (0==database_open) {
     database_open=1;
  }
  else {
  }
  return (struct group*)NULL;	  /* shall we return a value here ?? */
}

	extern void 	/* "rewind pointer to database entries" */
setgrent(void)
{
  database_open=0;
}

	extern void 	  /* "close" database */
endgrent(void)
{
  database_open = 0;
}
