Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2017 19:57:02 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326709 - head/stand/libsa
Message-ID:  <201712081957.vB8Jv25m094267@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712081957.vB8Jv25m094267>