svn commit: r326709 - head/stand/libsa
Warner Losh
imp at FreeBSD.org
Fri Dec 8 19:57:03 UTC 2017
Author: imp
Date: Fri Dec 8 19:57:02 2017
New Revision: 326709
URL: https://svnweb.freebsd.org/changeset/base/326709
Log:
Provide implementations for iscntrl, ispunct and isgraph.
Sponsored by: Netflix
Modified:
head/stand/libsa/stand.h
Modified: head/stand/libsa/stand.h
==============================================================================
--- head/stand/libsa/stand.h Fri Dec 8 19:56:57 2017 (r326708)
+++ head/stand/libsa/stand.h Fri Dec 8 19:57:02 2017 (r326709)
@@ -235,6 +235,22 @@ static __inline int isalnum(int c)
return isalpha(c) || isdigit(c);
}
+static __inline int iscntrl(int c)
+{
+ return (c >= 0 && c < ' ') || c == 127;
+}
+
+static __inline int isgraph(int c)
+{
+ return c >= '!' && c <= '~';
+}
+
+static __inline int ispunct(int c)
+{
+ return (c >= '!' && c <= '/') || (c >= ':' && c <= '@') ||
+ (c >= '[' && c <= '`') || (c >= '{' && c <= '~');
+}
+
static __inline int toupper(int c)
{
return islower(c) ? c - 'a' + 'A' : c;
More information about the svn-src-all
mailing list