getgrent.c File Reference

#include <sys/types.h>
#include <grp.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

Include dependency graph for getgrent.c:

Go to the source code of this file.

Defines

#define nil   0
#define open   _open
#define fcntl   _fcntl
#define read   _read
#define close   _close
#define arraysize(a)   (sizeof(a) / sizeof((a)[0]))
#define arraylimit(a)   ((a) + arraysize(a))

Functions

void endgrent (void)
int setgrent (void)
void setgrfile (const char *file)
static int getline (void)
static char * scan_punct (int punct)
groupgetgrent (void)
groupgetgrgid (_mnx_Gid_t gid)
groupgetgrnam (const char *name)

Variables

static char GROUP [] = "/etc/group"
static const char * grfile
static char buf [1024]
static char grline [512]
static struct group entry
static char * members [64]
static int grfd = -1
static char * bufptr
static ssize_t buflen = 0
static char * lineptr


Define Documentation

#define arraylimit a   )     ((a) + arraysize(a))
 

Definition at line 19 of file getgrent.c.

#define arraysize a   )     (sizeof(a) / sizeof((a)[0]))
 

Definition at line 18 of file getgrent.c.

#define close   _close
 

Definition at line 10 of file getgrent.c.

#define fcntl   _fcntl
 

Definition at line 8 of file getgrent.c.

Referenced by _tcp_connect(), boot_readwrite(), close_on_exec(), closeExec(), copyfd(), do_check(), dup(), dup2(), fill_iftab(), flock(), get_ipconf(), getch(), getifaddrs(), lock_dev(), locked(), main(), opendir(), openpool(), opentrace(), preadbuffer(), run(), run_job(), set(), setgrent(), setinputfd(), setpwent(), setttyent(), shellescape(), startup(), terminate(), test19d(), test19g(), test20d(), test24a(), test29a(), test7c(), test7i(), and test8a().

#define nil   0
 

Definition at line 6 of file getgrent.c.

#define open   _open
 

Definition at line 7 of file getgrent.c.

#define read   _read
 

Definition at line 9 of file getgrent.c.


Function Documentation

void endgrent void   ) 
 

Definition at line 33 of file getgrent.c.

References buflen, close, and grfd.

Referenced by getgrgid(), getgrnam(), grp_add(), initgroups(), setgrent(), and setgrfile().

struct group* getgrent void   ) 
 

Definition at line 99 of file getgrent.c.

References arraylimit, entry, getline(), grfd, lineptr, mem, members, nil, p, scan_punct(), setgrent(), and strtol().

Referenced by getgrgid(), getgrnam(), and initgroups().

struct group* getgrgid _mnx_Gid_t  gid  ) 
 

Definition at line 130 of file getgrent.c.

References endgrent(), getgrent(), group::gr_gid, and nil.

Referenced by check(), idname(), main(), make_header(), and name_gid().

struct group* getgrnam const char *  name  ) 
 

Definition at line 141 of file getgrent.c.

References endgrent(), getgrent(), group::gr_name, nil, and strcmp.

Referenced by do_chown(), gid_name(), grp_add(), main(), and simple().

static int getline void   )  [static]
 

Definition at line 62 of file getgrent.c.

References arraylimit, buflen, bufptr, grfd, grline, lineptr, and read.

static char* scan_punct int  punct  )  [static]
 

Definition at line 82 of file getgrent.c.

References lineptr, and nil.

Referenced by getgrent().

int setgrent void   ) 
 

Definition at line 43 of file getgrent.c.

References endgrent(), F_GETFD, F_SETFD, fcntl, FD_CLOEXEC, grfd, grfile, GROUP, nil, O_RDONLY, and open.

Referenced by getgrent(), and initgroups().

void setgrfile const char *  file  ) 
 

Definition at line 55 of file getgrent.c.

References endgrent(), and grfile.


Variable Documentation

char buf[1024] [static]
 

Definition at line 24 of file getgrent.c.

ssize_t buflen = 0 [static]
 

Definition at line 30 of file getgrent.c.

char* bufptr [static]
 

Definition at line 29 of file getgrent.c.

Referenced by getline(), and strings().

struct group entry [static]
 

Definition at line 26 of file getgrent.c.

int grfd = -1 [static]
 

Definition at line 28 of file getgrent.c.

Referenced by endgrent(), getgrent(), getline(), and setgrent().

const char* grfile [static]
 

Definition at line 22 of file getgrent.c.

Referenced by setgrent(), and setgrfile().

char grline[512] [static]
 

Definition at line 25 of file getgrent.c.

Referenced by getline().

char GROUP[] = "/etc/group" [static]
 

Definition at line 21 of file getgrent.c.

char* lineptr [static]
 

Definition at line 31 of file getgrent.c.

Referenced by getgrent(), getline(), getpwent(), scan_colon(), scan_punct(), scan_quoted(), and scan_white().

char* members[64] [static]
 

Definition at line 27 of file getgrent.c.

Referenced by getgrent().


Generated on Fri Apr 14 23:17:30 2006 for minix by  doxygen 1.4.6