summaryrefslogtreecommitdiffstats
path: root/libutil/libutil.h
diff options
context:
space:
mode:
authorSean Farley <scf@FreeBSD.org>2008-04-23 00:49:13 +0000
committerSean Farley <scf@FreeBSD.org>2008-04-23 00:49:13 +0000
commit97cc03f4f3328180c8f49cd61c406bb7bc8a2dcb (patch)
treead0ea3d8e0c37a4fc81d211a9bcd68f4eb950de4 /libutil/libutil.h
parent5fba38d0ad9b28b48e7927838169aca2983c6ae9 (diff)
downloadpw-darwin-97cc03f4f3328180c8f49cd61c406bb7bc8a2dcb.tar.gz
pw-darwin-97cc03f4f3328180c8f49cd61c406bb7bc8a2dcb.zip
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
Diffstat (limited to 'libutil/libutil.h')
-rw-r--r--libutil/libutil.h7
1 files changed, 7 insertions, 0 deletions
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);