Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-01-20 05:57:54 +0300
committerChristopher Faylor <me@cgf.cx>2003-01-20 05:57:54 +0300
commit7905c4f158c479c3d08e112c55f91be38aa70dae (patch)
tree9fcc54ea43fa128e60ecf3b52373ed25f77b382b /winsup/cygwin/path.h
parent6f2480fbf706f944d20f8db3f17733ee8978987e (diff)
* pwdgrp.h (etc): Move to path.h.
(pwdgrp::max_lines): New field. (pwdgrp::curr_lines): New field. (pwdgrp::pwdgrp_buf): Ditto. (pwdgrp_buf_elem_size): Ditto. (pwdgrp_parse): Ditto. (pwdgrp::gets): Just declare here. (pwdgrp::load): Ditto. Just take one argument. (pwdgrp::load): Define overloaded function accepting passwd buf. (pwdgrp::load): Define overloaded function accepting group buf. * grp.cc: Use pwdgrp elements rather than standalone static variables throughout. (curr_lines): Eliminate. (max_lines): Ditto. (add_grp_line): Ditto. (parse_grp): Define as returning boolean. Accept void * arg and line count. Coerce first argument into __group32 buf reference. Increment curr_line as appropriate. (read_etc_group): Pass pwdgrp buffer to gr.load. * passwd.cc: Use pwdgrp elements rather than standalone static variables throughout. (curr_lines): Eliminate. (max_lines): Ditto. (add_grp_line): Ditto. (parse_passwd): Define as returning boolean. Accept void * arg and line count. Coerce first argument into passwd buf reference. Increment curr_line as appropriate. (read_etc_group): Pass pwdgrp buffer to pr.load. * path.cc (etc::fn): Extend buffer size to allow index by 1 rather than zero. (etc::last_modified): Ditto. (etc::change_possible): Ditto. Renamed from sawchange. Change to signed char since elements are now tri-state. (etc::init): Assume "handle" is 1 based rather than 0. (etc::test_file_change): New function. Sets change_possible based on file date comparison. (etc::dir_changed): Check file states immediately after changed_h is initialized to avoid a race. (etc::file_changed): Use test_file_change to detect if file needs to be updated. * path.h (etc): Move class here from pwdgrp.h. * uinfo.cc: Move etc:: functions to path.cc. Move pwdgrp functions here. (pwdgrp::gets): Eliminate buf checks. Just check eptr and set lptr. (pwdgrp::add_line): New function. (pwdgrp::load): Call generic add_line function which will call correct parser.
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r--winsup/cygwin/path.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 9d8291a59..7fab2044d 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -206,3 +206,20 @@ int pathmatch (const char *path1, const char *path2) __attribute__ ((regparm (2)
int pathnmatch (const char *path1, const char *path2, int len) __attribute__ ((regparm (2)));
int path_prefix_p (const char *path1, const char *path2, int len1) __attribute__ ((regparm (3)));
+
+/* FIXME: Move to own include file eventually */
+
+#define MAX_ETC_FILES 2
+class etc
+{
+ static int curr_ix;
+ static signed char change_possible[MAX_ETC_FILES + 1];
+ static const char *fn[MAX_ETC_FILES + 1];
+ static FILETIME last_modified[MAX_ETC_FILES + 1];
+ static bool dir_changed (int);
+ static int init (int, const char *);
+ static bool file_changed (int);
+ static void set_last_modified (int, FILETIME&);
+ static bool test_file_change (int);
+ friend class pwdgrp;
+};