OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
5.3 KiB

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