OCILIB (C Driver for Oracle) 3.9.1
D:/Perso/dev/ocilib/ocilib/src/handle.c
00001 /*
00002     +-----------------------------------------------------------------------------------------+
00003     |                                                                                         |
00004     |                               OCILIB - C Driver for Oracle                              |
00005     |                                                                                         |
00006     |                                (C Wrapper for Oracle OCI)                               |
00007     |                                                                                         |
00008     |                              Website : http://www.ocilib.net                            |
00009     |                                                                                         |
00010     |             Copyright (c) 2007-2011 Vincent ROGIER <vince.rogier@ocilib.net>            |
00011     |                                                                                         |
00012     +-----------------------------------------------------------------------------------------+
00013     |                                                                                         |
00014     |             This library is free software; you can redistribute it and/or               |
00015     |             modify it under the terms of the GNU Lesser General Public                  |
00016     |             License as published by the Free Software Foundation; either                |
00017     |             version 2 of the License, or (at your option) any later version.            |
00018     |                                                                                         |
00019     |             This library is distributed in the hope that it will be useful,             |
00020     |             but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00021     |             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           |
00022     |             Lesser General Public License for more details.                             |
00023     |                                                                                         |
00024     |             You should have received a copy of the GNU Lesser General Public            |
00025     |             License along with this library; if not, write to the Free                  |
00026     |             Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.          |
00027     |                                                                                         |
00028     +-----------------------------------------------------------------------------------------+
00029 */
00030 
00031 /* --------------------------------------------------------------------------------------------- *
00032  * $Id: handle.c, v 3.9.1 2011-07-08 00:00 Vincent Rogier $
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
00046 (
00047     void
00048 )
00049 {
00050     return OCILib.env;
00051 }
00052 
00053 /* --------------------------------------------------------------------------------------------- *
00054  * OCI_HandleGetContext
00055  * --------------------------------------------------------------------------------------------- */
00056 
00057 const void * OCI_API OCI_HandleGetContext
00058 (
00059     OCI_Connection *con
00060 )
00061 {
00062     OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL);
00063 
00064     OCI_RESULT(TRUE);
00065 
00066     return con->cxt;
00067 }
00068 
00069 /* --------------------------------------------------------------------------------------------- *
00070  * OCI_HandleGetServer
00071  * --------------------------------------------------------------------------------------------- */
00072 
00073 const void * OCI_API OCI_HandleGetServer
00074 (
00075     OCI_Connection *con
00076 )
00077 {
00078     OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL);
00079 
00080     OCI_RESULT(TRUE);
00081 
00082     return con->svr;
00083 }
00084 
00085 /* --------------------------------------------------------------------------------------------- *
00086  * OCI_HandleGetError
00087  * --------------------------------------------------------------------------------------------- */
00088 
00089 const void * OCI_API OCI_HandleGetError
00090 (
00091     OCI_Connection *con
00092 )
00093 {
00094     OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL);
00095 
00096     OCI_RESULT(TRUE);
00097 
00098     return con->err;
00099 }
00100 
00101 /* --------------------------------------------------------------------------------------------- *
00102  * OCI_HandleGetSession
00103  * --------------------------------------------------------------------------------------------- */
00104 
00105 const void * OCI_API OCI_HandleGetSession
00106 (
00107     OCI_Connection *con
00108 )
00109 {
00110     OCI_CHECK_PTR(OCI_IPC_CONNECTION, con, NULL);
00111 
00112     OCI_RESULT(TRUE);
00113 
00114     return con->ses;
00115 }
00116 
00117 /* --------------------------------------------------------------------------------------------- *
00118  * OCI_HandleGetTransaction
00119  * --------------------------------------------------------------------------------------------- */
00120 
00121 const void * OCI_API OCI_HandleGetTransaction
00122 (
00123     OCI_Transaction *trans
00124 )
00125 {
00126     OCI_CHECK_PTR(OCI_IPC_TRANSACTION, trans, NULL);
00127 
00128     OCI_RESULT(TRUE);
00129 
00130     return trans->htr;
00131 }
00132 
00133 /* --------------------------------------------------------------------------------------------- *
00134  * OCI_HandleGetStatement
00135  * --------------------------------------------------------------------------------------------- */
00136 
00137 const void * OCI_API OCI_HandleGetStatement
00138 (
00139     OCI_Statement *stmt
00140 )
00141 {
00142     OCI_CHECK_PTR(OCI_IPC_STATEMENT, stmt, NULL);
00143 
00144     OCI_RESULT(TRUE);
00145 
00146     return stmt->stmt;
00147 }
00148 
00149 /* --------------------------------------------------------------------------------------------- *
00150  * OCI_HandleGetLob
00151  * --------------------------------------------------------------------------------------------- */
00152 
00153 const void * OCI_API OCI_HandleGetLob
00154 (
00155     OCI_Lob *lob
00156 )
00157 {
00158     OCI_CHECK_PTR(OCI_IPC_LOB, lob, NULL);
00159 
00160     OCI_RESULT(TRUE);
00161 
00162     return lob->handle;
00163 }
00164 
00165 /* --------------------------------------------------------------------------------------------- *
00166  * OCI_HandleGetFile
00167  * --------------------------------------------------------------------------------------------- */
00168 
00169 const void * OCI_API OCI_HandleGetFile
00170 (
00171     OCI_File *file
00172 )
00173 {
00174     OCI_CHECK_PTR(OCI_IPC_FILE, file, NULL);
00175 
00176     OCI_RESULT(TRUE);
00177 
00178     return file->handle;
00179 }
00180 
00181 /* --------------------------------------------------------------------------------------------- *
00182  * OCI_HandleGetDate
00183  * --------------------------------------------------------------------------------------------- */
00184 
00185 const void * OCI_API OCI_HandleGetDate
00186 (
00187     OCI_Date *date
00188 )
00189 {
00190     OCI_CHECK_PTR(OCI_IPC_DATE, date, NULL);
00191 
00192     OCI_RESULT(TRUE);
00193 
00194     return date->handle;
00195 }
00196 
00197 /* --------------------------------------------------------------------------------------------- *
00198  * OCI_HandleGetTimestamp
00199  * --------------------------------------------------------------------------------------------- */
00200 
00201 const void * OCI_API OCI_HandleGetTimestamp
00202 (
00203     OCI_Timestamp *tmsp
00204 )
00205 {
00206     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp, NULL);
00207 
00208     OCI_RESULT(TRUE);
00209 
00210     return tmsp->handle;
00211 }
00212 
00213 /* --------------------------------------------------------------------------------------------- *
00214  * OCI_HandleGetInterval
00215  * --------------------------------------------------------------------------------------------- */
00216 
00217 const void * OCI_API OCI_HandleGetInterval
00218 (
00219     OCI_Interval *itv
00220 )
00221 {
00222     OCI_CHECK_PTR(OCI_IPC_INTERVAL, itv, NULL);
00223 
00224     OCI_RESULT(TRUE);
00225 
00226     return itv->handle;
00227 }
00228 
00229 /* --------------------------------------------------------------------------------------------- *
00230  * OCI_HandleGetObject
00231  * --------------------------------------------------------------------------------------------- */
00232 
00233 const void * OCI_API OCI_HandleGetObject
00234 (
00235     OCI_Object *obj
00236 )
00237 {
00238     OCI_CHECK_PTR(OCI_IPC_OBJECT, obj, NULL);
00239 
00240     OCI_RESULT(TRUE);
00241 
00242     return obj->handle;
00243 }
00244 
00245 /* --------------------------------------------------------------------------------------------- *
00246  * OCI_HandleGetColl
00247  * --------------------------------------------------------------------------------------------- */
00248 
00249 const void * OCI_API OCI_HandleGetColl
00250 (
00251     OCI_Coll *coll
00252 )
00253 {
00254     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, NULL);
00255 
00256     OCI_RESULT(TRUE);
00257 
00258     return coll->handle;
00259 }
00260 
00261 /* --------------------------------------------------------------------------------------------- *
00262  * OCI_HandleGetRef
00263  * --------------------------------------------------------------------------------------------- */
00264 
00265 const void * OCI_API OCI_HandleGetRef
00266 (
00267     OCI_Ref *ref
00268 )
00269 {
00270     OCI_CHECK_PTR(OCI_IPC_REF, ref, NULL);
00271 
00272     OCI_RESULT(TRUE);
00273 
00274     return ref->handle;
00275 }
00276 
00277 /* --------------------------------------------------------------------------------------------- *
00278  * OCI_HandleGetMutex
00279  * --------------------------------------------------------------------------------------------- */
00280 
00281 const void * OCI_API OCI_HandleGetMutex
00282 (
00283     OCI_Mutex *mutex
00284 )
00285 {
00286     OCI_CHECK_PTR(OCI_IPC_MUTEX, mutex, NULL);
00287 
00288     OCI_RESULT(TRUE);
00289 
00290     return mutex->handle;
00291 }
00292 
00293 /* --------------------------------------------------------------------------------------------- *
00294  * OCI_HandleGetThreadID
00295  * --------------------------------------------------------------------------------------------- */
00296 
00297 const void * OCI_API OCI_HandleGetThreadID
00298 (
00299     OCI_Thread *thread
00300 )
00301 {
00302     OCI_CHECK_PTR(OCI_IPC_THREAD, thread, NULL);
00303 
00304     OCI_RESULT(TRUE);
00305 
00306     return thread->id;
00307 }
00308 
00309 /* --------------------------------------------------------------------------------------------- *
00310  * OCI_HandleGetThread
00311  * --------------------------------------------------------------------------------------------- */
00312 
00313 const void * OCI_API OCI_HandleGetThread
00314 (
00315     OCI_Thread *thread
00316 )
00317 {
00318     OCI_CHECK_PTR(OCI_IPC_THREAD, thread, NULL);
00319 
00320     OCI_RESULT(TRUE);
00321 
00322     return thread->handle;
00323 }
00324 
00325 /* --------------------------------------------------------------------------------------------- *
00326  * OCI_HandleGetDirPathCtx
00327  * --------------------------------------------------------------------------------------------- */
00328 
00329 const void * OCI_API OCI_HandleGetDirPathCtx
00330 (
00331     OCI_DirPath *dp
00332 )
00333 {
00334     OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL);
00335 
00336     OCI_RESULT(TRUE);
00337 
00338     return dp->ctx;
00339 }
00340 
00341 /* --------------------------------------------------------------------------------------------- *
00342  * OCI_HandleGetDirPathColArray
00343  * --------------------------------------------------------------------------------------------- */
00344 
00345 const void * OCI_API OCI_HandleGetDirPathColArray
00346 (
00347     OCI_DirPath *dp
00348 )
00349 {
00350     OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL);
00351 
00352     OCI_RESULT(TRUE);
00353 
00354     return dp->arr;
00355 }
00356 
00357 /* --------------------------------------------------------------------------------------------- *
00358  * OCI_HandleGetDirPathStream
00359  * --------------------------------------------------------------------------------------------- */
00360 
00361 const void * OCI_API OCI_HandleGetDirPathStream
00362 (
00363     OCI_DirPath *dp
00364 )
00365 {
00366     OCI_CHECK_PTR(OCI_IPC_DIRPATH, dp, NULL);
00367 
00368     OCI_RESULT(TRUE);
00369 
00370     return dp->strm;
00371 }
00372 
00373 /* --------------------------------------------------------------------------------------------- *
00374  * OCI_HandleGetSubscription
00375  * --------------------------------------------------------------------------------------------- */
00376 
00377 const void * OCI_API OCI_HandleGetSubscription
00378 (
00379     OCI_Subscription *sub
00380 )
00381 {
00382     OCI_CHECK_PTR(OCI_IPC_NOTIFY, sub, NULL);
00383 
00384     OCI_RESULT(TRUE);
00385 
00386     return sub->subhp;
00387 }
00388