types.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: types.h /main/1 1996/07/29 17:10:18 cde-hp $ */
  24. // Copyright (c) 1994 James Clark
  25. // See the file COPYING for copying permission.
  26. #ifndef types_INCLUDED
  27. #define types_INCLUDED 1
  28. #include <limits.h>
  29. #include <stddef.h>
  30. #ifdef SP_NAMESPACE
  31. namespace SP_NAMESPACE {
  32. #endif
  33. #if UINT_MAX >= 0xffffffffL /* 2^32 - 1 */
  34. typedef unsigned int Unsigned32;
  35. #else
  36. typedef unsigned long Unsigned32;
  37. #endif
  38. // Number holds values between 0 and 99999999 (eight nines).
  39. typedef Unsigned32 Number;
  40. typedef Unsigned32 Offset;
  41. typedef Unsigned32 Index;
  42. #ifdef SP_MULTI_BYTE
  43. #ifdef SP_WCHAR_T_USHORT
  44. typedef wchar_t Char;
  45. #else
  46. typedef unsigned short Char;
  47. #endif
  48. #if INT_MAX > 65535L
  49. typedef int Xchar;
  50. #else /* INT_MAX <= 65535L */
  51. typedef long Xchar;
  52. #endif /* INT_MAX <= 65535L */
  53. #else /* not SP_MULTI_BYTE */
  54. typedef unsigned char Char;
  55. // This holds any value of type Char plus InputSource:eE (= -1).
  56. typedef int Xchar;
  57. #endif /* not SP_MULTI_BYTE */
  58. typedef Unsigned32 UnivChar;
  59. typedef Unsigned32 WideChar;
  60. // A character in a syntax reference character set.
  61. // We might want to compile with wide syntax reference characters
  62. // (since they're cheap) but not with wide document characters.
  63. typedef Unsigned32 SyntaxChar;
  64. typedef unsigned short CharClassIndex;
  65. typedef unsigned Token;
  66. #ifdef SP_MULTI_BYTE
  67. typedef unsigned short EquivCode;
  68. #else
  69. typedef unsigned char EquivCode;
  70. #endif
  71. #ifdef SP_NAMESPACE
  72. }
  73. #endif
  74. #endif /* not types_INCLUDED */