From 97cc03f4f3328180c8f49cd61c406bb7bc8a2dcb Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Wed, 23 Apr 2008 00:49:13 +0000 Subject: Add four utility functions related to struct grp processing modeled in-part after similar calls related to struct pwd in libutil/pw_util.c: - gr_equal() Perform a deep comparison of two struct grp's. It does a thorough, yet unoptimized comparison of all the members regardless of order. - gr_make() Create a string (see group(5)) from a struct grp. - gr_dup() Duplicate a struct grp. Returns a value that is a single contiguous block of memory. - gr_scan() Create a struct grp from a string (as produced by gr_make()). MFC after: 3 weeks --- libutil/libutil.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libutil/libutil.h') diff --git a/libutil/libutil.h b/libutil/libutil.h index aa663a7..8fafe9b 100644 --- a/libutil/libutil.h +++ b/libutil/libutil.h @@ -119,6 +119,13 @@ const char *pw_tempname(void); int pw_tmp(int _mfd); #endif +#ifdef _GRP_H_ +int gr_equal(const struct group *gr1, const struct group *gr2); +char *gr_make(const struct group *gr); +struct group *gr_dup(const struct group *gr); +struct group *gr_scan(const char *line); +#endif + #ifdef _SYS_PARAM_H_ struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); int pidfile_write(struct pidfh *pfh); -- cgit v1.2.3