📄 sqlora_8c-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>libsqlora8: sqlora.c Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <a class="qindex" href="examples.html">Examples</a></div><h1>sqlora.c</h1><a href="sqlora_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/* $Id: sqlora.c,v 1.71 2004/05/28 03:04:15 kpoitschke Exp $ */</span>00014 <span class="comment">/*</span>00015 <span class="comment"> * Permission to use, copy, modify, and distribute this software for</span>00016 <span class="comment"> * any purpose with or without fee is hereby granted, provided that</span>00017 <span class="comment"> * the above copyright notice and this permission notice appear in all</span>00018 <span class="comment"> * copies.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</span>00021 <span class="comment"> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>00022 <span class="comment"> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span>00023 <span class="comment"> * IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR</span>00024 <span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>00025 <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span>00026 <span class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</span>00027 <span class="comment"> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>00028 <span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span>00029 <span class="comment"> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</span>00030 <span class="comment"> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>00031 <span class="comment"> * SUCH DAMAGE.</span>00032 <span class="comment"> */</span>00033 00034 <span class="keyword">const</span> <span class="keywordtype">char</span> * _sqlo_sqloraID=<span class="stringliteral">"$Id: sqlora.c,v 1.71 2004/05/28 03:04:15 kpoitschke Exp $"</span>;00035 00036 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>00037 <span class="preprocessor"></span><span class="preprocessor">#include "config.h"</span>00038 <span class="preprocessor">#endif</span>00039 <span class="preprocessor"></span>00040 <span class="preprocessor">#include <stdio.h></span>00041 <span class="preprocessor">#include <string.h></span>00042 <span class="preprocessor">#include <stdlib.h></span>00043 <span class="preprocessor">#include <limits.h></span>00044 <span class="preprocessor">#include <errno.h></span>00045 00046 <span class="preprocessor">#ifdef HAVE_UNISTD_H </span><span class="comment">/* for my windows friends */</span>00047 <span class="preprocessor"># include <unistd.h></span>00048 <span class="preprocessor">#endif</span>00049 <span class="preprocessor"></span><span class="preprocessor">#include <ctype.h></span>00050 <span class="preprocessor">#include <assert.h></span>00051 00052 <span class="preprocessor">#if defined(ENABLE_WINTHREADS)</span>00053 <span class="preprocessor"></span><span class="preprocessor">#include <windows.h></span>00054 <span class="preprocessor">#else</span>00055 <span class="preprocessor"></span><span class="preprocessor"># if defined(HAVE_PTHREAD_H)</span>00056 <span class="preprocessor"></span><span class="preprocessor">#include <pthread.h></span>00057 <span class="preprocessor"># endif</span>00058 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00059 <span class="preprocessor"></span>00060 <span class="preprocessor">#include "oci.h"</span>00061 <span class="preprocessor">#include "<a class="code" href="sqlora_8h.html">sqlora.h</a>"</span>00062 00063 <span class="comment">/* If glib is enabled, we use the glib allocators */</span>00064 <span class="preprocessor">#ifdef USE_GLIB_ALLOC</span>00065 <span class="preprocessor"></span><span class="preprocessor"># include "glib.h"</span>00066 <span class="preprocessor"># define MALLOC g_malloc</span>00067 <span class="preprocessor"></span><span class="preprocessor"># define REALLOC g_realloc</span>00068 <span class="preprocessor"></span><span class="preprocessor"># define FREE(_p) {void ** l_p= (void **)&(_p); if ( *l_p != NULL ) {g_free( *l_p); *l_p = NULL; } }</span>00069 <span class="preprocessor"></span><span class="preprocessor">#else</span>00070 <span class="preprocessor"></span><span class="preprocessor"># define MALLOC malloc</span>00071 <span class="preprocessor"></span><span class="preprocessor"># define REALLOC realloc</span>00072 <span class="preprocessor"></span><span class="preprocessor"># define FREE(_p) {void ** l_p= (void**)&(_p); if ( *l_p != NULL ) {free( *l_p); *l_p = NULL; } }</span>00073 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00074 <span class="preprocessor"></span>00075 <span class="preprocessor">#if defined(WIN32)</span>00076 <span class="preprocessor"></span><span class="preprocessor">#define inline __inline</span>00077 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00078 <span class="preprocessor"></span>00079 <span class="preprocessor">#if defined (__STDC__) || defined (_AIX) || defined(PROTOTYPES) ||\</span>00080 <span class="preprocessor"> (defined (__mips) && defined (_SYSTYPE_SVR4)) ||\</span>00081 <span class="preprocessor"> defined(WIN32) || defined(__cplusplus)\</span>00082 <span class="preprocessor"> </span>00083 <span class="preprocessor"></span><span class="preprocessor"># define AND ,</span>00084 <span class="preprocessor"></span><span class="preprocessor"># define DEFUN(name, arglist, args) name(args)</span>00085 <span class="preprocessor"></span><span class="preprocessor"># define DEFUN_VOID(name) name(void) </span>00086 <span class="preprocessor"></span><span class="comment">/*</span>00087 <span class="comment"> * Macro to use instead of "void" for arguments that must have</span>00088 <span class="comment"> * type "void *" in ANSI C; maps them to type "char *" in</span>00089 <span class="comment"> * non-ANSI systems.</span>00090 <span class="comment"> */</span>00091 <span class="preprocessor"># define VOID void</span>00092 <span class="preprocessor"></span><span class="preprocessor">#else</span>00093 <span class="preprocessor"></span><span class="preprocessor"># define AND ;</span>00094 <span class="preprocessor"></span><span class="preprocessor"># define DEFUN(name, arglist, args) name arglist args;</span>00095 <span class="preprocessor"></span><span class="preprocessor"># define DEFUN_VOID(name) name()</span>00096 <span class="preprocessor"></span><span class="preprocessor"># define VOID char</span>00097 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00098 <span class="preprocessor"></span>00099 <span class="preprocessor">#ifndef NULL</span>00100 <span class="preprocessor"></span><span class="preprocessor"># define NULL 0</span>00101 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00102 <span class="preprocessor"></span>00103 <span class="comment">/*#define TEST_WITH_SIZEOF_RETURNING_ULONG*/</span>00104 00105 <span class="preprocessor">#ifdef TEST_WITH_SIZEOF_RETURNING_ULONG</span>00106 <span class="preprocessor"></span><span class="preprocessor">#define sizeof(_a) (unsigned long)sizeof(_a)</span>00107 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00108 <span class="preprocessor"></span>00109 00110 <span class="preprocessor">#if defined(ENABLE_PTHREADS) || defined(ENABLE_ORATHREADS) || defined(ENABLE_WINTHREADS)</span>00111 <span class="preprocessor"></span>00114 <span class="keyword">enum</span> {THREADS_ENABLED = 1};00115 <span class="preprocessor">#else</span>00116 <span class="preprocessor"></span><span class="keyword">enum</span> {THREADS_ENABLED = 0};00117 <span class="preprocessor">#endif</span>00118 <span class="preprocessor"></span>00119 00120 00121 <span class="preprocessor">#ifdef ENABLE_PTHREADS</span>00122 <span class="preprocessor"></span><span class="keyword">typedef</span> pthread_t sqlo_thread_t;00123 <span class="keyword">typedef</span> pthread_mutex_t sqlo_mutex_t;00124 <span class="preprocessor">#else</span>00125 <span class="preprocessor"></span><span class="preprocessor"># ifdef ENABLE_ORATHREADS</span>00126 <span class="preprocessor"></span><span class="keyword">typedef</span> OCIThreadMutex * sqlo_mutex_t;00127 <span class="keyword">typedef</span> OCIThreadId * sqlo_thread_t;00128 <span class="preprocessor"># else</span>00129 <span class="preprocessor"></span><span class="preprocessor"># ifdef ENABLE_WINTHREADS</span>00130 <span class="preprocessor"></span><span class="keyword">typedef</span> HANDLE sqlo_mutex_t;00131 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sqlo_thread_t;00132 <span class="preprocessor"># else</span>00133 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sqlo_mutex_t; <span class="comment">/* dummy */</span>00134 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sqlo_thread_t; <span class="comment">/* dummy */</span>00135 <span class="preprocessor"># endif</span>00136 <span class="preprocessor"></span><span class="preprocessor"># endif</span>00137 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00138 <span class="preprocessor"></span>00139
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -