1 /*
2  *  iodbcadm.h
3  *
4  *  $Id$
5  *
6  *  The iODBC driver manager.
7  *
8  *  Copyright (C) 1996-2021 OpenLink Software <iodbc@openlinksw.com>
9  *  All Rights Reserved.
10  *
11  *  This software is released under the terms of either of the following
12  *  licenses:
13  *
14  *      - GNU Library General Public License (see LICENSE.LGPL)
15  *      - The BSD License (see LICENSE.BSD).
16  *
17  *  Note that the only valid version of the LGPL license as far as this
18  *  project is concerned is the original GNU Library General Public License
19  *  Version 2, dated June 1991.
20  *
21  *  While not mandated by the BSD license, any patches you make to the
22  *  iODBC source code may be contributed back into the iODBC project
23  *  at your discretion. Contributions will benefit the Open Source and
24  *  Data Access community as a whole. Submissions may be made at:
25  *
26  *      http://www.iodbc.org
27  *
28  *
29  *  GNU Library Generic Public License Version 2
30  *  ============================================
31  *  This library is free software; you can redistribute it and/or
32  *  modify it under the terms of the GNU Library General Public
33  *  License as published by the Free Software Foundation; only
34  *  Version 2 of the License dated June 1991.
35  *
36  *  This library is distributed in the hope that it will be useful,
37  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
38  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
39  *  Library General Public License for more details.
40  *
41  *  You should have received a copy of the GNU Library General Public
42  *  License along with this library; if not, write to the Free
43  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
44  *
45  *
46  *  The BSD License
47  *  ===============
48  *  Redistribution and use in source and binary forms, with or without
49  *  modification, are permitted provided that the following conditions
50  *  are met:
51  *
52  *  1. Redistributions of source code must retain the above copyright
53  *     notice, this list of conditions and the following disclaimer.
54  *  2. Redistributions in binary form must reproduce the above copyright
55  *     notice, this list of conditions and the following disclaimer in
56  *     the documentation and/or other materials provided with the
57  *     distribution.
58  *  3. Neither the name of OpenLink Software Inc. nor the names of its
59  *     contributors may be used to endorse or promote products derived
60  *     from this software without specific prior written permission.
61  *
62  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
63  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
64  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
65  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
66  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
67  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
68  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
69  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
70  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
71  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
72  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73  */
74 
75 
76 #include <iodbc.h>
77 #include <odbcinst.h>
78 #include <sql.h>
79 #include <sqltypes.h>
80 #include <sqlucode.h>
81 
82 #ifndef	_IODBCADM_H
83 #define	_IODBCADM_H
84 
85 #define USER_DSN		0
86 #define SYSTEM_DSN		1
87 #define FILE_DSN		2
88 
89 SQLRETURN SQL_API iodbcdm_drvconn_dialbox (HWND hwnd, LPSTR szInOutConnStr,
90     DWORD cbInOutConnStr, int *sqlStat, SQLUSMALLINT fDriverCompletion,
91     UWORD * config);
92 SQLRETURN SQL_API iodbcdm_drvconn_dialboxw (HWND hwnd, LPWSTR szInOutConnStr,
93     DWORD cbInOutConnStr, int *sqlStat, SQLUSMALLINT fDriverCompletion,
94     UWORD * config);
95 
96 SQLRETURN SQL_API _iodbcdm_drvchoose_dialbox (HWND hwnd, LPSTR szInOutDrvStr,
97     DWORD cbInOutDrvStr, int *sqlStat);
98 SQLRETURN SQL_API _iodbcdm_drvchoose_dialboxw (HWND hwnd, LPWSTR szInOutConnStr,
99     DWORD cbInOutConnStr, int * sqlStat);
100 
101 SQLRETURN SQL_API _iodbcdm_trschoose_dialbox (HWND hwnd, LPSTR szInOutDrvStr,
102     DWORD cbInOutDrvStr, int *sqlStat);
103 SQLRETURN SQL_API _iodbcdm_trschoose_dialboxw (HWND hwnd, LPWSTR szInOutDrvStr,
104     DWORD cbInOutDrvStr, int * sqlStat);
105 
106 void SQL_API _iodbcdm_errorbox (HWND hwnd, LPCSTR szDSN, LPCSTR szText);
107 void SQL_API _iodbcdm_errorboxw (HWND hwnd, LPCWSTR szDSN, LPCWSTR szText);
108 void SQL_API _iodbcdm_messagebox (HWND hwnd, LPCSTR szDSN, LPCSTR szText);
109 void SQL_API _iodbcdm_messageboxw (HWND hwnd, LPCWSTR szDSN, LPCWSTR szText);
110 BOOL SQL_API _iodbcdm_confirmbox (HWND hwnd, LPCSTR szDSN, LPCSTR szText);
111 BOOL SQL_API _iodbcdm_confirmboxw (HWND hwnd, LPCWSTR szDSN, LPCWSTR szText);
112 void _iodbcdm_nativeerrorbox (HWND hwnd, HENV henv, HDBC hdbc, HSTMT hstmt);
113 
114 SQLRETURN SQL_API _iodbcdm_admin_dialbox (HWND hwnd);
115 
116 typedef SQLRETURN SQL_API (*pAdminBoxFunc) (HWND hwnd);
117 typedef SQLRETURN SQL_API (*pTrsChooseFunc) (HWND hwnd, LPSTR szInOutDrvStr,
118     DWORD cbInOutDrvStr, int *sqlStat);
119 typedef SQLRETURN SQL_API (*pDrvConnFunc) (HWND hwnd, LPSTR szInOutConnStr,
120     DWORD cbInOutConnStr, int *sqlStat, SQLUSMALLINT fDriverCompletion,
121     UWORD * config);
122 typedef SQLRETURN SQL_API (*pDrvConnWFunc) (HWND hwnd, LPWSTR szInOutConnStr,
123     DWORD cbInOutConnStr, int * sqlStat, SQLUSMALLINT fDriverCompletion,
124     UWORD *config);
125 #endif
126