OCILIB (C Driver for Oracle) 3.9.2
D:/Perso/dev/ocilib/ocilib/src/event.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: event.c, v 3.9.2 2011-07-13 00:00 Vincent Rogier $
00033  * --------------------------------------------------------------------------------------------- */
00034 
00035 #include "ocilib_internal.h"
00036 
00037 /* ********************************************************************************************* *
00038  *                             PRIVATE FUNCTIONS
00039  * ********************************************************************************************* */
00040 
00041 /* --------------------------------------------------------------------------------------------- *
00042  * OCI_EventReset
00043  * --------------------------------------------------------------------------------------------- */
00044 
00045 boolean OCI_EventReset
00046 (
00047     OCI_Event *event
00048 )
00049 {
00050     OCI_CHECK(event == NULL, FALSE);
00051 
00052     event->op   = OCI_UNKNOWN;
00053     event->type = OCI_UNKNOWN;
00054 
00055     if (event->dbname != NULL)
00056     {
00057         event->dbname[0] = 0;
00058     }
00059 
00060     if (event->objname != NULL)
00061     {
00062         event->objname[0] = 0;
00063     }
00064 
00065     if (event->rowid != NULL)
00066     {
00067         event->rowid[0] = 0;
00068     }
00069 
00070     return TRUE;
00071 }
00072 
00073 /* ********************************************************************************************* *
00074  *                            PUBLIC FUNCTIONS
00075  * ********************************************************************************************* */
00076 
00077 /* --------------------------------------------------------------------------------------------- *
00078  * OCI_EventGetType
00079  * --------------------------------------------------------------------------------------------- */
00080 
00081 unsigned int OCI_API OCI_EventGetType
00082 (
00083     OCI_Event *event
00084 )
00085 {
00086     OCI_CHECK_PTR(OCI_IPC_EVENT, event, OCI_UNKNOWN);
00087 
00088     OCI_RESULT(TRUE);
00089 
00090     return event->type;
00091 }
00092 
00093 /* --------------------------------------------------------------------------------------------- *
00094  * OCI_EventGetType
00095  * --------------------------------------------------------------------------------------------- */
00096 
00097 unsigned int OCI_API OCI_EventGetOperation
00098 (
00099     OCI_Event *event
00100 )
00101 {
00102     OCI_CHECK_PTR(OCI_IPC_EVENT, event, OCI_UNKNOWN);
00103 
00104     OCI_RESULT(TRUE);
00105 
00106     return event->op;
00107 }
00108 
00109 /* --------------------------------------------------------------------------------------------- *
00110  * OCI_EventGetObject
00111  * --------------------------------------------------------------------------------------------- */
00112 
00113 const dtext * OCI_API OCI_EventGetDatabase
00114 (
00115     OCI_Event *event
00116 )
00117 {
00118     OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL);
00119 
00120     OCI_RESULT(TRUE);
00121 
00122     return event->dbname;
00123 }
00124 
00125 /* --------------------------------------------------------------------------------------------- *
00126  * OCI_EventGetObject
00127  * --------------------------------------------------------------------------------------------- */
00128 
00129 const dtext * OCI_API OCI_EventGetObject
00130 (
00131     OCI_Event *event
00132 )
00133 {
00134     OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL);
00135 
00136     OCI_RESULT(TRUE);
00137 
00138     return event->objname;
00139 }
00140 
00141 /* --------------------------------------------------------------------------------------------- *
00142  * OCI_EventGetRowid
00143  * --------------------------------------------------------------------------------------------- */
00144 
00145 const dtext * OCI_API OCI_EventGetRowid
00146 (
00147     OCI_Event *event
00148 )
00149 {
00150     OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL);
00151 
00152     OCI_RESULT(TRUE);
00153 
00154     return event->rowid;
00155 }
00156 
00157 /* --------------------------------------------------------------------------------------------- *
00158  * OCI_EventGetSubscription
00159  * --------------------------------------------------------------------------------------------- */
00160 
00161 OCI_Subscription * OCI_API OCI_EventGetSubscription
00162 (
00163     OCI_Event *event
00164 )
00165 {
00166     OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL);
00167 
00168     OCI_RESULT(TRUE);
00169 
00170     return event->sub;
00171 }
00172