• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • localization
  • probers
ctype_test_p.h
Go to the documentation of this file.
1/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* -*- C++ -*-
3* Copyright (C) 2008 <wkai@gmail.com>
4*
5*
6* Permission is hereby granted, free of charge, to any person obtaining
7* a copy of this software and associated documentation files (the
8* "Software"), to deal in the Software without restriction, including
9* without limitation the rights to use, copy, modify, merge, publish,
10* distribute, sublicense, and/or sell copies of the Software, and to
11* permit persons to whom the Software is furnished to do so, subject to
12* the following conditions:
13*
14* The above copyright notice and this permission notice shall be included
15* in all copies or substantial portions of the Software.
16*
17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*/
25
26#ifndef CTYPE_TEST_P_H
27#define CTYPE_TEST_P_H
28
29enum {
30 CTYPE_ALNUM = 1 << 0,
31 CTYPE_ALPHA = 1 << 1,
32 CTYPE_CNTRL = 1 << 2,
33 CTYPE_DIGIT = 1 << 3,
34 CTYPE_GRAPH = 1 << 4,
35 CTYPE_LOWER = 1 << 5,
36 CTYPE_PRINT = 1 << 6,
37 CTYPE_PUNCT = 1 << 7,
38 CTYPE_SPACE = 1 << 8,
39 CTYPE_UPPER = 1 << 9,
40 CTYPE_XDIGIT = 1 << 10,
41 CTYPE_NAME = 1 << 11,
42 CTYPE_BINARY = 1 << 12,
43 CTYPE_TEXT = 1 << 13
44};
45
46
47static const short int ctype_data[0x100] = {
48 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, /* 0x00 */
49 0x1004, 0x0104, 0x0104, 0x1004, 0x0104, 0x0104, 0x1004, 0x1004, /* 0x08 */
50 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, /* 0x10 */
51 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, 0x1004, /* 0x18 */
52 0x0140, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, /* 0x20 */
53 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x08d0, 0x08d0, 0x08d0, /* 0x28 */
54 0x0c59, 0x0c59, 0x0c59, 0x0c59, 0x0c59, 0x0c59, 0x0c59, 0x0c59, /* 0x30 */
55 0x0c59, 0x0c59, 0x08d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x00d0, /* 0x38 */
56 0x00d0, 0x2e53, 0x2e53, 0x2e53, 0x2e53, 0x2e53, 0x2e53, 0x2a53, /* 0x40 */
57 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, /* 0x48 */
58 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, 0x2a53, /* 0x50 */
59 0x2a53, 0x2a53, 0x2a53, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x08d0, /* 0x58 */
60 0x00d0, 0x2c73, 0x2c73, 0x2c73, 0x2c73, 0x2c73, 0x2c73, 0x2873, /* 0x60 */
61 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, /* 0x68 */
62 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, 0x2873, /* 0x70 */
63 0x2873, 0x2873, 0x2873, 0x00d0, 0x00d0, 0x00d0, 0x00d0, 0x1004, /* 0x78 */
64 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0x80 */
65 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0x88 */
66 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0x90 */
67 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0x98 */
68 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xa0 */
69 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xa8 */
70 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xb0 */
71 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xb8 */
72 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xc0 */
73 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xc8 */
74 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xd0 */
75 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xd8 */
76 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xe0 */
77 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xe8 */
78 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xf0 */
79 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, /* 0xf8 */
80};
81
82#define ctype_test(c, t) ((ctype_data[(unsigned short)c] & t) != 0)
83
84#define isalnum(c) ctype_test((c), CTYPE_ALNUM)
85#define isalpha(c) ctype_test((c), CTYPE_ALPHA)
86#define iscntrl(c) ctype_test((c), CTYPE_CNTRL)
87#define isdigit(c) ctype_test((c), CTYPE_DIGIT)
88#define isgraph(c) ctype_test((c), CTYPE_GRAPH)
89#define islower(c) ctype_test((c), CTYPE_LOWER)
90#define isprint(c) ctype_test((c), CTYPE_PRINT)
91#define ispunct(c) ctype_test((c), CTYPE_PUNCT)
92#define isspace(c) ctype_test((c), CTYPE_SPACE)
93#define isupper(c) ctype_test((c), CTYPE_UPPER)
94#define isxdigit(c) ctype_test((c), CTYPE_XDIGIT)
95#define isname(c) ctype_test((c), CTYPE_NAME)
96#define isbinary(c) ctype_test((c), CTYPE_BINARY)
97#define istext(c) ctype_test((c), CTYPE_TEXT)
98
99#endif
ctype_data
static const short int ctype_data[0x100]
Definition: ctype_test_p.h:47
CTYPE_SPACE
@ CTYPE_SPACE
Definition: ctype_test_p.h:38
CTYPE_PUNCT
@ CTYPE_PUNCT
Definition: ctype_test_p.h:37
CTYPE_NAME
@ CTYPE_NAME
Definition: ctype_test_p.h:41
CTYPE_PRINT
@ CTYPE_PRINT
Definition: ctype_test_p.h:36
CTYPE_TEXT
@ CTYPE_TEXT
Definition: ctype_test_p.h:43
CTYPE_GRAPH
@ CTYPE_GRAPH
Definition: ctype_test_p.h:34
CTYPE_UPPER
@ CTYPE_UPPER
Definition: ctype_test_p.h:39
CTYPE_DIGIT
@ CTYPE_DIGIT
Definition: ctype_test_p.h:33
CTYPE_ALPHA
@ CTYPE_ALPHA
Definition: ctype_test_p.h:31
CTYPE_LOWER
@ CTYPE_LOWER
Definition: ctype_test_p.h:35
CTYPE_BINARY
@ CTYPE_BINARY
Definition: ctype_test_p.h:42
CTYPE_XDIGIT
@ CTYPE_XDIGIT
Definition: ctype_test_p.h:40
CTYPE_ALNUM
@ CTYPE_ALNUM
Definition: ctype_test_p.h:30
CTYPE_CNTRL
@ CTYPE_CNTRL
Definition: ctype_test_p.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal