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-26 08:38:38 +0300
committerChristopher Faylor <me@cgf.cx>2003-01-26 08:38:38 +0300
commit6503705696e9e778fb51b1be354bc879f18ba61c (patch)
treebac2a0b68cb962abf7424d905276e27353624508 /winsup/cygwin/pwdgrp.h
parentc9b99d0d2a61c0307c25ce16e41f80b2e67d8806 (diff)
* include/sys/strace.h (paranoid_printf): Define as not being part of "all"
output. * pwdgrp.h (pwdgrp::next_num): Rename from next_int. Returns true/false if parse operation succeeded. (pwdgrp::reparse): Remove. (pwdgrp::raw_ptr): New function. Returns pointer in line. (pwdgrp::next_num): New functions for parsing other than unsigned long. * grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior. Don't fill in fields with NULL and assign empty gr_mem to known pointer rather than doing a pointless calloc. Streamline gr_mem parsing. Don't increment curr_lines here. * passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num. Don't increment curr_lines here. * uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data. (pwdgrp::reparse): Remove. (pwdgrp::next_num): Rename from next_int. Return bool indicating success of parse, argument returns value parsed. (pwdgrp::add_line): Increment curr_lines here on successful parse. (pwdgrp::load): (from Pierre Humblet) Don't return status. Just report it here.
Diffstat (limited to 'winsup/cygwin/pwdgrp.h')
-rw-r--r--winsup/cygwin/pwdgrp.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h
index aa7ab38c6..a5fdc1953 100644
--- a/winsup/cygwin/pwdgrp.h
+++ b/winsup/cygwin/pwdgrp.h
@@ -45,14 +45,28 @@ class pwdgrp
void read_passwd ();
void read_group ();
char *add_line (char *);
+ char *raw_ptr () const {return lptr;}
char *next_str (char = 0);
- int next_int (char = 0);
- void reparse (char *);
+ bool next_num (unsigned long&);
+ bool next_num (unsigned int& i)
+ {
+ unsigned long x;
+ bool res = next_num (x);
+ i = (unsigned int) x;
+ return res;
+ }
+ bool next_num (int& i)
+ {
+ unsigned long x;
+ bool res = next_num (x);
+ i = (int) x;
+ return res;
+ }
public:
int curr_lines;
- bool load (const char *);
+ void load (const char *);
void refresh (bool check = true)
{
if (!check && initialized)