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