00001 /* 00002 +----------------------------------------------------------------------+ 00003 | | 00004 | OCILIB - C Driver for Oracle | 00005 | | 00006 | (C Wrapper for Oracle OCI) | 00007 | | 00008 +----------------------------------------------------------------------+ 00009 | Website : http://www.ocilib.net | 00010 +----------------------------------------------------------------------+ 00011 | Copyright (c) 2007-2009 Vincent ROGIER | 00012 +----------------------------------------------------------------------+ 00013 | This library is free software; you can redistribute it and/or | 00014 | modify it under the terms of the GNU Lesser General Public | 00015 | License as published by the Free Software Foundation; either | 00016 | version 2 of the License, or (at your option) any later version. | 00017 | | 00018 | This library is distributed in the hope that it will be useful, | 00019 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00020 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 00021 | Lesser General Public License for more details. | 00022 | | 00023 | You should have received a copy of the GNU Lesser General Public | 00024 | License along with this library; if not, write to the Free | 00025 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 00026 +----------------------------------------------------------------------+ 00027 | Author: Vincent ROGIER <vince.rogier@gmail.com> | 00028 +----------------------------------------------------------------------+ 00029 */ 00030 00031 /* ------------------------------------------------------------------------ * 00032 * $Id: handle.c, v 3.4.0 2009-07-30 17:40 Vince $ 00033 * ------------------------------------------------------------------------ */ 00034 00035 #include "ocilib_internal.h" 00036 00037 /* ************************************************************************ * 00038 * PUBLIC FUNCTIONS 00039 * ************************************************************************ */ 00040 00041 /* ------------------------------------------------------------------------ * 00042 * OCI_HandleGetEnvironment 00043 * ------------------------------------------------------------------------ */ 00044 00045 const void * OCI_API OCI_HandleGetEnvironment(void) 00046 { 00047 return OCILib.env; 00048 } 00049 00050 /* ------------------------------------------------------------------------ * 00051 * OCI_HandleGetContext 00052 * ------------------------------------------------------------------------ */ 00053 00054 const void * OCI_API OCI_HandleGetContext(OCI_Connection *con) 00055 { 00056 OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL); 00057 00058 OCI_RESULT(TRUE); 00059 00060 return con->cxt; 00061 } 00062 00063 /* ------------------------------------------------------------------------ * 00064 * OCI_HandleGetServer 00065 * ------------------------------------------------------------------------ */ 00066 00067 const void * OCI_API OCI_HandleGetServer(OCI_Connection *con) 00068 { 00069 OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL); 00070 00071 OCI_RESULT(TRUE); 00072 00073 return con->svr; 00074 } 00075 00076 /* ------------------------------------------------------------------------ * 00077 * OCI_HandleGetError 00078 * ------------------------------------------------------------------------ */ 00079 00080 const void * OCI_API OCI_HandleGetError(OCI_Connection *con) 00081 { 00082 OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL); 00083 00084 OCI_RESULT(TRUE); 00085 00086 return con->err; 00087 } 00088 00089 /* ------------------------------------------------------------------------ * 00090 * OCI_HandleGetSession 00091 * ------------------------------------------------------------------------ */ 00092 00093 const void * OCI_API OCI_HandleGetSession(OCI_Connection *con) 00094 { 00095 OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL); 00096 00097 OCI_RESULT(TRUE); 00098 00099 return con->ses; 00100 } 00101 00102 /* ------------------------------------------------------------------------ * 00103 * OCI_HandleGetTransaction 00104 * ------------------------------------------------------------------------ */ 00105 00106 const void * OCI_API OCI_HandleGetTransaction(OCI_Transaction *trans) 00107 { 00108 OCI_CHECK_PTR(OCI_IPC_TRANSACTION, trans, NULL); 00109 00110 OCI_RESULT(TRUE); 00111 00112 return trans->htr; 00113 } 00114 00115 /* ------------------------------------------------------------------------ * 00116 * OCI_HandleGetStatement 00117 * ------------------------------------------------------------------------ */ 00118 00119 const void * OCI_API OCI_HandleGetStatement(OCI_Statement *stmt) 00120 { 00121 OCI_CHECK_PTR(OCI_IPC_STATEMENT, stmt, NULL); 00122 00123 OCI_RESULT(TRUE); 00124 00125 return stmt->stmt; 00126 } 00127 00128 /* ------------------------------------------------------------------------ * 00129 * OCI_HandleGetLob 00130 * ------------------------------------------------------------------------ */ 00131 00132 const void * OCI_API OCI_HandleGetLob(OCI_Lob *lob) 00133 { 00134 OCI_CHECK_PTR(OCI_IPC_LOB, lob,NULL); 00135 00136 OCI_RESULT(TRUE); 00137 00138 return lob->handle; 00139 } 00140 00141 /* ------------------------------------------------------------------------ * 00142 * OCI_HandleGetFile 00143 * ------------------------------------------------------------------------ */ 00144 00145 const void * OCI_API OCI_HandleGetFile(OCI_File *file) 00146 { 00147 OCI_CHECK_PTR(OCI_IPC_FILE, file, NULL); 00148 00149 OCI_RESULT(TRUE); 00150 00151 return file->handle; 00152 } 00153 00154 /* ------------------------------------------------------------------------ * 00155 * OCI_HandleGetDate 00156 * ------------------------------------------------------------------------ */ 00157 00158 const void * OCI_API OCI_HandleGetDate(OCI_Date *date) 00159 { 00160 OCI_CHECK_PTR(OCI_IPC_DATE, date, NULL); 00161 00162 OCI_RESULT(TRUE); 00163 00164 return date->handle; 00165 } 00166 00167 /* ------------------------------------------------------------------------ * 00168 * OCI_HandleGetTimestamp 00169 * ------------------------------------------------------------------------ */ 00170 00171 const void * OCI_API OCI_HandleGetTimestamp(OCI_Timestamp *tmsp) 00172 { 00173 OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp, NULL); 00174 00175 OCI_RESULT(TRUE); 00176 00177 return tmsp->handle; 00178 } 00179 00180 /* ------------------------------------------------------------------------ * 00181 * OCI_HandleGetInterval 00182 * ------------------------------------------------------------------------ */ 00183 00184 const void * OCI_API OCI_HandleGetInterval(OCI_Interval *itv) 00185 { 00186 OCI_CHECK_PTR(OCI_IPC_INTERVAL, itv, NULL); 00187 00188 OCI_RESULT(TRUE); 00189 00190 return itv->handle; 00191 } 00192 00193 /* ------------------------------------------------------------------------ * 00194 * OCI_HandleGetObject 00195 * ------------------------------------------------------------------------ */ 00196 00197 const void * OCI_API OCI_HandleGetObject(OCI_Object *obj) 00198 { 00199 OCI_CHECK_PTR(OCI_IPC_OBJECT, obj, NULL); 00200 00201 OCI_RESULT(TRUE); 00202 00203 return obj->handle; 00204 } 00205 00206 /* ------------------------------------------------------------------------ * 00207 * OCI_HandleGetColl 00208 * ------------------------------------------------------------------------ */ 00209 00210 const void * OCI_API OCI_HandleGetColl(OCI_Coll *coll) 00211 { 00212 OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, NULL); 00213 00214 OCI_RESULT(TRUE); 00215 00216 return coll->handle; 00217 } 00218 00219 /* ------------------------------------------------------------------------ * 00220 * OCI_HandleGetRef 00221 * ------------------------------------------------------------------------ */ 00222 00223 const void * OCI_API OCI_HandleGetRef(OCI_Ref *ref) 00224 { 00225 OCI_CHECK_PTR(OCI_IPC_REF, ref, NULL); 00226 00227 OCI_RESULT(TRUE); 00228 00229 return ref->handle; 00230 } 00231 00232 /* ------------------------------------------------------------------------ * 00233 * OCI_HandleGetMutex 00234 * ------------------------------------------------------------------------ */ 00235 00236 const void * OCI_API OCI_HandleGetMutex(OCI_Mutex *mutex) 00237 { 00238 OCI_CHECK_PTR(OCI_IPC_MUTEX, mutex, NULL); 00239 00240 OCI_RESULT(TRUE); 00241 00242 return mutex->handle; 00243 } 00244 00245 /* ------------------------------------------------------------------------ * 00246 * OCI_HandleGetThreadID 00247 * ------------------------------------------------------------------------ */ 00248 00249 const void * OCI_API OCI_HandleGetThreadID(OCI_Thread *thread) 00250 { 00251 OCI_CHECK_PTR(OCI_IPC_THREAD, thread, NULL); 00252 00253 OCI_RESULT(TRUE); 00254 00255 return thread->id; 00256 } 00257 00258 /* ------------------------------------------------------------------------ * 00259 * OCI_HandleGetThread 00260 * ------------------------------------------------------------------------ */ 00261 00262 const void * OCI_API OCI_HandleGetThread(OCI_Thread *thread) 00263 { 00264 OCI_CHECK_PTR(OCI_IPC_THREAD, thread, NULL); 00265 00266 OCI_RESULT(TRUE); 00267 00268 return thread->handle; 00269 } 00270 00271 /* ------------------------------------------------------------------------ * 00272 * OCI_HandleGetDirPathCtx 00273 * ------------------------------------------------------------------------ */ 00274 00275 OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathCtx(OCI_DirPath *dp) 00276 { 00277 OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL); 00278 00279 OCI_RESULT(TRUE); 00280 00281 return dp->ctx; 00282 } 00283 00284 /* ------------------------------------------------------------------------ * 00285 * OCI_HandleGetDirPathColArray 00286 * ------------------------------------------------------------------------ */ 00287 00288 OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathColArray(OCI_DirPath *dp) 00289 { 00290 OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL); 00291 00292 OCI_RESULT(TRUE); 00293 00294 return dp->arr; 00295 } 00296 00297 /* ------------------------------------------------------------------------ * 00298 * OCI_HandleGetDirPathStream 00299 * ------------------------------------------------------------------------ */ 00300 00301 OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathStream(OCI_DirPath *dp) 00302 { 00303 OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL); 00304 00305 OCI_RESULT(TRUE); 00306 00307 return dp->strm; 00308 }