1/* $NetBSD: lctype.c,v 1.8 2023/04/16 20:46:17 nikita Exp $ */ 2 3/* 4** Id: lctype.c 5** 'ctype' functions for Lua 6** See Copyright Notice in lua.h 7*/ 8 9#define lctype_c 10#define LUA_CORE 11 12#include "lprefix.h" 13 14 15#include "lctype.h" 16 17#if !LUA_USE_CTYPE /* { */ 18 19#ifndef _KERNEL 20#include <limits.h> 21#endif /* _KERNEL */ 22 23 24#if defined (LUA_UCID) /* accept UniCode IDentifiers? */ 25/* consider all non-ascii codepoints to be alphabetic */ 26#define NONA 0x01 27#else 28#define NONA 0x00 /* default */ 29#endif 30 31 32LUAI_DDEF const lu_byte luai_ctype_[UCHAR_MAX + 2] = { 33 0x00, /* EOZ */ 34 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0. */ 35 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 36 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1. */ 37 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* 2. */ 39 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 40 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, /* 3. */ 41 0x16, 0x16, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 42 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 4. */ 43 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 44 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 5. */ 45 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x05, 46 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 6. */ 47 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 48 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 7. */ 49 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 50 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* 8. */ 51 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 52 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* 9. */ 53 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 54 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* a. */ 55 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 56 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* b. */ 57 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 58 0x00, 0x00, NONA, NONA, NONA, NONA, NONA, NONA, /* c. */ 59 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 60 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* d. */ 61 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 62 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* e. */ 63 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 64 NONA, NONA, NONA, NONA, NONA, 0x00, 0x00, 0x00, /* f. */ 65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 66}; 67 68#endif /* } */ 69