From 829b089c80895d9a78938c5bc7747aea1cd48eb6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 24 Jan 2015 21:35:03 -0800 Subject: Removed implementation-specific material from repository. The C and JS implementations are being split off into different repositories. This repository will just have the spec itself. --- src/cmark_ctype.c | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 src/cmark_ctype.c (limited to 'src/cmark_ctype.c') diff --git a/src/cmark_ctype.c b/src/cmark_ctype.c deleted file mode 100644 index 5de8199..0000000 --- a/src/cmark_ctype.c +++ /dev/null @@ -1,53 +0,0 @@ -#include - -#include "cmark_ctype.h" - -/** 1 = space, 2 = punct, 3 = digit, 4 = alpha, 0 = other - */ -static const int8_t cmark_ctype_class[256] = { - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, - /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 2 */ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - /* 3 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, - /* 4 */ 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - /* 5 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, - /* 6 */ 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - /* 7 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0, - /* 8 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* a */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* b */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* c */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* d */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* e */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/** - * Returns 1 if c is a "whitespace" character as defined by the spec. - */ -int cmark_isspace(char c) -{ - return cmark_ctype_class[(int8_t)c] == 1; -} - -/** - * Returns 1 if c is an ascii punctuation character. - */ -int cmark_ispunct(char c) -{ - return cmark_ctype_class[(int8_t)c] == 2; -} - -int cmark_isalnum(char c) -{ - int8_t result; - result = cmark_ctype_class[(int8_t)c]; - return (result == 3 || result == 4); -} - -int cmark_isdigit(char c) -{ - return cmark_ctype_class[(int8_t)c] == 3; -} -- cgit v1.2.3