]>
git.saurik.com Git - wxWidgets.git/blob - src/iodbc/henv.c
1 /** Environment object managment functions
3 Copyright (C) 1995 by Ke Jin <kejin@empress.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
16 #include <../iodbc/iodbc.h>
18 #include <../iodbc/isql.h>
19 #include <../iodbc/isqlext.h>
21 #include <../iodbc/dlproc.h>
23 #include <../iodbc/herr.h>
24 #include <../iodbc/henv.h>
26 #include <../iodbc/itrace.h>
28 RETCODE SQL_API
SQLAllocEnv( HENV FAR
* phenv
)
32 genv
= (GENV_t
*)MEM_ALLOC( sizeof(GENV_t
) );
36 *phenv
= SQL_NULL_HENV
;
41 #if (ODBCVER >= 0x0300 )
42 genv
->type
= SQL_HANDLE_ENV
;
45 genv
->henv
= SQL_NULL_HENV
; /* driver's env list */
46 genv
->hdbc
= SQL_NULL_HDBC
; /* driver's dbc list */
47 genv
->herr
= SQL_NULL_HERR
; /* err list */
54 RETCODE SQL_API
SQLFreeEnv ( HENV henv
)
56 GENV_t FAR
* genv
= (GENV_t
*)henv
;
58 if( henv
== SQL_NULL_HENV
)
60 return SQL_INVALID_HANDLE
;
63 if( genv
->hdbc
!= SQL_NULL_HDBC
)
65 PUSHSQLERR ( genv
->herr
, en_S1010
);
70 _iodbcdm_freesqlerrlist( genv
->herr
);