Sha256: 3b86cfeaa81c37e05dc24c0799a38fa83b74f698314df5a5084ad6d2b1a0d917

Contents?: true

Size: 1.4 KB

Versions: 38

Compression:

Stored size: 1.4 KB

Contents

/*
** Character types.
** Donated to the public domain.
*/

#ifndef _LJ_CHAR_H
#define _LJ_CHAR_H

#include "lj_def.h"

#define LJ_CHAR_CNTRL	0x01
#define LJ_CHAR_SPACE	0x02
#define LJ_CHAR_PUNCT	0x04
#define LJ_CHAR_DIGIT	0x08
#define LJ_CHAR_XDIGIT	0x10
#define LJ_CHAR_UPPER	0x20
#define LJ_CHAR_LOWER	0x40
#define LJ_CHAR_IDENT	0x80
#define LJ_CHAR_ALPHA	(LJ_CHAR_LOWER|LJ_CHAR_UPPER)
#define LJ_CHAR_ALNUM	(LJ_CHAR_ALPHA|LJ_CHAR_DIGIT)
#define LJ_CHAR_GRAPH	(LJ_CHAR_ALNUM|LJ_CHAR_PUNCT)

/* Only pass -1 or 0..255 to these macros. Never pass a signed char! */
#define lj_char_isa(c, t)	((lj_char_bits+1)[(c)] & t)
#define lj_char_iscntrl(c)	lj_char_isa((c), LJ_CHAR_CNTRL)
#define lj_char_isspace(c)	lj_char_isa((c), LJ_CHAR_SPACE)
#define lj_char_ispunct(c)	lj_char_isa((c), LJ_CHAR_PUNCT)
#define lj_char_isdigit(c)	lj_char_isa((c), LJ_CHAR_DIGIT)
#define lj_char_isxdigit(c)	lj_char_isa((c), LJ_CHAR_XDIGIT)
#define lj_char_isupper(c)	lj_char_isa((c), LJ_CHAR_UPPER)
#define lj_char_islower(c)	lj_char_isa((c), LJ_CHAR_LOWER)
#define lj_char_isident(c)	lj_char_isa((c), LJ_CHAR_IDENT)
#define lj_char_isalpha(c)	lj_char_isa((c), LJ_CHAR_ALPHA)
#define lj_char_isalnum(c)	lj_char_isa((c), LJ_CHAR_ALNUM)
#define lj_char_isgraph(c)	lj_char_isa((c), LJ_CHAR_GRAPH)

#define lj_char_toupper(c)	((c) - (lj_char_islower(c) >> 1))
#define lj_char_tolower(c)	((c) + lj_char_isupper(c))

LJ_DATA const uint8_t lj_char_bits[257];

#endif

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
immunio-2.0.4 lua-hooks/ext/luajit/src/lj_char.h
immunio-2.0.3 lua-hooks/ext/luajit/src/lj_char.h
immunio-2.0.2 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.2.1 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.19 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.18 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.16 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.15 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.13 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.11 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.10 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.7 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.6 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.5 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.2 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.1 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.1.0 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.0.22 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.0.19 lua-hooks/ext/luajit/src/lj_char.h
immunio-1.0.17 lua-hooks/ext/luajit/src/lj_char.h