iodbcunix.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * iodbcunix.h
  3. *
  4. * $Id$
  5. *
  6. * ODBC defines for Unix
  7. *
  8. * The iODBC driver manager.
  9. *
  10. * Copyright (C) 1995 Ke Jin <[email protected]>
  11. * Copyright (C) 1996-2021 OpenLink Software <[email protected]>
  12. * All Rights Reserved.
  13. *
  14. * This software is released under the terms of either of the following
  15. * licenses:
  16. *
  17. * - GNU Library General Public License (see LICENSE.LGPL)
  18. * - The BSD License (see LICENSE.BSD).
  19. *
  20. * Note that the only valid version of the LGPL license as far as this
  21. * project is concerned is the original GNU Library General Public License
  22. * Version 2, dated June 1991.
  23. *
  24. * While not mandated by the BSD license, any patches you make to the
  25. * iODBC source code may be contributed back into the iODBC project
  26. * at your discretion. Contributions will benefit the Open Source and
  27. * Data Access community as a whole. Submissions may be made at:
  28. *
  29. * http://www.iodbc.org
  30. *
  31. *
  32. * GNU Library Generic Public License Version 2
  33. * ============================================
  34. * This library is free software; you can redistribute it and/or
  35. * modify it under the terms of the GNU Library General Public
  36. * License as published by the Free Software Foundation; only
  37. * Version 2 of the License dated June 1991.
  38. *
  39. * This library is distributed in the hope that it will be useful,
  40. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  42. * Library General Public License for more details.
  43. *
  44. * You should have received a copy of the GNU Library General Public
  45. * License along with this library; if not, write to the Free
  46. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  47. *
  48. *
  49. * The BSD License
  50. * ===============
  51. * Redistribution and use in source and binary forms, with or without
  52. * modification, are permitted provided that the following conditions
  53. * are met:
  54. *
  55. * 1. Redistributions of source code must retain the above copyright
  56. * notice, this list of conditions and the following disclaimer.
  57. * 2. Redistributions in binary form must reproduce the above copyright
  58. * notice, this list of conditions and the following disclaimer in
  59. * the documentation and/or other materials provided with the
  60. * distribution.
  61. * 3. Neither the name of OpenLink Software Inc. nor the names of its
  62. * contributors may be used to endorse or promote products derived
  63. * from this software without specific prior written permission.
  64. *
  65. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  66. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  67. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  68. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
  69. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  70. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  71. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  72. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  73. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  74. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  75. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  76. */
  77. #ifndef _IODBCUNIX_H
  78. #define _IODBCUNIX_H
  79. /*
  80. * Standard header files
  81. */
  82. #include <stdlib.h>
  83. #include <unistd.h>
  84. #if defined(__WCHAR_TYPE__)
  85. #include <wchar.h>
  86. #endif
  87. /*
  88. * Windows-style declarations
  89. */
  90. #define NEAR
  91. #define FAR
  92. #define EXPORT
  93. #define PASCAL
  94. #define VOID void
  95. #define CALLBACK
  96. #define _cdecl
  97. #define __stdcall
  98. /*
  99. * Boolean support
  100. */
  101. #ifndef TRUE
  102. #define TRUE 1
  103. #endif
  104. #ifndef FALSE
  105. #define FALSE 0
  106. #endif
  107. #ifdef __cplusplus
  108. extern "C" {
  109. #endif
  110. /*
  111. * Windows-style typedefs
  112. */
  113. #if defined (OBSOLETE_WINDOWS_TYPES)
  114. typedef unsigned char BYTE;
  115. #endif
  116. typedef unsigned short WORD;
  117. typedef unsigned int DWORD;
  118. typedef char * LPSTR;
  119. typedef const char * LPCSTR;
  120. typedef wchar_t * LPWSTR;
  121. typedef const wchar_t * LPCWSTR;
  122. typedef DWORD * LPDWORD;
  123. #if !defined(BOOL) && !defined(_OBJC_OBJC_H_)
  124. typedef int BOOL;
  125. #endif
  126. /*
  127. * Determine sizeof(long) in case it is not determined by configure/config.h
  128. */
  129. #ifndef SIZEOF_LONG
  130. #if defined (_LP64) || \
  131. defined (__LP64__) || \
  132. defined (__64BIT__) || \
  133. defined (__alpha) || \
  134. defined (__sparcv9) || \
  135. defined (__arch64__)
  136. #define SIZEOF_LONG 8 /* 64 bit operating systems */
  137. #else
  138. #define SIZEOF_LONG 4 /* 32 bit operating systems */
  139. #endif
  140. #endif /* SIZEOF_LONG */
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144. #endif /* _IODBCUNIX_H */