3 Copyright 2001, 2002, 2003 Red Hat inc.
5 Stuff common to pwd and grp handling.
7 This file is part of Cygwin.
9 This software is a copyrighted work licensed under the terms of the
10 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
13 /* These functions are needed to allow searching and walking through
14 the passwd and group lists */
15 extern struct passwd *internal_getpwsid (cygpsid &);
16 extern struct passwd *internal_getpwnam (const char *, bool = FALSE);
17 extern struct passwd *internal_getpwuid (__uid32_t, bool = FALSE);
18 extern struct __group32 *internal_getgrsid (cygpsid &);
19 extern struct __group32 *internal_getgrgid (__gid32_t gid, bool = FALSE);
20 extern struct __group32 *internal_getgrnam (const char *, bool = FALSE);
21 extern struct __group32 *internal_getgrent (int);
22 int internal_getgroups (int, __gid32_t *, cygpsid * = NULL);
28 unsigned pwdgrp_buf_elem_size;
32 __group32 **group_buf;
35 void (pwdgrp::*read) ();
36 bool (pwdgrp::*parse) ();
49 char *add_line (char *);
50 char *raw_ptr () const {return lptr;}
51 char *next_str (char);
52 bool next_num (unsigned long&);
53 bool next_num (unsigned int& i)
56 bool res = next_num (x);
60 inline bool next_num (int& i)
63 bool res = next_num (x);
71 void load (const wchar_t *);
72 inline void refresh (bool check)
74 if (!check && initialized)
76 if (pglock.acquire () == 1 &&
77 (!initialized || (check && etc::file_changed (etc_ix))))
82 pwdgrp (passwd *&pbuf);
83 pwdgrp (__group32 *&gbuf);