summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/_ctype.h15
-rw-r--r--include/ctype.h15
-rw-r--r--lib/libc/locale/isctype.c65
3 files changed, 78 insertions, 17 deletions
diff --git a/include/_ctype.h b/include/_ctype.h
index 33e294c..af15c3a 100644
--- a/include/_ctype.h
+++ b/include/_ctype.h
@@ -39,6 +39,7 @@
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
+ * $FreeBSD$
*/
#ifndef _CTYPE_H_
@@ -81,10 +82,16 @@ int tolower __P((int));
int toupper __P((int));
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+int digittoint __P((int));
int isascii __P((int));
int isblank __P((int));
+int ishexnumber __P((int));
+int isideogram __P((int));
+int isnumber __P((int));
+int isphonogram __P((int));
+int isrune __P((int));
+int isspecial __P((int));
int toascii __P((int));
-int digittoint __P((int));
#endif
__END_DECLS
@@ -105,18 +112,16 @@ __END_DECLS
#define toupper(c) __toupper(c)
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+#define digittoint(c) __maskrune((c), 0xFF)
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
-#define toascii(c) ((c) & 0x7F)
-#define digittoint(c) __maskrune((c), 0xFF)
-
-/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
#define isphonogram(c) __istype((c), _Q)
#define isrune(c) __istype((c), 0xFFFFFF00L)
#define isspecial(c) __istype((c), _T)
+#define toascii(c) ((c) & 0x7F)
#endif
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
diff --git a/include/ctype.h b/include/ctype.h
index 33e294c..af15c3a 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -39,6 +39,7 @@
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
+ * $FreeBSD$
*/
#ifndef _CTYPE_H_
@@ -81,10 +82,16 @@ int tolower __P((int));
int toupper __P((int));
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+int digittoint __P((int));
int isascii __P((int));
int isblank __P((int));
+int ishexnumber __P((int));
+int isideogram __P((int));
+int isnumber __P((int));
+int isphonogram __P((int));
+int isrune __P((int));
+int isspecial __P((int));
int toascii __P((int));
-int digittoint __P((int));
#endif
__END_DECLS
@@ -105,18 +112,16 @@ __END_DECLS
#define toupper(c) __toupper(c)
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+#define digittoint(c) __maskrune((c), 0xFF)
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
-#define toascii(c) ((c) & 0x7F)
-#define digittoint(c) __maskrune((c), 0xFF)
-
-/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
#define isphonogram(c) __istype((c), _Q)
#define isrune(c) __istype((c), 0xFFFFFF00L)
#define isspecial(c) __istype((c), _T)
+#define toascii(c) ((c) & 0x7F)
#endif
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
diff --git a/lib/libc/locale/isctype.c b/lib/libc/locale/isctype.c
index 4d51813..70bcfd4 100644
--- a/lib/libc/locale/isctype.c
+++ b/lib/libc/locale/isctype.c
@@ -37,6 +37,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -45,6 +47,14 @@ static char sccsid[] = "@(#)isctype.c 8.3 (Berkeley) 2/24/94";
#include <ctype.h>
+#undef digittoint
+int
+digittoint(c)
+ int c;
+{
+ return (__maskrune((c), 0xFF));
+}
+
#undef isalnum
int
isalnum(c)
@@ -101,6 +111,22 @@ isgraph(c)
return (__istype((c), _G));
}
+#undef ishexnumber
+int
+ishexnumber(c)
+ int c;
+{
+ return (__istype((c), _X));
+}
+
+#undef isideogram
+int
+isideogram(c)
+ int c;
+{
+ return (__istype((c), _I));
+}
+
#undef islower
int
islower(c)
@@ -109,6 +135,22 @@ islower(c)
return (__istype((c), _L));
}
+#undef isnumber
+int
+isnumber(c)
+ int c;
+{
+ return (__istype((c), _D));
+}
+
+#undef isphonogram
+int
+isphonogram(c)
+ int c;
+{
+ return (__istype((c), _Q));
+}
+
#undef isprint
int
isprint(c)
@@ -125,6 +167,14 @@ ispunct(c)
return (__istype((c), _P));
}
+#undef isrune
+int
+isrune(c)
+ int c;
+{
+ return (__istype((c), 0xFFFFFF00L));
+}
+
#undef isspace
int
isspace(c)
@@ -133,6 +183,14 @@ isspace(c)
return (__istype((c), _S));
}
+#undef isspecial
+int
+isspecial(c)
+ int c;
+{
+ return (__istype((c), _T));
+}
+
#undef isupper
int
isupper(c)
@@ -173,10 +231,3 @@ toupper(c)
return (__toupper(c));
}
-#undef digittoint
-int
-digittoint(c)
- int c;
-{
- return (__maskrune((c), 0xFF));
-}
OpenPOWER on IntegriCloud