summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/strtofflags.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-01-27 21:17:01 +0000
committerjoe <joe@FreeBSD.org>2000-01-27 21:17:01 +0000
commitf1a9497df5db81a71987fa20f10c831030987e36 (patch)
treebcca8d67d721cd7e4ca8e7322d19df89912cfd26 /lib/libc/gen/strtofflags.c
parent30f3b614b3b18d86be7ff164b9aba2617637b9c6 (diff)
downloadFreeBSD-src-f1a9497df5db81a71987fa20f10c831030987e36.zip
FreeBSD-src-f1a9497df5db81a71987fa20f10c831030987e36.tar.gz
Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and string_to_flags, which co-existed with 'ls'. As time has progressed more and more other tools have used these private functions to manipulate the file flags. Recently I moved these functions from /usr/src/bin/ls to libutil, but after some discussion with bde it's been decided that they really ought to go in libc. There are two already existing libc functions for manipulating file modes: setmode and getmode. In keeping with these flags_to_string has been renamed getflags and string_to_flags to setflags. The manual page could probably be improved upon ;)
Diffstat (limited to 'lib/libc/gen/strtofflags.c')
-rw-r--r--lib/libc/gen/strtofflags.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c
index 1bf5820..7ad25c2 100644
--- a/lib/libc/gen/strtofflags.c
+++ b/lib/libc/gen/strtofflags.c
@@ -69,12 +69,12 @@ static struct {
#define nmappings (sizeof(mapping) / sizeof(mapping[0]))
/*
- * flags_to_string --
+ * getflags --
* Convert stat flags to a comma-separated string. If no flags
* are set, return the default string.
*/
char *
-flags_to_string(flags, def)
+getflags(flags, def)
u_long flags;
char *def;
{
@@ -99,13 +99,13 @@ flags_to_string(flags, def)
}
/*
- * string_to_flags --
+ * setflags --
* Take string of arguments and return stat flags. Return 0 on
* success, 1 on failure. On failure, stringp is set to point
* to the offending token.
*/
int
-string_to_flags(stringp, setp, clrp)
+setflags(stringp, setp, clrp)
char **stringp;
u_long *setp, *clrp;
{
OpenPOWER on IntegriCloud