types.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* $OpenBSD: types.h,v 1.31 2008/03/16 19:42:57 otto Exp $ */
  2. /* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */
  3. /*-
  4. * Copyright (c) 1982, 1986, 1991, 1993
  5. * The Regents of the University of California. All rights reserved.
  6. * (c) UNIX System Laboratories, Inc.
  7. * All or some portions of this file are derived from material licensed
  8. * to the University of California by American Telephone and Telegraph
  9. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  10. * the permission of UNIX System Laboratories, Inc.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. * 1. Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the distribution.
  20. * 3. Neither the name of the University nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  25. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34. * SUCH DAMAGE.
  35. *
  36. * @(#)types.h 8.4 (Berkeley) 1/21/94
  37. */
  38. #ifndef _SYS_TYPES_H_
  39. #define _SYS_TYPES_H_
  40. #include <sys/_types.h>
  41. #include <sys/endian.h>
  42. typedef unsigned char u_char;
  43. typedef unsigned short u_short;
  44. typedef unsigned int u_int;
  45. typedef unsigned long u_long;
  46. typedef unsigned char unchar; /* Sys V compatibility */
  47. typedef unsigned short ushort; /* Sys V compatibility */
  48. typedef unsigned int uint; /* Sys V compatibility */
  49. typedef unsigned long ulong; /* Sys V compatibility */
  50. #ifndef _INT8_T_DEFINED_
  51. #define _INT8_T_DEFINED_
  52. typedef __int8_t int8_t;
  53. #endif
  54. #ifndef _UINT8_T_DEFINED_
  55. #define _UINT8_T_DEFINED_
  56. typedef __uint8_t uint8_t;
  57. #endif
  58. #ifndef _INT16_T_DEFINED_
  59. #define _INT16_T_DEFINED_
  60. typedef __int16_t int16_t;
  61. #endif
  62. #ifndef _UINT16_T_DEFINED_
  63. #define _UINT16_T_DEFINED_
  64. typedef __uint16_t uint16_t;
  65. #endif
  66. #ifndef _INT32_T_DEFINED_
  67. #define _INT32_T_DEFINED_
  68. typedef __int32_t int32_t;
  69. #endif
  70. #ifndef _UINT32_T_DEFINED_
  71. #define _UINT32_T_DEFINED_
  72. typedef __uint32_t uint32_t;
  73. #endif
  74. #ifndef _INT64_T_DEFINED_
  75. #define _INT64_T_DEFINED_
  76. typedef __int64_t int64_t;
  77. #endif
  78. #ifndef _UINT64_T_DEFINED_
  79. #define _UINT64_T_DEFINED_
  80. typedef __uint64_t uint64_t;
  81. #endif
  82. #ifndef _INTPTR_T_DEFINED_
  83. #define _INTPTR_T_DEFINED_
  84. typedef __intptr_t intptr_t;
  85. #endif
  86. #ifndef _UINTPTR_T_DEFINED_
  87. #define _UINTPTR_T_DEFINED_
  88. typedef __uintptr_t uintptr_t;
  89. #endif
  90. /* BSD-style unsigned bits types */
  91. typedef __uint8_t u_int8_t;
  92. typedef __uint16_t u_int16_t;
  93. typedef __uint32_t u_int32_t;
  94. typedef __uint64_t u_int64_t;
  95. #ifndef _SIZE_T_DEFINED_
  96. #define _SIZE_T_DEFINED_
  97. typedef __size_t size_t;
  98. #endif
  99. #ifndef _SSIZE_T_DEFINED_
  100. #define _SSIZE_T_DEFINED_
  101. typedef __ssize_t ssize_t;
  102. #endif
  103. #ifndef _OFF_T_DEFINED_
  104. #define _OFF_T_DEFINED_
  105. typedef __off_t off_t;
  106. #endif
  107. #endif /* !_SYS_TYPES_H_ */