C:/Users/vincent/Data/Perso/dev/ocilib/ocilib/src/oci_loader.h

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: oci_loader.h, v 3.4.0 2009-07-30 17:40 Vince $
00033  * ------------------------------------------------------------------------ */
00034 
00035 #ifndef OCILIB_OCI_LOADER_H_INCLUDED 
00036 #define OCILIB_OCI_LOADER_H_INCLUDED 
00037 
00038 
00039 #if defined(_AIX)
00040   #define  LIB_OPEN_FLAGS        RTLD_NOW | RTLD_GLOBAL | RTLD_MEMBER
00041 #elif defined(__hpux)           
00042   #define  LIB_OPEN_FLAGS        BIND_DEFERRED |BIND_VERBOSE| DYNAMIC_PATH
00043 #else
00044   #define  LIB_OPEN_FLAGS        RTLD_NOW | RTLD_GLOBAL
00045 #endif
00046 
00047 #if defined(_WINDOWS)
00048 
00049   #include <windows.h>
00050 
00051   #define LIB_HANDLE               HMODULE
00052   #define LIB_OPEN(l)              LoadLibraryA(l)
00053   #define LIB_CLOSE                FreeLibrary
00054   #define LIB_SYMBOL(h, s, p, t)   p = (t) GetProcAddress(h, s)
00055  
00056 #elif defined(__hpux)
00057 
00058   #include <dl.h>
00059 
00060   #define LIB_HANDLE               shl_t
00061   #define LIB_OPEN(l)              shl_load(l, LIB_OPEN_FLAGS , 0L)
00062   #define LIB_CLOSE                shl_unload
00063   #define LIB_SYMBOL(h, s, p, t)   shl_findsym(&h, s, (short) TYPE_PROCEDURE, (void *) &p)
00064 
00065 #else
00066 
00067   #ifdef HAVE_DLFCN_H
00068     #include <dlfcn.h>
00069   #endif
00070 
00071   #define LIB_HANDLE               void *
00072   #define LIB_OPEN(l)              dlopen(l, LIB_OPEN_FLAGS)
00073   #define LIB_CLOSE                dlclose
00074   #define LIB_SYMBOL(h, s, p, t)   p = (t) dlsym(h, s)
00075 
00076 #endif
00077 
00078 #endif    /* OCILIB_OCI_LOADER_H_INCLUDED */
00079 

Generated on Thu Jul 30 17:41:53 2009 for OCILIB (C Driver for Oracle) by  doxygen 1.5.4