1 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # Filename: package/.../lucid/lucid-0.1_rc2-missing-header.patch
5 # Copyright (C) 2008 The OpenSDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- SDE-COPYRIGHT-NOTE-END ---
17 diff -ruN lucid-0.1_rc2.orig/src/char.h lucid-0.1_rc2/src/char.h
18 --- lucid-0.1_rc2.orig/src/char.h 1970-01-01 02:00:00.000000000 +0200
19 +++ lucid-0.1_rc2/src/char.h 2008-02-01 06:42:23.000000000 +0200
21 +// Copyright (C) 2006-2007 Benedikt Böhm <hollow@gentoo.org>
23 +// This program is free software; you can redistribute it and/or
24 +// modify it under the terms of the GNU General Public License
25 +// as published by the Free Software Foundation; either version 2
26 +// of the License, or (at your option) any later version.
28 +// This program is distributed in the hope that it will be useful,
29 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
30 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 +// GNU General Public License for more details.
33 +// You should have received a copy of the GNU General Public License
34 +// along with this program; if not, write to the Free Software
35 +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
38 + * @defgroup char Character classification and manipulation
40 + * The char family of macros check whether ch, which must have the value of
41 + * an unsigned char, falls into a certain character class.
43 + * char_isalnum() checks for an alphanumeric character; it is equivalent to
44 + * (char_isalpha(ch) || char_isdigit(ch)).
46 + * char_isalpha() checks for an alphabetic character; it is equivalent to
47 + * (char_isupper(c) || char_islower(c)).
49 + * char_isascii() checks whether ch is a 7-bit unsigned char value that fits
50 + * into the ASCII character set.
52 + * char_isblank() checks for a blank character; that is, a space or a tab.
54 + * char_iscntrl() checks for a control character.
56 + * char_isdigit() checks for a digit (0 through 9).
58 + * char_isgraph() checks for any printable character except space.
60 + * char_islower() checks for a lower-case character.
62 + * char_isprint() checks for any printable character including space.
64 + * char_ispunct() checks for any printable character which is not a space or
65 + * an alphanumeric character.
67 + * char_isspace() checks for white-space characters. These are: space,
68 + * form-feed ('\f'), newline ('\n'), carriage return ('\r'),
69 + * horizontal tab ('\t'), and vertical tab ('\v').
71 + * char_isupper() checks for an uppercase letter.
73 + * char_isxdigit() checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7
74 + * 8 9 a b c d e f A B C D E F.
76 + * char_tolower() converts a character to lowercase if applicable.
78 + * char_toupper() converts a character to uppercase if applicable.
83 +#ifndef _LUCID_CHAR_H
84 +#define _LUCID_CHAR_H
86 +/*! @brief check for an ASCII character */
87 +#define char_isascii(ch) ((unsigned int)(ch) < 128u)
89 +/*! @brief check for a blank character (space, horizontal tab) */
90 +#define char_isblank(ch) (ch == ' ' || ch == '\t')
92 +/*! @brief check for an ASCII control character */
93 +#define char_iscntrl(ch) ((unsigned int)(ch) < 32u || ch == 127)
95 +/*! @brief check for a digit character (0-9) */
96 +#define char_isdigit(ch) ((unsigned int)(ch - '0') < 10u)
98 +/*! @brief check for graphable characters (excluding space) */
99 +#define char_isgraph(ch) ((unsigned int)(ch - '!') < 94u)
101 +/*! @brief check for a lower-case character */
102 +#define char_islower(ch) ((unsigned int)(ch - 'a') < 26u)
104 +/*! @brief check for a printable character (including space) */
105 +#define char_isprint(ch) ((unsigned int)(ch - ' ') < 95u)
107 +/*! @brief check for a whitespace character (\\t, \\n, \\v, \\f, \\r) */
108 +#define char_isspace(ch) ((unsigned int)(ch - '\t') < 5u || ch == ' ')
110 +/*! @brief check for an upper-case character */
111 +#define char_isupper(ch) ((unsigned int)(ch - 'A') < 26u)
113 +/*! @brief check for a hexadecimal character */
114 +#define char_isxdigit(ch) (char_isdigit(ch) || \
115 + (unsigned int)(ch - 'a') < 6u || \
116 + (unsigned int)(ch - 'A') < 6u)
119 +/*! @brief check for an upper- or lower-case character */
120 +#define char_isalpha(ch) (char_islower(ch) || char_isupper(ch))
122 +/*! @brief check for an upper-, lower-case or digit character */
123 +#define char_isalnum(ch) (char_isalpha(ch) || char_isdigit(ch))
125 +/*! @brief check for a punctuation character */
126 +#define char_ispunct(ch) (char_isprint(ch) && \
127 + !char_isalnum(ch) && \
131 +/*! @brief convert character to lower-case */
132 +#define char_tolower(ch) do { if (char_isupper(ch)) ch += 32; } while(0)
134 +/*! @brief convert character to upper-case */
135 +#define char_toupper(ch) do { if (char_islower(ch)) ch -= 32; } while(0)