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-2010 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.8.1 2010-12-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 event->dbname[0] = 0; 00057 00058 if (event->objname != NULL) 00059 event->objname[0] = 0; 00060 00061 if (event->rowid != NULL) 00062 event->rowid[0] = 0; 00063 00064 return TRUE; 00065 } 00066 00067 /* ********************************************************************************************* * 00068 * PUBLIC FUNCTIONS 00069 * ********************************************************************************************* */ 00070 00071 /* --------------------------------------------------------------------------------------------- * 00072 * OCI_EventGetType 00073 * --------------------------------------------------------------------------------------------- */ 00074 00075 unsigned int OCI_API OCI_EventGetType 00076 ( 00077 OCI_Event *event 00078 ) 00079 { 00080 OCI_CHECK_PTR(OCI_IPC_EVENT, event, OCI_UNKNOWN); 00081 00082 OCI_RESULT(TRUE); 00083 00084 return event->type; 00085 } 00086 00087 /* --------------------------------------------------------------------------------------------- * 00088 * OCI_EventGetType 00089 * --------------------------------------------------------------------------------------------- */ 00090 00091 unsigned int OCI_API OCI_EventGetOperation 00092 ( 00093 OCI_Event *event 00094 ) 00095 { 00096 OCI_CHECK_PTR(OCI_IPC_EVENT, event, OCI_UNKNOWN); 00097 00098 OCI_RESULT(TRUE); 00099 00100 return event->op; 00101 } 00102 00103 /* --------------------------------------------------------------------------------------------- * 00104 * OCI_EventGetObject 00105 * --------------------------------------------------------------------------------------------- */ 00106 00107 const dtext * OCI_API OCI_EventGetDatabase 00108 ( 00109 OCI_Event *event 00110 ) 00111 { 00112 OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL); 00113 00114 OCI_RESULT(TRUE); 00115 00116 return event->dbname; 00117 } 00118 00119 /* --------------------------------------------------------------------------------------------- * 00120 * OCI_EventGetObject 00121 * --------------------------------------------------------------------------------------------- */ 00122 00123 const dtext * OCI_API OCI_EventGetObject 00124 ( 00125 OCI_Event *event 00126 ) 00127 { 00128 OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL); 00129 00130 OCI_RESULT(TRUE); 00131 00132 return event->objname; 00133 } 00134 00135 /* --------------------------------------------------------------------------------------------- * 00136 * OCI_EventGetRowid 00137 * --------------------------------------------------------------------------------------------- */ 00138 00139 const dtext * OCI_API OCI_EventGetRowid 00140 ( 00141 OCI_Event *event 00142 ) 00143 { 00144 OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL); 00145 00146 OCI_RESULT(TRUE); 00147 00148 return event->rowid; 00149 } 00150 00151 /* --------------------------------------------------------------------------------------------- * 00152 * OCI_EventGetSubscription 00153 * --------------------------------------------------------------------------------------------- */ 00154 00155 OCI_Subscription * OCI_API OCI_EventGetSubscription 00156 ( 00157 OCI_Event *event 00158 ) 00159 { 00160 OCI_CHECK_PTR(OCI_IPC_EVENT, event, NULL); 00161 00162 OCI_RESULT(TRUE); 00163 00164 return event->sub; 00165 } 00166