summaryrefslogtreecommitdiff
path: root/src/ctype/isascii.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctype/isascii.c')
-rw-r--r--src/ctype/isascii.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ctype/isascii.c b/src/ctype/isascii.c
new file mode 100644
index 00000000..30fc5a1f
--- /dev/null
+++ b/src/ctype/isascii.c
@@ -0,0 +1,26 @@
+#include <ctype.h>
+
+/** test whether a character is in the ASCII range **/
+int isascii(int c)
+{
+ if (0 <= c && c <= 0177) {
+ return 1;
+ }
+ return 0;
+}
+
+/***
+The fn(isascii) function tests whether arg(c) is a 7-bit US-ASCII character.
+***/
+
+/* RETURN(NZ): arg(c) is between 0 and octal 0177 inclusive */
+/* RETURN(0): arg(c) is outside of the ASCII range */
+
+/* UNDEFINED: - */
+/* UNSPECIFIED: - */
+/* IMPLEMENTATION: - */
+/* LOCALE: - */
+
+/*
+XOPEN(4)
+*/